Part Number Hot Search : 
BR1020 AIC1660 EDDTRPB 1100A SK191 2AS01G F1B1512V TS87C
Product Description
Full Text Search
 

To Download UM10430 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra UM10430 lpc18xx arm cortex-m3 microcontroller rev. 00.13 ? 20 july 2011 user manual document information info content keywords lpc18xx, lpc1850, lpc1830, lpc1 820, lpc1810, lpc1857, lpc1853, lpc1837, lpc1833, lpc1827, lpc18 25, lpc1823, lpc1822, lpc1817, lpc1815, lpc1813, lpc1812, lpc1 810, arm cortex-m3, spifi, sct, usb, ethernet abstract lpc18xx user manual describing rev ?-? and rev ?a? version of parts lpc1850/30/20/10 (flashless parts). a preliminary description of parts lpc1857/53/37/33/27/25/ 23/22/17/15/13/12 (flash-based parts) is included. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 2 of 1164 nxp semiconductors UM10430 lpc18xx user manual revision history rev date description 0.13 preliminary lpc18xx user manual. modifications: ? location of c_can1 reset updated in the rgu (see ta b l e 9 1 , ta b l e 9 3 , ta b l e 9 7 ). ? pin p2_7 replaced by pin p2_9 as boot pin in table 107 and ta b l e 8 . ? pin p2_7 designated as isp entry pin in table 107 . ? boot rom size increased to 64 kb. ? editorial updates. ? isp commands for flashless parts included in chapter 40 . 0.12 preliminary lpc18xx user manual. modifications: ? all content relating to lpc1850/30/20/10 rev ?-? moved to chapter 42 . ? repeater and plain input mode swapped in sfsp registers (see section 42.7.4.1 ). ? chapter 7 added. ? use of divide-by-two clock for emc added ( section 19.1 ). ? bit description of rit mask register updated ( table 608 ). ? overdrive mode removed in bits 1:0 of the pumucon register (see table 32 and ta b l e 9 1 8 ). 0.11 preliminary lpc18xx user manual. modifications: ? chapter 5 , chapter 6 , chapter 7 , chapter 14 , chapter 35 added. 0.10 preliminary lpc18xx user manual. modifications: ? chapter 14 , chapter 9 , chapter 13 , chapter 15 added. 0.09 preliminary lpc18xx user manual. modifications: ? register bit description and functional description removed in chapter 17 . api calls to be added. ? description of msgval bit updated in table 757 . ? mac_rwake_frflt register cannot used with bit-banding. see table 413 . ? description of rmii and mii pins corrected in table 401 . ? description of ethernet function in pins p1_16 and pc_8 updated. ? aes description removed chapter 4 ? lpc18xx security features ? . ? cgu pll0 output updated in table 107 . ? in ta b l e 1 7 5 , pin pc_0: change function 0 to n.c. and move enet_rx_clk to function 3. ? in ta b l e 1 7 5 , remove all sdio functions. ? in ta b l e 1 7 5 , change can1_rd, can1_td to can_rd, can_td. ? polarity of the enable bit updated in ta b l e 11 2 (1= power-down). ? wic replaced by event router throughout the manual. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 3 of 1164 contact information for more information, please visit: http://www.nxp.com for sales office addresses, please send an email to: salesaddresses@nxp.com nxp semiconductors UM10430 lpc18xx user manual 0.08 preliminary lpc18xx user manual. modifications: ? updated the reference clock for the frequency monitor register ( section 12.6.1 ). ? description of rtc calibration updated ( section 31.7.1 ). ? usb0 clock source description added to ta b l e 2 9 4 . ? usb1 clock source description added to ta b l e 3 5 8 . ? boot source bit 3 (pin p2_7) and usb0/1 boot modes added to ta b l e 7 and table 8 . ? add sram control register etbcfg in creg block ( ta b l e 3 6 ). ? rtc initialization steps updated ( section 31.2 ). ? access of lcd controller to sram updated ( section 23.7.1.1 and section 23.7.1.2 ). ? adc measurement range corrected ( section 38.3 ). ? gpdma, cxcontrol register: bits transfer size are given in number of transfers ( table 214 ). ? chapter 4 ? lpc18xx security features ? added. ? pin configuration updated ( table 175 ). ? flash parts added (see chapter 1 ? introductory information ? and chapter 2 ? lpc18xx memory mapping ? . ? chapter 40 ? lpc18xx flash programming interface ? added. 0.07 preliminary lpc18xx user manual. revision history ?continued rev date description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 4 of 1164 1.1 introduction the lpc18xx are arm cortex-m3 based microcontrollers for embedded applications. the arm cortex-m3 is a next generation core that offers system enhancements such as low power consumption, enhanced debug feat ures, and a high level of support block integration. the lpc18xx operate at cpu frequencies of up to 150 mhz. the arm cortex-m3 cpu incorporates a 3-stage pipeline and uses a harvard architecture with separate local instruction and data buses as well as a third bus for peripherals. the arm cortex-m3 cpu also includes an internal prefetch un it that supports speculative branching. the lpc18xx include up to 200 kb of on-chip sram data memory (flashless parts) or up to 136 kb of on-chip sram and up to 1 mb of flash (parts with on-chip flash), a quad spi flash interface (spifi), a state configurable timer (sct) subsystem, two high-speed usb controllers, ethernet, lcd, an external memory controller, and multiple digital and analog peripherals. remark: this user manual describes the rev ?-? and rev ?a? versions of parts lpc1850/30/20/10 (flashless parts) and pr ovides a preliminary description of the flash-based lpc18xx parts. the following peripherals are available on lpc1350/30/20/10 rev ?a? only: ? i2s1 ? c_can1 ? gpio pin interrupts ? gpio group interrupt 0/1 ? global input multiplexer array (gima) 1.2 features ? processor core ? arm cortex-m3 processor, running at frequencies of up to 150 mhz. ? arm cortex-m3 built-in memory protection unit (mpu) supporting eight regions. ? arm cortex-m3 built-in nested vect ored interrupt controller (nvic). ? non-maskable interrupt (nmi) input. ? jtag and serial wire debug, serial trace, eight breakpoints, and four watch points. ? etm and etb support. ? system tick timer. ? on-chip memory (flashless parts lpc1850/30/20/10) ? up to 200 kb sram total for code and data use. UM10430 chapter 1: introductory information rev. 00.13 ? 20 july 2011 user manual www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 5 of 1164 nxp semiconductors UM10430 chapter 1: introductory information ? two 32 kb sram blocks with separate bu s access. both sram blocks can be powered down individually. ? 64 kb rom containing boot code and on-chip software drivers. ? 32-bit one-time programmable (otp) memo ry for general-purpose customer use. ? on-chip memory (parts with on-chip flash) ? up to 1 mb total dual bank flas h memory with flash accelerator. ? in-system programming (isp) and in-application programming (iap) via on-chip bootloader software. ? up to 136 kb sram for code and data use. ? two 32 kb sram blocks with separate bu s access. both sram blocks can be powered down individually. ? 32 kb rom containing boot code and on-chip software drivers. ? 32-bit one-time programmable (otp) memo ry for general-purpose customer use. ? clock generation unit ? crystal oscillator with an opera ting range of 1 mhz to 25 mhz. ? 12 mhz internal rc oscillato r trimmed to 1 % accuracy. ? ultra-low power rtc crystal oscillator. ? three plls allow cpu operation up to the maximum cpu rate without the need for a high-frequency crystal. the second pll is dedicated to the high-speed usb, the third pll can be used as audio pll. ? clock output. ? serial interfaces: ? quad spi flash interface (spi fi) with four lanes and data rates of up to 40 mb per second total. ? 10/100t ethernet mac with rmii and mii interfaces and dma support for high throughput at low cpu load. support for ieee 1588 time stamping/adva nced time stamping (ieee 1588-2008 v2). ? one high-speed usb 2.0 host/device/otg interface with dma support and on-chip phy. ? one high-speed usb 2.0 host/device interface with dma support, on-chip full-speed phy and ulpi interface to external high-speed phy. ? usb interface electrical test so ftware included in rom usb stack. ? four 550 uarts with dma support: one uart with full modem interface; one uart with irda interface; three usarts support synchronous mode and a smart card interface conforming to iso7816 specification. ? two c_can 2.0b controllers with one channel each. ? two ssp controllers with fifo and multi- protocol support. both ssps with dma support. ? one fast-mode plus i 2 c-bus interface with monitor mode and with open-drain i/o pins conforming to the full i 2 c-bus specification. supports data rates of up to 1 mbit/s. ? one standard i 2 c-bus interface with monitor mode and standard i/o pins. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 6 of 1164 nxp semiconductors UM10430 chapter 1: introductory information ? two i 2 s interfaces with dma support, each with one input and one output. ? digital peripherals: ? external memory controller (emc) support ing external sram, rom, nor flash, and sdram devices. ? lcd controller with dma support and a programmable display resolution of up to 1024h ? 768v. supports monochrome and color stn panels and tft color panels; supports 1/2/4/8 bpp clut an d 16/24-bit direct pixel mapping. ? sd/mmc card interface. ? eight-channel general-purpose dma (gpdma) controller can access all memories on the ahb and all dma-capable ahb slaves. ? up to 80 general-purpose input/outp ut (gpio) pins with configurable pull-up/pull-down resistors and open-drain modes. ? gpio registers are located on the ahb for fast access. gpio ports have dma support. ? state configurable timer (sct) subsystem on ahb. ? four general-pur pose timer/counters with ca pture and match capabilities. ? one motor control pwm for three-phase motor control. ? one quadrature encoder interface (qei). ? repetitive interrupt timer (ri timer). ? windowed watchdog timer. ? ultra-low power real-time clock (rtc) on separate power domain with 256 bytes of battery powered backup registers. ? alarm timer; can be battery powered. ? digital peripherals available on flash-based parts lpc18xx only: ? ? analog peripherals: ? one 10-bit dac with dma support and a data conversion rate of 400 ksamples/s. ? two 10-bit adcs with dma support and a data conversion rate of 400 ksamples/s. ? security: ? hardware-based aes security engine programmabl e through an on-chip api. ? two 128-bit secure otp memories fo r aes key storage an d customer use. ? unique id for each device. ? power: ? single 3.3 v (2.2 v to 3.6 v) power supply with on-chip internal voltage regulator for the core supply and the rtc power domain. ? rtc power domain can be powered separately by a 3 v battery supply. ? four reduced power modes: sleep, deep-sleep, power-down, and deep power-down. ? processor wake-up from sleep mode via wake-up interrupts from various peripherals. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 7 of 1164 nxp semiconductors UM10430 chapter 1: introductory information ? wake-up from deep-sleep, power-down, and deep power-down modes via external interrupts and interrupts generated by battery powered blocks in the rtc power domain. ? brownout detect with four separate thre sholds for interrupt and forced reset. ? power-on reset (por). ? available as 100-pin, 144-pin, and 208-pin lqfp packages and as 100-pin, 180-pin, and 256-pin lbga packages. 1.3 ordering information (fl ashless parts lpc1850/30/20/10) table 1. ordering information type number package name description version lpc1850fet256 lbga256 plastic low profile ba ll grid array package; 256 balls; body 17 ? 17 ? 1 mm sot740-2 lpc1850fet180 tfbga180 thin fine-pitch ball grid array package; 180 balls sot570-3 lpc1850fbd208 lqfp208 plastic low profile quad flat package; 208 leads; body 28 x 28 x 1.4 mm sot459-1 lpc1830fet256 lbga256 plastic low profile ba ll grid array package; 256 balls; body 17 ? 17 ? 1 mm sot740-2 lpc1830fet180 tfbga180 thin fine-pitch ball grid array package; 180 balls sot570-3 lpc1830fet100 tfbga100 plastic thin fine-pitch ball grid array package; 100 balls; body 9 x 9 x 0.7 mm sot926-1 lpc1830fbd144 lqfp144 plastic low profile quad flat package; 144 leads; body 20 x 20 x 1.4 mm sot486-1 lpc1820fet100 tfbga100 plastic thin fine-pitch ball grid array package; 100 balls; body 9 x 9 x 0.7 mm sot926-1 lpc1820fbd144 lqfp144 plastic low profile quad flat package; 144 leads; body 20 x 20 x 1.4 mm sot486-1 lpc1820fbd100 lqfp100 plastic low profile quad flat package; 100 leads; body 14 x 14 x 1.4 mm sot407-1 lpc1810fet100 tfbga100 plastic thin fine-pitch ball grid array package; 100 balls; body 9 x 9 x 0.7 mm sot926-1 table 2. ordering options type number total sram lcd ethernet usb0 (host, device, otg) usb1 (host, device) gpio package lpc1850fet256 200 kb yes yes yes yes 164 lbga256 lpc1850fet180 200 kb yes yes yes yes 118 tfbga180 lpc1850fbd208 200 kb yes yes yes yes 164 lqfp208 lpc1830fet256 200 kb no yes yes yes 164 lbga256 lpc1830fet180 200 kb no yes yes yes 118 tfbga180 lpc1830fet100 200 kb no yes yes yes 49 tfbga100 lpc1830fbd144 200 kb no yes yes yes 83 lqfp144 lpc1820fet100 168 kb no no yes no 49 tfbga100 lpc1820fbd144 168 kb no no yes no 83 lqfp144 lpc1820fbd100 168 kb no no yes no 49 lqfp100 lpc1810fet100 136 kb no no no no 49 tfbga100 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 8 of 1164 nxp semiconductors UM10430 chapter 1: introductory information 1.4 ordering information (parts with on-chip flash) table 3. ordering information (parts with on-chip flash) type number package name description version lpc1857fet256 lbga256 plastic low profile ba ll grid array package; 256 balls; body 17 ? 17 ? 1 mm sot740-2 lpc1857 lqfp208 lpc1857 bga180 lpc1837fet256 lbga256 plastic low profile ba ll grid array package; 256 balls; body 17 ? 17 ? 1 mm sot740-2 lpc1837 lqfp208 lpc1837 bga180 lpc1827 lqfp144 lpc1827fet100 bga100 lpc1825 lqfp144 lpc1825fet100 bga100 lpc1823 lqfp144 lpc1823fet100 bga100 lpc1822 lqfp144 lpc1822fet100 bga100 lpc1817 lqfp144 lpc1817fet100 bga100 lpc1815 lqfp144 lpc1815fet100 bga100 lpc1813 lqfp144 lpc1813fet100 bga100 lpc1811 lqfp144 lpc1811fet100 bga100 table 4. ordering options (parts with on-chip flash) type sram total flash total flash bank a flash bank b lcd ethernet usb0 (host, device, otg) usb1 (host, device) packages lpc1857 136 kb 1 mb 512 kb 512 kb yes yes yes yes lbga256; bga180; lqfp208 lpc1853 136 kb 512 kb 256 kb 256 kb yes yes yes yes lbga256; bga180; lqfp208 lpc1837 136 kb 1 mb 512 kb 512 kb no yes yes yes lbga256; bga180; lqfp208 lpc1833 136 kb 512 kb 256 kb 256 kb no yes yes yes lbga256; bga180; lqfp208 lpc1827 136 kb 1 mb 512 kb 512 kb no no yes no lqfp144; bga100 lpc1825 136 kb 768 kb 384 kb 384 kb no no yes no lqfp144; bga100 lpc1823 104 kb 512 kb 256 kb 256 kb no no yes no lqfp144; bga100 lpc1822 104 kb 512 kb 512 kb 0 no no yes no lqfp144; bga100 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 9 of 1164 nxp semiconductors UM10430 chapter 1: introductory information lpc1817 136 kb 1 mb 512 kb 512 kb no no no no lqfp144; bga100 lpc1815 136 kb 768 kb 384 kb 384 kb no no no no lqfp144; bga100 lpc1813 104 kb 512 kb 256 kb 256 kb no no no no lqfp144; bga100 lpc1812 104 kb 512 kb 512 kb 0 no no no no lqfp144; bga100 table 4. ordering options (parts with on-chip flash) type sram total flash total flash bank a flash bank b lcd ethernet usb0 (host, device, otg) usb1 (host, device) packages www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 10 of 1164 nxp semiconductors UM10430 chapter 1: introductory information 1.5 block diagram (flashle ss parts lpc1850/30/20/10) fig 1. lpc18xx block diagram (flashless parts) arm cortex-m3 test/debug interface i-code bus d-code bus system bus swd/trace port/jtag gpdma ethernet (1) 10/100 mac ieee 1588 usb1 (1) host/ device high- speed usb0 (1) host/ device/ otg lcd (1) sd/ mmc emc high-speed phy 16/32 kb ahb sram 16 kb + 16 kb ahb sram (1) spifi aes hs gpio sct 64 kb rom ahb multilayer matrix lpc1850/30/20/10 64/96 kb local sram 40 kb local sram 002aaf218 slaves masters wwdt usart0 uart1 ssp0 i 2 c0 c_can1 i 2 s0 i 2 s1 motor control pwm (1) timer3 timer2 usart2 usart3 ssp1 ri timer qei (1) gima bridge 0 bridge 1 bridge 2 bridge 3 bridge 10-bit adc0 10-bit adc1 c_can0 i 2 c1 10-bit dac bridge rgu ccu2 cgu ccu1 alarm timer configuration registers otp memory event router power mode control 12 mhz irc rtc power domain backup registers rtc osc rtc slaves = connected to gpdma timer0 timer1 scu gpio interrupts gpio group0 interrupt gpio group1 interrupt www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 11 of 1164 nxp semiconductors UM10430 chapter 1: introductory information fig 2. lpc18xx ahb multilayer matrix connections (flashless parts) arm cortex-m3 test/debug interface gpdma ethernet (1) usb1 (1) usb0 (1) lcd (1) sd/ mmc slaves 64 kb rom 64/96 kb local sram 40 kb local sram tem bus i-code bus d-code bus masters 01 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 12 of 1164 nxp semiconductors UM10430 chapter 1: introductory information 1.6 block diagram (parts with on-chip flash) (1) not available on all parts (see ta b l e 4 ). fig 3. lpc185x/3x/2x/1x block diagram (parts with on-chip flash) arm cortex-m3 test/debug interface i-code bus d-code bus system bus swd/trace port/jtag gpdma ethernet (1) 10/100 mac ieee 1588 usb1 (1) host/ device high- speed usb0 (1) host/ device/ otg lcd (1) sd/ mmc (1) high-speed phy ahb multilayer matrix lpc185x/3x/2x/1x slaves masters wwdt usart0 uart1 ssp0 i 2 c0 i 2 s0 motor control pwm timer3 timer2 usart2 usart3 ssp1 ri timer qei bridge 0 bridge 1 bridge 2 bridge 3 bridge 10-bit adc0 10-bit adc1 c_can0 i 2 c1 10-bit dac bridge rgu ccu2 cgu ccu1 alarm timer configuration registers otp memory event router power mode control 12 mhz irc rtc power domain backup registers rtc osc rtc slaves = connected to gpdma timer0 timer1 scu emc 32 kb ahb sram 16 +16 kb ahb sram spifi aes hs gpio spi sgpio sct 32 kb rom 32 kb local sram (1) 40 kb local sram 512 kb flash (1) 512 kb flash (1) c_can1 i 2 s1 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 13 of 1164 nxp semiconductors UM10430 chapter 1: introductory information (1) not available on all parts (see ta b l e 4 ). fig 4. ahb multilayer matrix master and slave connections arm cortex-m3 test/debug interface gpdma ethernet (1) usb1 (1) usb0 (1) lcd (1) sd/ mmc (1) external memory controller ahb register interfaces, apb, rtc domain peripherals 32 kb ahb sram 16 kb + 16 kb ahb sram slaves 32 kb rom 32 kb local sram (1) 40 kb local sram system bus i-code bus d-code bus masters 01 ahb multilayer matrix = master-slave connection 512 kb flash (1) 512 kb flash (1) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 14 of 1164 2.1 how to read this chapter the available peripherals and their memories vary for different parts. ? ethernet: available on lpc185x/3x. ? usb0: available on lpc185x/3x/2x. ? usb1: available on lpc185x/3x. ? sram: see ta b l e 5 . ? flash: see ta b l e 6 . the registers and memory regions correspondi ng to unavailable peripheral and memory blocks are reserved. the following memory blocks are available on lpc1350/30/20/10 rev ?a? only: ? i2s1 at address 0x400a 3000. ? c_can1 at address 0x400a 4000. ? gpio pin interrupts 0x4008 7000. ? gpio group interrupt 0/1 at addresses 0x4008 8000 and 0x4008 9000. ? high-speed gpio at address 0x400f 4000 (on parts lpc1850/30/20/10 rev ?-? parts, the gpio block resides at address 0x400f 0000). ? global input multiplexer array (gima) at address 0x400c 7000. 2.2 basic configuration in the creg block (see ta b l e 3 6 ), select the interface to ac cess the 16 kb block of ram located at address 0x2000 c000. this ram memory block can be accessed either by the etb (this is the default) or be used as normal sram on the ahb bus. 2.3 memory configuration 2.3.1 on-chip static ram the lpc18xx support up to 136 kb sram (parts with on-chip flash) or up to 200 kb sram (flashless parts lpc1850/30/20/10) with separate bus master access for higher throughput and individual power control for low power operation. UM10430 chapter 2: lpc18xx memory mapping rev. 00.13 ? 20 july 2011 user manual www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 15 of 1164 nxp semiconductors UM10430 chapter 2: lpc18xx memory mapping 2.3.2 on-chip flash the available flash configuration for the lpc185x/3x/2x/1x is shown in ta b l e 6 . a flash accelerator maximizes performance fo r use with the two fast ahb buses. table 5. lpc185x/3x/2x/1x sram configuration part local sram local sram local sram local sram ahb sram ahb sram ahb sram 0x1000 0000 0x1001 0000 0x1008 0000 0x1008 8000 0x2000 0000 0x2000 8000 0x2000 c000 lpc1850 64 kb 32 kb 32 kb 8 kb 32 kb 16 kb 16 kb figure 5 lpc1830 64 kb 32 kb 32 kb 8 kb 32 kb 16 kb 16 kb figure 5 lpc1820 64 kb 32 kb 32 kb 8 kb 16 kb - 16 kb figure 5 lpc1810 64 kb - 32 kb 8 kb 16 kb - 16 kb figure 5 lpc1857 figure 7 lpc1853 figure 7 lpc1837 figure 7 lpc1833 figure 7 lpc1827 figure 7 lpc1825 figure 7 lpc1823 figure 7 lpc1822 figure 7 lpc1817 figure 7 lpc1815 figure 7 lpc1813 figure 7 lpc1812 figure 7 table 6. lpc185x/3x/2x/1x flash configuration part flash bank a 256 kb flash bank a 128 kb flash bank a 128 kb flash bank b 256 kb flash bank b 128 kb flash bank b 128 kb 0x1a00 0000 0x1a04 000 0x1a0 6000 0x1b00 0000 0x1b04 000 0x1b0 6000 lpc1857 yes yes yes yes yes yes lpc1853 yes no no yes no no lpc1837 yes yes yes yes yes yes lpc1833 yes no no yes no no lpc1827 yes yes yes yes yes yes lpc1825 yes yes no yes yes no lpc1823 yes no no yes no no lpc1822 yes yes yes no no no lpc1817 yes yes yes yes yes yes www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 16 of 1164 nxp semiconductors UM10430 chapter 2: lpc18xx memory mapping 2.3.3 bit banding remark: bit banding can not be used with the mac_rwake_frflt register (see section 22.6.10 ). 2.4 general description lpc1815 yes yes no yes yes no lpc1813 yes no no yes no no lpc1812 yes yes yes no no no table 6. lpc185x/3x/2x/1x flash configuration part flash bank a 256 kb flash bank a 128 kb flash bank a 128 kb flash bank b 256 kb flash bank b 128 kb flash bank b 128 kb 0x1a00 0000 0x1a04 000 0x1a0 6000 0x1b00 0000 0x1b04 000 0x1b0 6000 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 17 of 1164 nxp semiconductors UM10430 chapter 2: lpc18xx memory mapping 2.5 memory map (flashless parts lpc1850/30/20/10) fig 5. system memory map - flashless parts lpc1850/30/20/10 (see figure 6 for detailed addresses of all peripherals) reserved peripheral bit band alias region reserved high-speed gpio reserved 0x0000 0000 0 gb 1 gb 4 gb 0x2001 0000 0x2200 0000 0x2400 0000 0x2800 0000 0x1000 0000 0x3000 0000 0x4000 0000 0x4001 2000 0x4004 0000 0x4005 0000 0x4010 0000 0x4400 0000 0x6000 0000 ahb peripherals apb peripherals #0 apb peripherals #1 reserved reserved reserved rtc domain peripherals 0x4006 0000 0x4008 0000 0x4009 0000 0x400a 0000 0x400b 0000 0x400c 0000 0x400d 0000 0x400e 0000 0x400f 0000 0x400f 1000 0x400f 2000 0x400f 4000 0x400f 8000 clocking/reset peripherals apb peripherals #2 apb peripherals #3 0x2000 8000 16 kb ahb sram (lpc1850/30) 16 kb ahb sram (lpc1850/30/20/10) 0x2000 c000 16 kb ahb sram (lpc1850/30) 16 kb ahb sram (lpc1850/30/20/10) reserved reserved aes 0x4010 1000 0x4010 2000 0x4200 0000 reserved local sram/ external static memory banks 0x2000 0000 0x2000 4000 128 mb dynamic external memory dycs0 256 mb dynamic external memory dycs1 256 mb dynamic external memory dycs2 256 mb dynamic external memory dycs3 0x7000 0000 0x8000 0000 0x8800 0000 0xe000 0000 256 mb shadow area 1000 0000 1001 8000 1008 0000 008 a000 1040 0000 1041 0000 c00 0000 d00 0000 reserved reserved 32 mb ahb sram bit banding reserved reserved reserved 0xe010 0000 0xffff ffff reserved spifi data arm private bus reserved 1001 0000 32 kb local sram (lpc1850/30/20) 64 kb local sram (lpc1850/30/20/10) 32 kb + 8 kb local sram (lpc1850/30/20/10) reserved reserved reserved reserved 64 kb rom e00 0000 f00 0000 2000 0000 16 mb static external memory cs3 16 mb static external memory cs2 16 mb static external memory cs1 16 mb static external memory cs0 1400 0000 1800 0000 64 mb spifi data 002aaf228 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 18 of 1164 nxp semiconductors UM10430 chapter 2: lpc18xx memory mapping fig 6. memory map with peripherals - flashless parts lpc1850/30/20/10 (see figure 5 for detailed addresses of memory blocks) reserved peripheral bit band alias region high-speed gpio reserved reserved reserved 0x4000 0000 0x0000 0000 0x4001 2000 0x4004 0000 0x4005 0000 0x4010 0000 0x4400 0000 0x6000 0000 0xffff ffff ahb peripherals sram memories external memory banks apb0 peripherals apb1 peripherals reserved reserved reserved rtc domain peripherals 0x4006 0000 0x4008 0000 0x4009 0000 0x400a 0000 0x400b 0000 0x400c 0000 0x400d 0000 0x400e 0000 0x400f 0000 0x400f 1000 0x400f 2000 0x400f 4000 0x400f 8000 clocking/reset peripherals apb2 peripherals apb3 peripherals reserved reserved aes 0x4010 1000 0x4010 2000 0x4200 0000 reserved external memories and arm private bus apb2 peripherals 0x400c 1000 0x400c 2000 0x400c 3000 0x400c 4000 0x400c 6000 0x400c 8000 0x400c 7000 0x400c 5000 0x400c 0000 ri timer usart2 usart3 timer2 timer3 ssp1 qei apb1 peripherals 0x400a 1000 0x400a 2000 0x400a 3000 0x400a 4000 0x400a 5000 0x400b 0000 0x400a 0000 motor control pwm i2c0 i2s0 i2s1 c_can1 reserved ahb peripherals 0x4000 1000 0x4000 0000 sct 0x4000 2000 0x4000 3000 0x4000 4000 0x4000 6000 0x4000 8000 0x4001 0000 0x4001 2000 0x4000 9000 0x4000 7000 0x4000 5000 dma sd/mmc emc usb1 lcd usb0 reserved spifi ethernet reserved 0x4008 1000 0x4008 0000 wwdt 0x4008 2000 0x4008 3000 0x4008 4000 0x4008 6000 0x4008 a000 0x4008 7000 0x4008 8000 0x4008 9000 0x4008 5000 uart1 w/ modem ssp0 timer0 timer1 scu gpio interrupts gpio group0 interrupt gpio group1 interrupt usart0 rtc domain peripherals 0x4004 1000 0x4004 0000 alarm timer 0x4004 2000 0x4004 3000 0x4004 4000 0x4004 6000 0x4004 7000 0x4004 5000 power mode control creg event router otp controller reserved reserved rtc backup registers clocking reset control peripherals 0x4005 1000 0x4005 0000 cgu 0x4005 2000 0x4005 3000 0x4005 4000 0x4006 0000 ccu2 rgu ccu1 lpc1850/30/20/10 002aaf229 reserved reserved apb3 peripherals 0x400e 1000 0x400e 2000 0x400e 3000 0x400e 4000 0x400f 0000 0x400e 5000 0x400e 0000 i2c1 dac c_can0 adc0 adc1 reserved gima apb0 peripherals www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 19 of 1164 nxp semiconductors UM10430 chapter 2: lpc18xx memory mapping 2.6 memory map (parts with on-chip flash) (1) not available on all parts (see ta b l e 4 ). fig 7. system memory map - part s with on-chip flash (overview) reserved peripheral bit band alias region reserved 0x0000 0000 0 gb 1 gb 4 gb 0x2001 0000 0x2200 0000 0x2400 0000 0x2800 0000 0x1000 0000 0x3000 0000 0x4000 0000 0x4001 2000 0x4004 0000 0x4005 0000 0x4010 0000 0x4400 0000 0x6000 0000 ahb peripherals apb peripherals #0 apb peripherals #1 reserved reserved reserved rtc domain peripherals 0x4006 0000 0x4008 0000 0x4009 0000 0x400a 0000 0x400b 0000 0x400c 0000 0x400d 0000 0x400e 0000 0x400f 0000 0x400f 1000 0x400f 2000 clocking/reset peripherals apb peripherals #2 apb peripherals #3 0x2000 8000 16 kb ahb sram 16 kb ahb sram 0x2000 c000 16 kb ahb sram 16 kb ahb sram high-speed gpio reserved reserved aes 0x4010 1000 0x4010 2000 0x4200 0000 reserved local sram/dual flash banks/ external static memory banks 0x2000 0000 0x2000 4000 128 mb dynamic external memory dycs0 256 mb dynamic external memory dycs1 256 mb dynamic external memory dycs2 256 mb dynamic external memory dycs3 0x7000 0000 0x8000 0000 0x8800 0000 0xe000 0000 256 mb shadow area lpc185x/3x/2x/1x reserved reserved 32 mb ahb sram bit banding reserved reserved 0xe010 0000 0xffff ffff reserved spifi data arm private bus reserved 002aaf228wflash 0x1000 0000 0x1000 8000 0x1008 0000 0x1008 a000 0x1040 0000 0x1040 8000 0x1c00 0000 0x1d00 0000 32 kb local sram (1) 32 kb + 8 kb local sram reserved reserved reserved reserved reserved 32 kb rom 0x1e00 0000 0x1f00 0000 0x2000 0000 16 mb static external memory cs3 16 mb static external memory cs2 16 mb static external memory cs1 16 mb static external memory cs0 0x1a00 0000 0x1a04 0000 0x1a06 0000 0x1a08 0000 256 kb flash bank a 128 kb flash bank a 128 kb flash bank a 0x1b00 0000 0x1b08 0000 0x1b04 0000 0x1b06 0000 256 kb flash bank b 128 kb flash bank b 128 kb flash bank b www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 20 of 1164 nxp semiconductors UM10430 chapter 2: lpc18xx memory mapping (1) not available on all parts (see ta b l e 4 ). fig 8. memory mapping - parts wi th on-chip flas h (peripherals) reserved peripheral bit band alias region reserved 0x4000 0000 0x0000 0000 0x4001 2000 0x4004 0000 0x4005 0000 0x4010 0000 0x4400 0000 0x6000 0000 0xffff ffff ahb peripherals sram memories external memory banks apb peripherals #0 apb peripherals #1 reserved reserved reserved rtc domain peripherals 0x4006 0000 0x4008 0000 0x4009 0000 0x400a 0000 0x400b 0000 0x400c 0000 0x400d 0000 0x400e 0000 0x400f 0000 0x400f 1000 0x400f 2000 clocking/reset peripherals apb peripherals #2 apb peripherals #3 high-speed gpio reserved reserved aes 0x4010 1000 0x4010 2000 0x4200 0000 reserved external memories and arm private bus apb2 peripherals apb1 peripherals ahb peripherals 0x4000 1000 0x4000 0000 sct 0x4000 2000 0x4000 3000 0x4000 4000 0x4000 6000 0x4000 8000 0x4001 0000 0x4001 2000 0x4000 9000 0x4000 7000 0x4000 5000 dma sd/mmc (1) emc usb1 (1) lcd (1) usb0 (1) reserved spifi ethernet (1) reserved apb0 peripherals rtc domain peripherals 0x4004 1000 0x4004 0000 alarm timer 0x4004 2000 0x4004 3000 0x4004 4000 0x4004 6000 0x4004 7000 0x4004 5000 power mode control creg event router otp controller reserved reserved rtc backup registers clocking and reset control peripherals 0x4005 1000 0x4005 0000 cgu 0x4005 2000 0x4005 3000 0x4005 4000 0x4006 0000 ccu2 rgu ccu1 lpc185x/3x/2x/1x 002aaf229wflash reserved reserved apb3 peripherals 0x400c 1000 0x400c 2000 0x400c 3000 0x400c 4000 0x400c 6000 0x400d 0000 0x400c 7000 0x400c 5000 0x400c 0000 ri timer usart2 usart3 timer2 timer3 ssp1 qei 0x400a 1000 0x400a 2000 0x400a 3000 0x400a 4000 0x400a 5000 0x400b 0000 0x400a 0000 motor control pwm i2c0 i2s0 i2s1 c_can1 reserved 0x4008 1000 0x4008 0000 wwdt 0x4008 2000 0x4008 3000 0x4008 4000 0x4008 6000 0x4009 0000 0x4008 7000 0x4008 5000 uart1 w/ modem ssp0 timer0 timer1 scu reserved usart0 0x400e 1000 0x400e 2000 0x400e 3000 0x400e 4000 0x400f 0000 0x400e 5000 0x400e 0000 i2c1 dac c_can0 adc0 adc1 reserved reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 21 of 1164 nxp semiconductors UM10430 chapter 2: lpc18xx memory mapping www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 22 of 1164 3.1 how to read this chapter this chapter applies to flashless parts lpc1850/30/20/10 only. 3.2 features the boot rom memory includes the following features: ? rom memory size is 64 kb. ? supports booting from uart interfaces and external static memory such as nor flash, spi flash, quad spi flash. ? includes apis for power control and otp programming. ? includes spifi and usb drivers. ? isp mode for loading data to on-chip sr am and execute code from on-chip sram. aes capable parts also support: ? cmac authentication on the boot image. ? secure booting from an encrypted image. ? supports development mode for booting from a plain text image. development mode is terminated by programming the aes key. ? api for aes programming. 3.3 functional description the internal rom memory is used to stor e the boot code. after a reset, the arm processor will start its code ex ecution from this memory. the arm core is configured to start executin g code, upon reset, with the program counter being set to the value 0x0000 0000. the lpc1 8xx contains a shadow pointer that allows areas of memory to be mapped to address 0x0000 0000. the default value of the shadow pointer is 0x1040 0000, ensuring that the code contained in the boot rom is executed at reset. several boot modes are available depending on the values of the otp bits boot_src. if the otp memory is not programmed or the boot_src bits are all zero, the boot mode is determined by the states of the bo ot pins p2_8, p2_8, p1_2, and p1_1. UM10430 chapter 3: lpc18xx boot rom rev. 00.13 ? 20 july 2011 user manual www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 23 of 1164 nxp semiconductors UM10430 chapter 3: lpc18xx boot rom [1] the boot loader programs the appropriate pin functi on at reset to boot using either ssp0 or spifi. [1] the boot loader programs the appropriate pin functi on at reset to boot using either ssp0 or spifi. table 7. boot mode when otp boot_src bits are programmed boot mode boot_src bit 3 boot_src bit 2 boot_src bit 1 boot_src bit 0 description boot pins 0 0 0 0 boot source is defined by the reset state of p1_1, p1_2, and p2_8 pins. see ta b l e 8 . uart 0 0 0 1 boot from device connected to usart0 using pins p2_0 and p2_1. spifi 0 0 1 0 boot from quad spi fl ash connected to the spifi interface using pins p3_3 to p3_8. emc 8-bit 0 0 1 1 boot from external static memory (such as nor flash) using cs0 and an 8-bit data bus. emc 16-bit 0 1 0 0 boot from external static memory (such as nor flash) using cs0 and a 16-bit data bus. emc 32-bit 0 1 0 1 boot from external static memory (such as nor flash) using cs0 and a 32-bit data bus. usb0011 0boot from usb0. usb1011 1boot from usb1. spi (ssp) 1 0 0 0 boot from spi fl ash connected to the ssp0 interface on p3_3, p3_6, p3_7 and p3_8 [1] . usart3 1 0 0 1 boot from device connected to usart3 using pins p2_3 and p2_4. table 8. boot mode when opt boot_src bits are zero boot mode p2_9 p2_8 p1_2 p1_1 description usart0 low low low low boot from device con nected to usart0 using pins p2_0 and p2_1. spifi low low low high boot from quad spi flas h connected to the spifi interface on p3_3 to p3_8 [1] . emc 8-bit low low high low boot from external st atic memory (such as nor flash) using cs0 and an 8-bit data bus. emc 16-bit low low high high boot fr om external static memory (such as nor flash) using cs0 and a 16-bit data bus. emc 32-bit low high low low boot from external st atic memory (such as nor flash) using cs0 and a 32-bit data bus. usb0 low high low high boot from usb0. usb1 low high high low boot from usb1. spi (ssp) low high high high boot from spi flas h connected to the ssp0 interface on p3_3, p3_6, p3_7 and p3_8 [1] . usart3 high low low low boot fr om device connected to usart3 using pins p2_3 and p2_4. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 24 of 1164 nxp semiconductors UM10430 chapter 3: lpc18xx boot rom 3.3.1 aes capable devices aes capable products will normally always boot from a secure (encry pted) image and use cmac authentication. however a special development mode allows booting from a plain text image. this developm ent mode is active when the aes key has not been programmed. in this case the aes key consists of all zeros. once the key is programmed (to a non-zero value), the development mode is terminated. 3.3.2 boot process the top level boot proc ess is illustrated in figure 9 . the boot starts after reset is released. the irc is selected as cpu clock and the cortex-m3 starts by executing boot rom. by default the jtag access to the chip is disabled at reset. when the part is non-aes capable or it is aes capable but the aes key has not been programmed then jtag access is enabled. as shown in figure 9 , the boot rom determines the boot mode based on the otp boot_src value or reset state of the pins p1_1, p1_2, p2_8, and p2_9. the boot rom copies the image to internal sram at location 0x1000 0000 and jumps to that location (sets arm's shadow pointer to 0x1000 0000) after image verification. hence the images for lpc18xx should be compiled with entry point at 0x0000 0000. on aes capable lpc18xx with a programmed aes key the image and header are authen ticated using the cmac algorithm. if authenticat ion fails the device is reset. on aes capable lpc18xx in development mode and non-aes capa ble lpc18xx, the image and header are not authenticated. if the image is not preceded by a header then the image is not copied to sram but assumed to be executable as-is. in that case the shadow pointer is set to t he first address location of the external boot memory. the header-less images for lpc18xx should be compiled with entry point at 0x0000 0000, the same as for an image with header. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 25 of 1164 nxp semiconductors UM10430 chapter 3: lpc18xx boot rom fig 9. boot process 4 of lpc 18 xx reset disable irq & mpu cpu clock = irc 12 mhz check boot _ src aes capable and key > 0 ? load aes key yes uart 0 boot spifi boot check pins p 2 _ 9 , p 2 _ 8 , p 1 _ 2 , p 1 _ 1 = 0 = 0 emc 8 b boot emc 32 b boot emc 16 b boot = 1 > 10 enable jtag no valid header ? yes no aes capable and cmac active ? yes copy image to sram and calculate cmac tag valid tag ? decrypt image in sram yes set shadow pointer = 0 x 1000 0000 development mode ? yes no copy image to sram reset no = 1 .. 4 , 7 cpu clock = pll 1 96 mhz read header read header = 2 .. 5 , 8 > 9 set shadow pointer = 0 x 1000 0000 set shadow pointer = boot address no spi boot uart 3 boot = 6 .. 7 , 9 usb 1 boot usb 2 boot boot _ src = 6 or pins = 5 boot _ src = 7 or pins = 6 boot _ src = 9 or pins = 8 boot _ src = 8 or pins = 7 boot _ src = 2 or pins = 1 boot _ src = 3 or pins = 2 boot _ src = 4 or pins = 3 boot _ src = 5 or pins = 4 boot _ src = 1 or pins = 0 valid header ? yes no 60 s timeout toggle pin p 1 _ 1 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 26 of 1164 nxp semiconductors UM10430 chapter 3: lpc18xx boot rom 3.3.3 boot image format aes capable products with a programmed aes ke y will always boot fr om a secure image and use cmac authentication. a secure image should always include a header. non-aes capable products may bo ot from an image with header or execute directly from the boot source (when the boot source is memory mapped; spifi or emc). when no valid header is found t hen the cpu will try to execute code from the first location of the memory mapped boot source. the user should take ca re that this location contains executable code, otherwise a hard fault exception will occu r. this exception jumps to a while(1) loop. the image must be preceded by a header that has the layout described in ta b l e 9 . non-encrypted images may omit the header. [1] can only be active if device is aes capable, else is considered an invalid image. [2] 16 extra bytes are required for the header bytes. [3] the image size should be set to no more than the size of the sram located at 0x1000 0000. table 9. image header address name description size [bits] 5:0 aes_active [1] aes encryption active 0x25 (100101): aes en cryption active 0x1a (011010): aes encryption not active else: invalid image 6 7:6 hash_active [1] indicates whether a hash is used: 00: cmac hash is used, value is hash_value 01: reserved 10: reserved 11: no hash is used 2 13:8 reserved 11...11 (binary) 6 15:14 aes_control these 2 bits can be set to a value such that when aes encryption is active, that the aes_active field, after aes encryption, is not equal to the value 0x1a (aes encryption not active) 2 31:16 hash_size [3] size of the part of t he image over which the hash value is calculated in number of 512 byte frames. also size of image copied to internal sram at boot time. hash size = 16 [2] + hash_size x 512 byte. 16 95:32 hash_value cmac hash value calculated over the first bytes of the image (starting right from the header) as indicated by hash_size. the value is truncated to the 64 msb. 64 127:96 reserved 11...11 (binary) 32 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 27 of 1164 nxp semiconductors UM10430 chapter 3: lpc18xx boot rom 3.3.4 boot image creation 3.3.4.1 cmac the cmac algorithm is used to calculate a tag which is used for image authentication. the tag is stored in the header field hash_value. the authentication process is as follows: 1. use the cmac algorithm to generate the 128-bit tag. truncate the tag to 64 msb and insert this truncated tag in the header. 2. at boot time the tag is recalculated. au thentication passes when the calculated tag is equal to the received tag in the image header. to generate an l-bit cmac tag t of mess age m using a 128-bit block cipher aes and secret key k, the cmac tag generation process is as follows: 1. generate sub key k 1 : ? calculate a temporary value k 0 = aes k (0). ? if msb(k 0 ) = 0 then k 1 = (k 0 << 1) else k 1 = (k 0 << 1) ? 0x87 2. divide message into 128-bit blocks m = m 1 || ... || m n-1 || m n *, where m 1 ...m n-1 are complete blocks. 3. the last block, m n *, should be padded to be a complete block and then m n = k 1 ? m n *. 4. let c 0 = 00...0. 5. for i = 1, ..., n, calculate c i = aes k (c i-1 ? m i ). 6. output t = msb l (c n ). the first message block is the header. since the cmac tag is stored in the header field hash_value, and this tag is not yet known until after cmac calculation, a temporary header with a dummy tag value of 0x3456789a is used during cmac calculation. this dummy value should be replaced by the calc ulated tag value in the final header field hash_value. for lpc18xx the chosen cmac parameters are: encryption key k = user key (same as used for decryption) and tag length l = 64. data is processed in little endian mode. this means that the first byte read from the image is integrat ed into the aes codeword as least significant byte. the 16th byte read from the image is the most significant byte of the first aes codeword. cmac is calculated over the header and encrypted image. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 28 of 1164 nxp semiconductors UM10430 chapter 3: lpc18xx boot rom 3.3.4.2 uart boot mode figure 11 details the boot-flow steps of the uart boot mode. the execution of this mode happens only if the boot mode is set accordingly (see boot modes ta b l e 7 and ta b l e 8 ). as illustrated in figure 11 , configure the uart with the following settings: ? baudrate = 115200 (uart divisor registers are programmed assuming a 12 mhz clock frequency). ? data bits = 8. ? parity = none. ? stop bits = 1. auto baud is active; boot waits until 0x3f is received and responds with ?ok?. this should be followed by the header and image. the boot rom doesn't implement any flow control or any handshake mechanisms during file transfer. fig 10. cmac generation m 1 aes k + m 2 aes k + m* n aes k k 1 msb 64 tag www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 29 of 1164 nxp semiconductors UM10430 chapter 3: lpc18xx boot rom 3.3.4.3 spifi boot mode figure 12 details the boot-flow steps of the quad spi flash boot mode . the execution of this mode happens only if the boot mo de is set accordingly (see boot modes table 7 and ta b l e 8 ). the spifi clock is 36 mhz. boot rom to support a spi flash boot, th e device should support ?high frequency continuous array read? (command 0x0b). since the boot rom doesn't rely on a response for commands 0xab, 0xb9 and 0x9f, as long as the spi device ignores or responds correctly to these command s, the lpc18xx will be able to boot from them. fig 11. uart boot process init uart assuming ffast_in =12mhz 1152000-8-n-1 setup pin configuration uart0 p2_1, p2_0 see main boot flow char = 0x3f? receive character no transmit ok yes www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 30 of 1164 nxp semiconductors UM10430 chapter 3: lpc18xx boot rom 3.3.4.4 emc boot modes the emc boot process follows the main flow shown in figure 13 . tthe cpu clock is set to 72 mhz, and a non-aes capable lpc18xx will boot directly from emc when the image does not contain a header. the emc uses 8 wait states. note that the number of address bits se lected in pin configuration is initially extbus_a[13:0]. after reading the header the address bits are extended to be in line with the image size as defined by hash_size, e.g. if hash_size is 100 kb then pins extbus_a[16:14] are configured since 2 17 > 100 kb. when booting without header then the image should configure extra address pins beyond the initially configured extbus_a[13:0]. fig 12. spifi boot process setup pin configuration p3_3..p3_8 read vendor_id supported vendor_id? activate vendor_id specific driver yes see main boot flow setup clock spifi_sck= 36mhz if sqi device supported then 4-bit i/o w ill be used no reset fig 13. emc boot process setup pin configuration extbus_a[13:0] extbus_cs0 read image header image size > 16384-16 extend address bus yes no see main boot flow www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 31 of 1164 nxp semiconductors UM10430 chapter 3: lpc18xx boot rom 3.3.4.5 spi boot mode the boot uses ssp0 in spi mo de. the spi clock is 18 mhz. figure 14 details the boot-flow steps of the spi flash boot mode. the execution of this mode happens only if the boot mode is set accordingly (see boot modes ta b l e 7 and ta b l e 8 ). 3.3.5 boot process timimg the following paramters describe the timing of the boot process: fig 14. spi boot process setup pin configuration p3_3, p3_6..p3_8 see main boot flow setup clock ssp0_sck= 18mhz table 10. boot process timing parameters parameter description value t_a check boot selection pins < 1 ? s t_b initialize device 250 ? s t_c copy image to embedded sram if part is executing from external flash with no copy < 0.3 ? s if the image is encrypted or must be copied < 1 ? s to 10000 ? s depending on the size of the image and the speed of the boot memory www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 32 of 1164 nxp semiconductors UM10430 chapter 3: lpc18xx boot rom 3.3.6 isp in-system programming (isp) is programming or re-programming the on-chip sram memory, using the boot loader software and the usart0 serial port. this can be done when the part resides in the end-user board. isp allows to load data into on-chip sram and execute code from on-chip sram. for details, see chapter 40 . fig 15. boot process timing gnd vddreg irc12 reset supply ramp up irc12 starts irc12 stable 22 s 0 .5 s; irc stability count valid threshold boot time user code processor status t a s t b s t c s check boot selection pins copy image to embedded sram initialise device www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 33 of 1164 4.1 how to read this chapter all lpc18xx parts support aes decoding. 4.2 features ? decoding of external image data. ? secure storage of decoding keys. ? support for cmac hash calcul ation to authenticate data. ? aes engine performance of 1 byte/clock cycle. ? aes engine supports: ? ecb decode mode with 128-bit key. ? cbc decode mode with 128-bit key. ? cmac hash calculation. 4.3 general description the lpc18xx uses an external image to stor e instruction code and data. if customers want to protect the external image content, then the lpc18xx offers hardware to accelerate processing for data decoding, data integrity and proof of origin. the hardware consists of: ? one-time programmable (otp) non-volatile memories to store the aes key. two instances (otp1/2) are offered to store two keys. a 3rd otp (otp3) is used by the lpc18xx for storing other data. ? an aes engine to perform the aes decoding . this engine supports an external gpdma module to read and write data. the engine uses a 128-bit key and processes blocks of 128-bit. the key can use a dedicated hardware interface that is not visible to software or a so ftware interface. UM10430 chapter 4: lpc18xx security features rev. 00.13 ? 20 july 2011 user manual www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 34 of 1164 nxp semiconductors UM10430 chapter 4: lpc18xx security features 4.4 aes api calls 4.4.1 security api the security api controls the aes block. fig 16. aes engine aes engine otp controller otp2 vpp 3v3 vdd 1v2 aes_key ahb otp1 otp0 rng cpu jtag gpdma control data ahb2 apb table 11. security api calls function offset relative to the api entry point description aes_api_set_mode 0x00 defines ae s engine o peration mode parameter: unsigned cmd with values: 0 - reserved. do not use. 1 - aes_api_cmd_decode_ecb 2 - reserved. do not use. 3 - aes_api_cmd_decode_cbc return - unsigned: see general error codes. aes_api_load_key_1 0x04 loads 128 bit aes user key 1 parameter - void return - void aes_api_load_key_2 0x08 loads 128 bit aes user key 2 parameter - void return - void aes_api_load_key_rng 0x0c loads randomly generated key in aes engine. parameter - void return - void www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 35 of 1164 nxp semiconductors UM10430 chapter 4: lpc18xx security features 4.4.2 otp memory the virgin otp state is all zeros. this implies that a zero value can be overwritten by a one value, but a one value cannot be changed. programming the otp requires a higher voltage than reading. the read voltage is generated internally. the programming voltage is supplied via pin vpp. if this pin is not connected, then the otp can not be programmed. the otp controller automatically selects the correct voltage. aes_api_load_key_sw 0x10 loads 128 bit aes software defined user key parameter - unsigned char *key(16 bytes) return - void aes_api_load_iv_sw 0x14 loads 128 bit aes init vector parameter - unsigned char *iv(16 bytes) return - void aes_api_load_iv_ic 0x18 loads 128 bit aes ic specific init vector, which is used to decode a boot image. parameter - void return - void aes_api_operate 0x1c performs an operation pre-selected by the selected mode and therefore a key. a previously loaded iv is used. data_out=aes_op(data_i n*size, key, [iv]) parameter 1 - unsigned char *data_out parameter 2 - unsigned char *data_in parameter 3 - unsigned size (128 bits word - 16 bytes) return - unsigned: see general error codes. aes_api_program_key_1 0x20 programs 128 bit aes key in otp. parameter: unsigned char *key (16 bytes) return - unsigned: see general error codes. aes_api_program_key_2 0x24 programs 128 bit aes key in otp. parameter: unsigned char *key (16 bytes) return - unsigned: see general error codes. table 11. security api calls function offset relative to the api entry point description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 36 of 1164 5.1 how to read this chapter remark: this chapter describes th e nvic connections of pa rts lpc1850/30/20/10 rev ?a?. the available nvic interrupt sources vary for different parts. ? ethernet interrupt: available on lpc1850/30. ? usb0 interrupt: available on lpc1850/30/20. ? usb1 interrupt: available on lpc1850/30. 5.2 basic configuration the nvic is part of the arm cortex-m3 core. 5.3 features ? nested vectored interrupt controller that is an integral part of the arm cortex-m3 ? tightly coupled interrupt controller provides low interrupt latency ? controls system exceptions and peripheral interrupts ? on the lpc18xx, the nvic supports 32 vectored interrupts ? 32 programmable interrupt priority levels , with hardware pr iority level masking ? relocatable vector table ? non-maskable interrupt ? software interr upt generation 5.4 general description the nested vectored in terrupt controller (nvic) is an integral part of the cortex-m3. the tight coupling to the cpu allows for low interr upt latency and efficient processing of late arriving interrupts. refer to the cortex-m3 user gui de for details of nvic operation. 5.5 pin description UM10430 chapter 5: lpc18xx nvic rev. 00.13 ? 20 july 2011 user manual table 12. nvic pin description function direction description nmi i external non-maskable interrupt (nmi) input www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 37 of 1164 nxp semiconductors UM10430 chapter 5: lpc18xx nvic 5.6 interrupt sources ta b l e 1 3 lists the interrupt sources for each peripheral function. each peripheral device may have one or more interrupt lines to the vectored interrupt controller. each line may represent more than one interrupt source, as noted. exception numbers relate to where entries ar e stored in the exception vector table. interrupt numbers are used in some other contexts, such as software interrupts. in addition, the nvic handles the non-maskab le interrupt (nmi). in order for nmi to operate from an external signal, the nmi func tion must be connected to the related device pin (p4_0 or pe_4). w hen connected, a logic one on t he pin will cause the nmi to be processed. for details, refer to the cortex-m3 user guide. table 13. connection of interrupt sources to the nvic interrupt id exception number vector offset function flag(s) 016 0x40dac 1 17 0x44 - reserved 218 0x48dma 3 19 0x4c - reserved 4 20 0x50 - reserved 5 21 0x54 ethernet ethernet interrupt sbd_intr_o 6 22 0x58 sd/mmc 723 0x5clcd 8 24 0x60 usb0 otg interrupt 9 25 0x64 usb1 otg interrupt 10 26 0x68 sct sct combined interrupt 11 27 0x6c ri timer 12 28 0x70 timer0 13 29 0x74 timer1 14 30 0x78 timer2 15 31 0x7c timer3 16 32 0x80 motor control pwm 17 33 0x84 adc0 18 34 0x88 i2c0 19 35 0x8c i2c1 20 36 0x90 - reserved 21 37 0x94 adc1 22 38 0x98 ssp0 23 39 0x9c ssp1 24 40 0xa0 usart0 25 41 0xa4 uart1 uart and modem interrupt 26 42 0xa8 usart2 27 43 0xac usart3 usart and irda interrupt 28 44 0xb0 i2s0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 38 of 1164 nxp semiconductors UM10430 chapter 5: lpc18xx nvic 5.7 register description the following table summarizes the registers in the nvic as implemented in the lpc18xx. the cortex-m3 user guide provides a functional description of the nvic. 29 45 0xb4 i2s1 30 46 0xb8 spifi 31 47 0xbc - reserved 32 48 0xc0 gpio pin interrupt 0 33 49 0xc4 gpio pin interrupt 1 34 50 0xc8 gpio pin interrupt 2 35 51 0xcc gpio pin interrupt 3 36 52 0xd0 gpio pin interrupt 4 37 53 0xc4 gpio pin interrupt 5 38 54 0xc8 gpio pin interrupt 6 39 55 0xcc gpio pin interrupt 7 40 56 0xd0 gpio group interrupt 0 41 57 0xd4 gpio group interrupt 1 42 58 0xd8 event router combined interrupt from the event router sources 43 59 0xdc c_can1 interrupt 44 60 0xe0 reserved 45 61 0xe4 reserved 46 62 0xe8 atimer 47 63 0xec reserved 48 64 0xf0 reserved 49 65 0xf4 wwdt 50 66 0xf8 reserved 51 67 0xfc c_can0 52 68 0x100 qei table 13. connection of interrupt sources to the nvic interrupt id exception number vector offset function flag(s) table 14. register overview: nvic (base address 0xe000 e000) name access address offset description reset value iser0 rw 0x100 interrupt set-enable register 0. this register allows enabling interrupts and reading back the interrupt enables for specific peripheral functions. 0 iser1 rw 0x104 interrupt set-enable register 1. this register allows enabling interrupts and reading back the interrupt enables for specific peripheral functions. 0 icer0 rw 0x180 interrupt clear-enable register 0. this register allows disabling interrupts and reading back the interrupt enables for specific peripheral functions. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 39 of 1164 nxp semiconductors UM10430 chapter 5: lpc18xx nvic icer1 rw 0x184 interrupt clear-enable register 1. this register allows disabling interrupts and reading back the interrupt enables for specific peripheral functions. 0 ispr0 rw 0x200 interrupt set-pending register 0. this register allows changing the interrupt state to pending and reading back the interrupt pending state for specific peripheral functions. 0 ispr1 rw 0x204 interrupt set-pending register 1. this register allows changing the interrupt state to pending and reading back the interrupt pending state for specific peripheral functions. 0 icpr0 rw 0x280 interrupt clear-pending register 0. this register allows changing the interrupt state to not pending and reading back the interrupt pending state for specific peripheral functions. 0 icpr1 rw 0x284 interrupt clear-pending register 0. this register allows changing the interrupt state to not pending and reading back the interrupt pending state for specific peripheral functions. 0 iabr0 ro 0x300 interrupt active bit register 0. th is register allows readi ng the current interrupt active state for specific peripheral functions. 0 iabr1 ro 0x304 interrupt active bit register 1. th is register allows readi ng the current interrupt active state for specific peripheral functions. 0 ipr0 rw 0x400 interrupt priority registers 0. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr1 rw 0x404 interrupt priority registers 1 this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr2 rw 0x408 interrupt priority registers 2. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr3 rw 0x40c interrupt priority registers 3. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr4 rw 0x410 interrupt priority registers 4. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr5 rw 0x414 interrupt priority registers 5. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr6 rw 0x418 interrupt priority registers 6. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr7 rw 0x41c interrupt priority registers 7. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 stir wo 0xf00 software trigger interrupt register. this register allows software to generate an interrupt. 0 table 14. register overview: nvic (base address 0xe000 e000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 40 of 1164 6.1 how to read this chapter remark: this chapter applies to parts lpc1850/30/30/10 rev ?a? only. remark: the event router controls the wake-up pr ocess and various event inputs to the nvic. the available event router sources vary for different parts. ? ethernet: available on lpc1850/30. ? usb0: available on lpc1850/30/20. ? usb1: available on lpc1850/30. 6.2 basic configuration ? see ta b l e 1 5 for clocking. ? an event created in the event router can be output on the rtc_alarm pin (see ta b l e 3 1 ). ? the event router is connected to interrupt #42 in the nvic (see table 13 ). 6.3 general description the event router is used to process wake-up events such as certain interrupts and external or internal inputs for wake-up from any of the low power modes (sleep, deep-sleep, power-down, and deep power-down modes). the event router has multiple event inputs from various peripherals. when the proper edge detection is set in the edge configuration register, the event router can wake up the part or can raise an interrupt in the nvic. each event input to the event router can be co nfigured to trigger an output signal on rising or falling edges or on high or low levels. the event router combines all events to an output signal which is used as follows: ? create an interrupt if the event router interrupt is enabled in the nvic. ? send a wake-up signal to the power management unit to wake up from deep-sleep, power-down, and deep power-down modes. ? send a wake-up signal to ccu1 and ccu2 for waking up fr om sleep mode (see section 14.5.3 ). UM10430 chapter 6: lpc18xx event router rev. 00.13 ? 20 july 2011 user manual table 15. event router clocking and power control base clock branch clock maximum frequency clock to event router base_ m3_clk clk_m3_bus 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 41 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 6.4 event router inputs 6.5 pin description table 16. event router inputs event # source notes 0 wakeup0 wakeup0 pin 1 wakeup1 wakeup1 pin 2 wakeup2 wakeup2 pin 3 wakeup3 wakeup3 pin 4 alarm timer alarm timer interrupt 5 rtc rtc interrupt 6 bod trip level 1 bod interrupt; wake-up from low power mode 7 wwdt wwdt interrupt 8 ethernet wake-up packet indicator 9 usb0 wake-up request signal 10 usb1 ahb_needclk signal 11 sd/mmc sd/mmc interrupt 12 c_can0/1 ored c_can0 and c_can1 interrupt 13 gima output 25 output 2 of the co mbined timer (ored output of sct output 2 and the match channel 2 of timer 0). see table 134 . 14 gima output 26 output 6 of the co mbined timer (ored output of sct output 6 and the match channel 2 of timer 1). see table 134 . 15 qei qei interrupt 16 gima output 27 output 14 of the combined timer (ored output of sct output 14 and the match channel 2 of timer 3). see table 134 . 17 - reserved 18 - reserved 19 reset 20 bod trip level 2 25-21 - reserved table 17. event router pin description pin direction description wakeup0/1/2/3 i external wake-up input ; can raise an interrupt and can cause wake-up from any of the low power modes. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 42 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 6.6 register description 6.6.1 level configuration register this register works in combination with the edge configuration register edge (see ta b l e 2 1 ) to configure the level and edge detection for each input to the event router. table 18. register overview: event router (base address 0x4004 4000) name access address offset description reset value hilo r/w 0x000 level configuration register 0x000 edge r/w 0x004 edge configuration 0x000 - - 0x008 - 0xfd4 reserved - clr_en w 0xfd8 event clear enable register 0x0 set_en w 0xfdc event set enable register 0x0 status r 0xfe0 status register 0x0 enable r 0xfe4 enable register 0x0 clr_stat w 0xfe8 clear register 0x0 set_stat w 0xfec set register 0x0 table 19. level configuration register (h ilo - address 0x4004 4000) bit description bit symbol value description reset value 0 wakeup0_l level detect mode for wakeup0 event. 0 0 detect low level if bit 0 in th e edge register is 0. detect falling edge if bit 0 in the edge register is 1. 1 detect high level if bit 0 in th e edge register is 0. detect rising edge if bit 0 in the edge register is 1. 1 wakeup1_l level detect mode for wakeup1 event. the corresponding bit in the edge register must be 0. 0 0 detect low level if bit 1 in the edge register is 0. 1 detect high level if bit 1 in th e edge register is 0. detect rising edge if bit 1 in the edge register is 1. 2 wakeup2_l level detect mode for wakeup2 event. 0 0 detect low level if bit 2 in th e edge register is 0. detect falling edge if bit 2 in the edge register is 1. 1 detect high level if bit 2 in th e edge register is 0. detect rising edge if bit 2 in the edge register is 1. 3 wakeup3_l level detect mode for wakeup3 event. 0 0 detect low level if bit 3 in th e edge register is 0. detect falling edge if bit 3 in the edge register is 1. 1 detect high level if bit 3 in th e edge register is 0. detect rising edge if bit 3 in the edge register is 1. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 43 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 4 atimer_l level detect mode for alarm timer event. 0 0 detect low level if bit 4 in th e edge register is 0. detect falling edge if bit 4 in the edge register is 1. 1 detect high level if bit 4 in th e edge register is 0. detect rising edge if bit 4 in the edge register is 1. 5 rtc_l level detect mode for rtc event. 0 0 detect low level if bit 5 in th e edge register is 0. detect falling edge if bit 5 in the edge register is 1. 1 detect high level if bit 5 in th e edge register is 0. detect rising edge if bit 5 in the edge register is 1. 6 bod_l level detect mode for bod event. 0 0 detect low level if bit 6 in th e edge register is 0. detect falling edge if bit 6 in the edge register is 1. 1 detect high level if bit 6 in th e edge register is 0. detect rising edge if bit 6 in the edge register is 1. 7 wwdt_l level detect mode for wwdtd event. 0 0 detect low level if bit 7 in th e edge register is 0. detect falling edge if bit 7 in the edge register is 1. 1 detect high level if bit 7 in th e edge register is 0. detect rising edge if bit 7 in the edge register is 1. 8eth_l 0 0 detect low level if bit 8 in th e edge register is 0. detect falling edge if bit 8 in the edge register is 1. 1 detect high level if bit 8 in th e edge register is 0. detect rising edge if bit 8 in the edge register is 1. 9 usb0_l 0 0 detect low level if bit 9 in th e edge register is 0. detect falling edge if bit 9 in the edge register is 1. 1 detect high level if bit 9 in th e edge register is 0. detect rising edge if bit 9 in the edge register is 1. 10 usb1_l 0 0 detect low level if bit 10 in th e edge register is 0. detect falling edge if bit 10 in the edge register is 1. 1 detect high level if bit 10 in the edge register is 0. detect rising edge if bit 10 in the edge register is 1. 11 - - reserved. 12 can_l level detect mode for c_can event. 0 0 detect low level if bit 12 in th e edge register is 0. detect falling edge if bit 12 in the edge register is 1. 1 detect high level if bit 12 in the edge register is 0. detect rising edge if bit 12 in the edge register is 1. table 19. level configuration register (h ilo - address 0x4004 4000) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 44 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 6.6.2 edge configuration register this register works in combination with th e level configuration register hilo (see ta b l e 1 9 ) to configure the level or edge detection for each input to the event router. the edge configuration register determines whether the event router responds to a level change (edgen=1), or a constant level (edgen=0). the hilon bit determines a response to a rising edge (hilon=1) or a falling edge (hilon=0). 13 tim2_l level detect mode for combined timer output 2 event. 0 0 detect low level if bit 13 in th e edge register is 0. detect falling edge if bit 13 in the edge register is 1. 1 detect high level if bit 13 in the edge register is 0. detect rising edge if bit 13 in the edge register is 1. 14 tim6_l level detect mode for combined timer output 6 event. 0 0 detect low level if bit 14 in th e edge register is 0. detect falling edge if bit 14 in the edge register is 1. 1 detect high level if bit 14 in the edge register is 0. detect rising edge if bit 14 in the edge register is 1. 15 qei_l level detect mode for qei event. 0 0 detect low level if bit 15 in th e edge register is 0. detect falling edge if bit 15 in the edge register is 1. 1 detect high level if bit 15 in the edge register is 0. detect rising edge if bit 15 in the edge register is 1. 16 tim14_l level detect mode for combined timer output 14 event. 0 0 detect low level if bit 16 in th e edge register is 0. detect falling edge if bit 16 in the edge register is 1. 1 detect high level if bit 16 in the edge register is 0. detect rising edge if bit 16 in the edge register is 1. 18:17 - - reserved. 19 reset_l . 0 0 detect low level if bit 17 in th e edge register is 0. detect falling edge if bit 17 in the edge register is 1. 1 detect high level if bit 17 in the edge register is 0. detect rising edge if bit 17 in the edge register is 1. 31:20 - - reserved. table 19. level configuration register (h ilo - address 0x4004 4000) bit description bit symbol value description reset value table 20. edge and hilo combined register settings hilon edgen description 0 0 detect low level 0 1 detect falling edge 1 0 detect high level 1 1 detect rising edge www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 45 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router when a high level detect is active, the event router status bits cannot be cleared until the signal is low. when a rising edge detect is active, the event router status bit can be cleared right after the event has occurred. table 21. edge configuration register (edge - address 0x4004 4004) bit description bit symbol value description reset value 0 wakeup0_e edge detect mode for wakeup0 event. 0 0 level detect. 1 edge detect. detect falling edge if bit 0 in the hilo register is 0. detect rising edge if bit 0 in the hilo register is 1. 1 wakeup1_e edge/level detect m ode for wakeup1 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 1 in the hilo register is 0. detect rising edge if bit 1 in the hilo register is 1. 2 wakeup2_e edge/level detect m ode for wakeup2 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 2 in the hilo register is 0. detect rising edge if bit 2 in the hilo register is 1. 3 wakeup3_e edge/level detect m ode for wakeup3 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 30 in the hilo register is 0. detect rising edge if bit 3 in the hilo register is 1. 4 atimer_e edge/level detect mode for alarm timer event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 4 in the hilo register is 0. detect rising edge if bit 4 in the hilo register is 1. 5 rtc_e edge/level detect mode for rtc event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 5 in the hilo register is 0. detect rising edge if bit 5 in the hilo register is 1. 6 bod_e edge/level detect mode for bod event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 6 in the hilo register is 0. detect rising edge if bit 6 in the hilo register is 1. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 46 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 7 wwdt_e edge/level detect mode for wwdtd event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 7 in the hilo register is 0. detect rising edge if bit 7 in the hilo register is 1. 8 eth_e the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 8 in the hilo register is 0. detect rising edge if bit 8 in the hilo register is 1. 9 usb0_e the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 9 in the hilo register is 0. detect rising edge if bit 9 in the hilo register is 1. 10 usb1_e the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 10 in the hilo register is 0. detect rising edge if bit 10 in the hilo register is 1. 11 - - reserved. 12 can_e edge/level detect mode for c_can event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 12 in the hilo register is 0. detect rising edge if bit 12 in the hilo register is 1. 13 tim2_e edge/level detect mode for combined timer output 2 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 13 in the hilo register is 0. detect rising edge if bit 13 in the hilo register is 1. 14 tim6_e edge/level detect mode for combined timer output 6 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 14 in the hilo register is 0. detect rising edge if bit 14 in the hilo register is 1. table 21. edge configuration register (edge - address 0x4004 4004) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 47 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 6.6.3 interrupt clear enable register 15 qei_e edge/level detect mode for qei interrupt signal. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 15 in the hilo register is 0. detect rising edge if bit 15 in the hilo register is 1. 16 tim14_e edge/level detect mode for combined timer output 14 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 16 in the hilo register is 0. detect rising edge if bit 16 in the hilo register is 1. 18:17 - - reserved. 19 reset_e . the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 19 in the hilo register is 0. detect rising edge if bit 19 in the hilo register is 1. 31:20 - - reserved. table 21. edge configuration register (edge - address 0x4004 4004) bit description bit symbol value description reset value table 22. interrupt clear enable register (c lr_en - address 0x4004 4fd8) bit description bit symbol description reset value 0 wakeup0_clren writing a 1 to this bit clears the event en able bit 0 in the enable register. - 1 wakeup1_clren writing a 1 to this bit clears the event en able bit 1 in the enable register. - 2 wakeup2_clren writing a 1 to this bit clears the event en able bit 2 in the enable register. - 3 wakeup3_clren writing a 1 to this bit clears the event en able bit 3 in the enable register. - 4 atimer_clren writing a 1 to this bit clears the event enable bit 4 in the enable register. - 5 rtc_clren writing a 1 to this bit clears the event enable bit 5 in the enable register. - 6 bod_clren writing a 1 to this bit clears the event enable bit 6 in the enable register. - 7 wwdt_clren writing a 1 to this bit clears the event enable bit 7 in the enable register. - 8 eth_clren writing a 1 to this bit clears the event enable bit 8 in the enable register. - 9 usb0_clren writing a 1 to this bit clears the event enable bit 9 in the enable register. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 48 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 6.6.4 event set enable register 10 usb1_clren writing a 1 to this bit clears the event enable bit 10 in the enable register. - 11 - reserved. - 12 can_clren writing a 1 to this bit clears the event enable bit 12 in the enable register. - 13 tim2_clren writing a 1 to this bit clears the event enable bit 13 in the enable register. - 14 tim6_clren writing a 1 to this bit clears the event enable bit 14 in the enable register. - 15 qei_clren writing a 1 to this bit clears the event enable bit 15 in the enable register. - 16 tim14_clren writing a 1 to this bit clears the event enable bit 16 in the enable register. - 18:17 - reserved. - 19 reset_clren writing a 1 to this bit cl ears the event enabl e bit 19 in the enable register. - 31:20 - reserved. - table 22. interrupt clear enable register (c lr_en - address 0x4004 4fd8) bit description bit symbol description reset value table 23. event set enable register (set_en - address 0x4004 4fdc) bit description bit symbol description reset value 0 wakeup0_seten writing a 1 to this bit sets the ev ent enable bit 0 in the enable register. - 1 wakeup1_seten writing a 1 to this bit sets the ev ent enable bit 1 in the enable register. - 2 wakeup2_seten writing a 1 to this bit sets the ev ent enable bit 2 in the enable register. - 3 wakeup3_seten writing a 1 to this bit sets the ev ent enable bit 3 in the enable register. - 4 atimer_seten writing a 1 to this bit sets the event enable bit 4 in the enable register. - 5 rtc_seten writing a 1 to this bit sets the event enable bit 5 in the enable register. - 6 bod_seten writing a 1 to this bit sets the event enable bit 6 in the enable register. - 7 wwdt_seten writing a 1 to this bit sets the event enable bit 7 in the enable register. - 8 eth_seten writing a 1 to this bit sets the event enable bit 8 in the enable register. - 9 usb0_seten writing a 1 to this bit sets the event enable bit 9 in the enable register. - 10 usb1_seten writing a 1 to this bit sets the event enable bit 10 in the enable register. - 11 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 49 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 6.6.5 event status register 12 can_seten writing a 1 to this bit sets the event enable bit 12 in the enable register. - 13 tim2_seten writing a 1 to this bit sets the event enable bit 13 in the enable register. - 14 tim6_seten writing a 1 to this bit sets the event enable bit 14 in the enable register. - 15 qei_seten writing a 1 to this bit sets the event enable bit 15 in the enable register. - 16 tim14_seten writing a 1 to this bit sets the event enable bit 16 in the enable register. - 18:17 - reserved. - 19 reset_seten writing a 1 to this bit sets the event enable bit 19 in the enable register. - 31:20 - reserved. - table 23. event set enable register (set_en - address 0x4004 4fdc) bit description bit symbol description reset value table 24. interrupt status register (status - address 0x4004 4fe0) bit description bit symbol description reset value 0 wakeup0_st a 1 in this bit shows that the wakeup0 event has been raised. - 1 wakeup1_st a 1 in this bit shows that the wakeup1 event has been raised. - 2 wakeup2_st a 1 in this bit shows that the wakeup2 event has been raised. - 3 wakeup3_st a 1 in this bit shows that the wakeup3 event has been raised. - 4 atimer_st a 1 in this bit shows that the atimer event has been raised. - 5 rtc_st a 1 in this bit shows that the rtc event has been raised. - 6 bod_st a 1 in this bit shows that the bod event has been raised. - 7 wwdt_st a 1 in this bit shows that the wwdt event has been raised. - 8 eth_st a 1 in this bit shows that the ethernet event has been raised. - 9 usb0_st a 1 in this bit shows that the usb0 event has been raised. - 10 usb1_st a 1 in this bit shows that the usb1 event has been raised. - 11 - reserved. - 12 can_st a 1 in this bit shows that the c_can event has been raised. - 13 tim2_st a 1 in this bit shows that the combined timer 2 output event has been raised. - 14 tim6_st a 1 in this bit shows that the combined timer 6 output event has been raised. - 15 qei_st a 1 in this bit shows that the qei event has been raised. - 16 tim14_st a 1 in this bit shows that t he combined timer 14 output event has been raised. - 18:17 - reserved. - 19 reset_st a 1 in this bit shows that the event has been raised. - 31:20 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 50 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 6.6.6 event enable register table 25. event enable register (enable - address 0x4004 4fe4) bit description bit symbol description reset value 0 wakeup0_en a 1 in this bit shows that the wakeup0 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 1 wakeup1_en a 1 in this bit shows that the wakeup1 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 2 wakeup2_en a 1 in this bit shows that the wakeup2 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 3 wakeup3_en a 1 in this bit shows that the wakeup3 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 4 atimer_en a 1 in this bit shows that the atimer event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 5 rtc_en a 1 in this bit shows that the rtc event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 6 bod_en a 1 in this bit shows that the bod event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 7 wwdt_en a 1 in this bit shows that the wwdt event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 8 eth_en a 1 in this bit shows that the ethernet event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 9 usb0_en a 1 in this bit shows that the usb0 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 10 usb1_en a 1 in this bit shows that the usb1 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 11 - reserved. - 12 can_en a 1 in this bit shows that the can event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 13 tim2_en a 1 in this bit shows that the tim2 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 14 tim6_en a 1 in this bit shows that the tim6 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 15 qei_en a 1 in this bit shows that the qei event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 51 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 6.6.7 clear status register 16 tim14_en a 1 in this bit shows that the tim14 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 18:17 - - 19 reset_en a 1 in this bit shows th at the reset even t has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 31:20 - reserved. - table 25. event enable register (enable - address 0x4004 4fe4) bit description bit symbol description reset value table 26. interrupt clear status register (c lr_stat - address 0x4004 4fe8) bit description bit symbol description reset value 0 wakeup0_clrst writing a 1 to this bi t clears the status event bit 0 in the status register. 1 wakeup1_clrst writing a 1 to this bi t clears the status event bit 1 in the status register. 2 wakeup2_clrst writing a 1 to this bi t clears the status event bit 2 in the status register. 3 wakeup3_clrst writing a 1 to this bi t clears the status event bit 3 in the status register. 4 atimer_clrst writing a 1 to this bit clears the status event bit 4 in the status register. 5 rtc_clrst writing a 1 to this bit clears the status event bit 5 in the status register. 6 bod_clrst writing a 1 to this bit clears the status event bit 6 in the status register. 7 wwdt_clrst writing a 1 to this bit clears the status event bit 7 in the status register. 8 eth_clrst writing a 1 to this bit clears the status event bit 8 in the status register. 9 usb0_clrst writing a 1 to this bit clears the status event bit 9 in the status register. 10 usb1_clrst writing a 1 to this bit clears the status event bit 10 in the status register. 11 - reserved. 12 can_clrst writing a 1 to this bit clears the status event bit 12 in the status register. 13 tim2_clrst writing a 1 to this bit clears the status event bit 13 in the status register. 14 tim6_clrst writing a 1 to this bit clears the status event bit 14 in the status register. 15 qei_clrst writing a 1 to this bit clears the status event bit 15 in the status register. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 52 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 6.6.8 set status register 16 tim14_clrst writing a 1 to this bit clears the status event bit 16 in the status register. 18:17 - 19 reset_clrst writing a 1 to this bit clears the status event bit 19 in the status register. 31:20 - reserved. - table 26. interrupt clear status register (c lr_stat - address 0x4004 4fe8) bit description bit symbol description reset value table 27. interrupt set status register (set _stat - address 0x4004 4fec) bit description bit symbol description reset value 0 wakeup0_setst writing a 1 to this bit sets the status event bit 0 in the status register. 1 wakeup1_setst writing a 1 to this bit sets the status event bit 1 in the status register. 2 wakeup2_setst writing a 1 to this bit sets the status event bit 2 in the status register. 3 wakeup3_setst writing a 1 to this bit sets the status event bit 3 in the status register. 4 atimer_setst writing a 1 to this bit sets the status event bit 4 in the status register. 5 rtc_setst writing a 1 to this bit sets the status event bit 5 in the status register. 6 bod_setst writing a 1 to this bit sets the status event bit 6 in the status register. 7 wwdt_setst writing a 1 to this bit sets the status event bit 7 in the status register. 8 eth_setst writing a 1 to this bit sets the status event bit 8 in the status register. 9 usb0_setst writing a 1 to this bit sets the status event bit 9 in the status register. 10 usb1_setst writing a 1 to this bit sets the status event bit 10 in the status register. 11 - reserved. 12 can_setst writing a 1 to this bit sets the status event bit 12 in the status register. 13 tim2_setst writing a 1 to this bit sets the status event bit 13 in the status register. 14 tim6_setst writing a 1 to this bit sets the status event bit 14 in the status register. 15 qei_setst writing a 1 to this bit sets the status event bit 15 in the status register. 16 tim14_setst writing a 1 to this bit sets the status event bit 16 in the status register. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 53 of 1164 nxp semiconductors UM10430 chapter 6: lpc18xx event router 18:17 - reserved. 19 reset_setst writing a 1 to this bit sets the status ev ent bit 19 in the status register. 31:20 - reserved. - table 27. interrupt set status register (set _stat - address 0x4004 4fec) bit description bit symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 54 of 1164 7.1 how to read this chapter remark: this chapter applies to lpc1 850/30/20/10 rev ?a? only. the available peripherals vary for different parts. ? ethernet: available on lpc1850/30. ? usb0: available on lpc1850/30/20. ? usb1: available on lpc1850/30. if a peripheral is not available, the corresponding bits in the creg registers are reserved. 7.2 basic configuration the creg block is configured as follows: ? see ta b l e 2 8 for clocking and power control. ? the creg block can not be reset by software. 7.3 features the following settings are controlled in the configuration register block: ? bod trip settings ? oscillator output ? dma-to-peripheral muxing ? ethernet mode ? memory mapping ? timer/uart inputs ? in addition, the creg block contains the part id and the part configuration information. UM10430 chapter 7: lpc18xx configuration registers (creg) rev. 00.13 ? 20 july 2011 user manual table 28. creg clocking and power control base clock branch clock maximum frequency creg base_m3_clk clk_m3_creg 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 55 of 1164 nxp semiconductors UM10430 chapter 7: lpc18xx confi guration registers (creg) 7.4 register description 7.4.1 irc trim register table 29. register overview: configuration registers (base address 0x4004 3000) name access address offset description reset value irctrm ro 0x000 irc trim register 0x000f f2bc creg0 r/w 0x004 chip configuration regist er 32 khz oscillator output and bod control register. pmucon 0x008 power mode cont rol register. 0x0000 0000 - - 0x008 - 0x0fc reserved - m3memmap r/w 0x100 arm cortex-m3 memory mapping - - 0x104 reserved - creg1 ro 0x108 chip configuration register 1 creg2 ro 0x10c chip configuration register 2 creg3 ro 0x110 chip configuration register 3 creg4 ro 0x114 chip configuration register 4 creg5 r/w 0x118 chip configuration regi ster 5. controls jtag access. dmamux r/w 0x11c dma muxing control - - 0x120 - 0x124 reserved - etbcfg r/w 0x128 etb ram configuration 0x0000 0000 creg6 r/w 0x12c - - 0x130 - 0x1fc reserved - chipid ro 0x200 part id - - 0x204 - 0x2fc reserved - - - 0x300 0x304 0x308 - - 0x30c - 0xefc reserved - lockreg 0xf00 lock register; blo cks write access to creg registers table 30. irc trim register (irctrm, address 0x4004 3000) bit description bit symbol description reset value access 11:0 trm irc trim value 0x2bc r 19:12 - reserved 0xff r 31:20 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 56 of 1164 nxp semiconductors UM10430 chapter 7: lpc18xx confi guration registers (creg) 7.4.2 creg0 control register 7.4.3 power mode control register for details on power mode selection, see section 8.2 . table 31. creg0 register (creg0, address 0x4004 3004) bit description bit symbol value description reset value access 0 en1khz enable 1 khz output. 0 r/w 0 1 khz output disabled. 1 1 khz output enabled. 1 en32khz enable 32 khz output 0 r/w 0 32 khz output disabled. 1 32 khz output enabled. 2 reset32khz 32 khz oscillator reset 1 r/w 0 1 3 32khzpd 32 khz power control. 1 r/w 0 32 khz oscillator powered. 1 32 khz oscillator powered-down. 4- reserved - - 5 usb0phy usb0 phy powe r control. r/w 0 usb0 phy powered. 1 usb0 phy powered down. 7:6 alarmctrl rtc_alarm pi n output control r/w 0x0 rtc alarm. 0x1 event router event. 0x2 event router or . 0x3 inactive. 9:8 bodlvl1 bod trip level to generate an interrupt. 11 r/w 0x0 2.75 v 0x1 2.85 v 0x2 2.95 v 0x3 3.05 v 11:10 bodlvl2 bod trip level to generate a reset. 11 r/w 0x0 1.70 v 0x1 1.80 v 0x2 1.90 v 0x3 2.00 v 31:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 57 of 1164 nxp semiconductors UM10430 chapter 7: lpc18xx confi guration registers (creg) 7.4.4 arm cortex-m3 me mory mapping register 7.4.5 creg5 control register 7.4.6 dma muxing register this register controls which set of peripher als is connected to the dma controller (see table 195 ). table 32. power mode control register (pmu con, address 0x4004 3008) bit description bit symbol value description reset value access 1:0 pmucon controls power mode. 0 r/w 0x0 normal 0x1 low-power 0x2 reserved 0x3 normal 31:2 - reserved - - table 33. memory mapping register (m3memmap, address 0x4004 3100) bit description bit symbol description reset value access 11:0 reserved 0x000 - 31:12 m3map shadow address when accessing memory at address 0x0000 0000 0x1040 0000 r/w table 34. creg5 control register (creg5, address 0x4004 3118) bit description bit symbol description reset value access 4:0 - reserved. - - 5 - reserved. 0 - 6 m3tapsel 0 r/w 7 - reserved. 0 - 8 - reserved. 0 - 31:9 - reserved. - - table 35. dma muxing register (dmamux, address 0x4004 311c) bit description bit symbol value description reset value access 1:0 dmamuxch0 select dma to peripheral connection for dma peripheral 0. 0r/w 0x0 spifi 0x1 sct match 2 0x2 reserved 0x3 t3 match 1 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 58 of 1164 nxp semiconductors UM10430 chapter 7: lpc18xx confi guration registers (creg) 3:2 dmamuxch1 select dma to peripheral connection for dma peripheral 1 0r/w 0x0 timer 0 match 0 0x1 usart0 transmit 0x2 reserved 0x3 aes input 5:4 dmamuxch2 select dma to peripheral connection for dma peripheral 2. 0r/w 0x0 timer 0 match 1 0x1 usart0 receive 0x2 reserved 0x3 aes output 7:6 dmamuxch3 select dma to peripheral connection for dma peripheral 3. 0r/w 0x0 timer 1 match 0 0x1 uart1 transmit 0x2 i2s1 channel 0 0x3 ssp1 transmit 9:8 dmamuxch4 select dma to peripheral connection for dma peripheral 4. 0r/w 0x0 timer 1 match 1 0x1 uart1 receive 0x2 i2s1 channel 1 0x3 ssp1 receive 11:10 dmamuxch5 select dma to peripheral connection for dma peripheral 5. 0r/w 0x0 timer 2 match 0 0x1 usart2 transmit 0x2 ssp1 transmit 0x3 reserved 13:12 dmamuxch6 selects dma to peripheral connection for dma peripheral 6. 0r/w 0x0 timer 2 match 1 0x1 usart2 receive 0x2 ssp1 receive 0x3 reserved 15:14 dmamuxch7 selects dma to peripheral connection for dma peripheral 7. 0r/w 0x0 timer 3 match l 0 0x1 usart3 transmit 0x2 sct match output 0 0x3 reserved table 35. dma muxing register (dmamux, address 0x4004 311c) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 59 of 1164 nxp semiconductors UM10430 chapter 7: lpc18xx confi guration registers (creg) 17:16 dmamuxch8 select dma to peripheral connection for dma peripheral 8. 0r/w 0x0 timer 3 match 1 0x1 usart3 receive 0x2 sct match output 1 0x3 reserved 19:18 dmamuxch9 select dma to peripheral connection for dma peripheral 9. 0r/w 0x0 ssp0 receive 0x1 i2s0 channel 0 0x2 sct match output 1 0x3 reserved 21:20 dmamuxch10 select dma to peripheral connection for dma peripheral 10. 0r/w 0x0 ssp0 transmit 0x1 i2s0 channel 1 0x2 sct match output 0 0x3 reserved 23:22 dmamuxch11 selects dma to peripheral connection for dma peripheral 11. 0r/w 0x0 ssp1 receive 0x1 reserved 0x2 usart0 transmit 0x3 reserved 25:24 dmamuxch12 select dma to peripheral connection for dma peripheral 12. 0r/w 0x0 ssp1 transmit 0x1 reserved 0x2 usart0 receive 0x3 reserved 27:26 dmamuxch13 select dma to peripheral connection for dma peripheral 13. 0r/w 0x0 adc0 0x1 aes input 0x2 ssp1 receive 0x3 usart3 receive 29:28 dmamuxch14 select dma to peripheral connection for dma peripheral 14. 0r/w 0x0 adc1 0x1 aes output 0x2 ssp1 transmit 0x3 usart3 transmit table 35. dma muxing register (dmamux, address 0x4004 311c) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 60 of 1164 nxp semiconductors UM10430 chapter 7: lpc18xx confi guration registers (creg) 7.4.7 etb sram conf iguration register this register selects the interface that is used to the 16 kb block of ram located at address 0x2000 c000. this ram memory block can be accessed either by the etb or be used as normal sram on the ahb bus. note that by default, this memory area will be accessed by the etb. 7.4.8 creg6 control register this register controls various aspects of the lpc18xx: ? bits 2:0 control the ethernet phy interface. the ethernet block reads this register during set-up, and therefore the ethernet must be reset after changing the phy interface. ? bits 12:15 control the i2s connections. ? bit 16 controls the external memory controller clocking. 31:30 dmamuxch15 select dma to peripheral connection for dma peripheral 15. 0r/w 0x0 dac 0x1 sct match output 3 0x2 reserved 0x3 timer 3 match 0 table 35. dma muxing register (dmamux, address 0x4004 311c) bit description ?continued bit symbol value description reset value access table 36. etb sram configuration register (e tbcfg, address 0x4004 3128) bit description bit symbol value description reset value access 0 etb select sram interface 0 r/w 0 etb accesses sram at address 0x2000 c000. 1 ahb accesses sram at address 0x2000 c000. 31:1 - reserved. - - table 37. creg6 control register (creg6, address 0x4004 312c) bit description bit symbol value description reset value access 2:0 ethmode selects the ethernet mode. reset the ethernet after changing the phy interface. all other settings are reserved. r/w 0x0 mii 0x4 rmii 3 - reserved. r/w 4 timctrl 0 r/w 0 1 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 61 of 1164 nxp semiconductors UM10430 chapter 7: lpc18xx confi guration registers (creg) 7.4.9 part id register 11: 5 - reserved. - - 12 i2s0_tx_sck_in_ sel i2s0_tx_sck input select 0 r/w 0 i2 s clock selected as defined by the i2s transmit mode register table 744 . 1 audio pll for i2s transmit clock mclk input and mclk output. the i2s must be configured in slave mode. 13 i2s0_rx_sck_in_ sel i2s0_rx_sck input select 0 r/w 0 i2 s clock selected as defined by the i2s receive mode register table 745 . 1 audio pll for i2s receive clock mclk input and mclk output. the i2s must be configured in slave mode. 14 i2s1_tx_sck_in_ sel i2s1_tx_sck input select 0 r/w 0 i2 s clock selected as defined by the i2s transmit mode register table 744 . 1 audio pll for i2s transmit clock mclk input and mclk output. the i2s must be configured in slave mode. 15 i2s1_rx_sck_in_ sel i2s1_rx_sck input select 0 r/w 0 i2 s clock selected as defined by the i2s receive mode register table 745 . 1 audio pll for i2s receive clock mclk input and mclk output. the i2s must be configured in slave mode. 16 emc_clk_sel emc_clk divi ded clock select (see section 19.1 ). 0r/w 0 emc_clk_div not divided. 1 emc_clk_div divided by 2. 31: 17 - reserved. - - table 37. creg6 control register (creg6, address 0x4004 312c) bit description ?continued bit symbol value description reset value access table 38. part id register (chipid, address 0x4004 3200) bit description bit symbol description reset value access 31:0 id www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 62 of 1164 8.1 how to read this chapter the power management controller is identical on all lpc18xx parts. 8.2 general description the pmc implements the control sequences to enable transitioning between different power modes and controls the power state of ea ch peripheral. in addition, wake-up from a low-power mode based on hardware events is supported. low-power modes can be reached from active mode only, and transitions between low-power modes are not allowed. the pmc supports the following low-power modes: deep-sleep, power-down, and deep power-down. the wake-up from a low-power mode will always result in the active mode. the lpc18xx supports five power modes in order from highest to lowest power consumption: 1. active mode 2. sleep mode (controlled by the arm cortex-m3 core) 3. deep-sleep mode (controlled by the arm cortex-m3 core) 4. power-down mode (controlled by the arm cortex-m3 core) 5. deep power-down mode 8.2.1 active mode by default, the lpc18xx is in active m ode, which means that every peripheral can perform a functional operation at nominal operating conditions. the other low-power modes are standby modes in which the peripheral clocks are disabled and operating conditions are adapted to achieve further power savings. the peripheral clocks are enabled again at wake-up. in active (or sleep mode), three operating modes are supported. ? low-power mode: the cpu and core logic operate slower and the core supply voltage is reduced. ? normal mode: the cpu operates at the nominal supply voltage. the operating modes are programmable through a power api and through the pmucon register in the creg block (see ta b l e 3 2 ). 8.2.2 sleep mode in sleep mode the cpu clock is shut down to save power; the periph erals can still remain active and fully functional. the sleep mode is entered by a wfi or wfe instruction if the sleepdeep bit in the arm cortex-m3 syst em control register is set to 0. UM10430 chapter 8: lpc18xx power ma nagement controller (pmc) rev. 00.13 ? 20 july 2011 user manual www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 63 of 1164 nxp semiconductors UM10430 chapter 8: lpc18xx power management controller (pmc) as in active mode, low-power and normal modes can be selected. 8.2.3 deep-sleep mode in deep-sleep mode the cpu clock and peripheral clocks are shut down to save power; logic states and sram memory are maintained. all analog blocks and the bod control circuit are powered down. the deep-sleep mode is entered by a wfi or wfe instruction if the sleepdeep bit in the arm cortex-m3 syste m control register is set to 1 and the pd0_sleep0_mode register (see ta b l e 4 1 ) is programmed with the deep-sleep mode value. when the lpc18xx wakes up from deep-sleep mode, the 12 mhz irc is used as the clock source for all base clocks. remark: before entering deep-sleep mode, program the cgu as follows: ? switch the clock source of all base clocks to the irc. ? put the plls in power-down mode. reprogramming the cgu avoids any undefined or unlocked pll clocks at wake-up and minimizes power consumption during deep-sleep mode. 8.2.4 power-down mode in power-down mode the cpu clock and peripheral clocks are shut down but logic states are maintained. all sram memory except for the upper 8 kb of the local sram located at 0x1008 0000, all analog blocks, and the bod control circuit are powered down.the power-down mode is ent ered by a wfi or wfe instruct ion if the sleepdeep bit in the arm cortex-m3 system control register is set to 1 and the pd0_sleep0_mode register (see table 41 ) is programmed with the power-down mode value. when the lpc18xx wakes up from power-down mode, the 12 mhz irc is used as the clock source for all base clocks. remark: before entering power-down mode, program the cgu as follows: ? switch the clock source of all base clocks to the irc. ? put the plls in power-down mode. reprogramming the cgu avoids any undefined or unlocked pll clocks at wake-up and minimizes power consumption during power-down mode. 8.2.5 deep power-down in deep power-down mode the entire core logic is powered down. only the logic in the rtc power domain remains active. the deep power-down mode is entered by a wfi or wfe instruction if the sleepdeep bit in the ar m cortex-m3 system co ntrol register is set to 1 and the pd0_sl eep0_mode register (see ta b l e 4 1 ) is programmed with the deep power-down value. when the lpc18xx wakes up from deep power-down mode, the boot loader configures the pll1 as the clock source running at 72 mhz. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 64 of 1164 nxp semiconductors UM10430 chapter 8: lpc18xx power management controller (pmc) 8.3 register description 8.3.1 hardware sleep event enab le register pd0_sleep0_hw_ena 8.3.2 sleep power mode register pd0_sleep0_mode the pd0_sleep0_mode register controls which of the th ree reduced po wer modes, deep-sleep, power-down, or deep power-down is entered when an arm wfe/wfi instruction is issued and th e sleepdeep bit is set to 1. remark: only the three values listed in table 41 are allowed settings for the pd0_sleep0_mode register. table 39. register overview: power mode controller (pmc) (base address 0x4004 2000) name access address offset description reset value pd0_sleep0_hw_ena r/w 0x000 hardware sleep event enable register 0x0000 0001 - - 0x004 - 0x018 reserved - pd0_sleep0_mode r/w 0x01c sleep power mode register table 40. hardware sleep event enable register (pd0_sleep0_hw_ena - address 0x4004 2000) bit description bit symbol description reset value access 0 ena_event0 writing a 1 enables any sleep modes for cortex-m3. 1 r/w 31:1 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. -- table 41. sleep power mode register (p d0_sleep0_mode - address 0x4004 201c) bit description bit symbol description reset value access 31:0 pwr_state selects between deep-sleep, power-down, and deep power-down modes. only one of the following three values can be programmed in this register: 0x003f 00aa = deep-sleep mode 0x003f fcba = power-down mode 0x003f ff7f = deep power-down mode r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 65 of 1164 nxp semiconductors UM10430 chapter 8: lpc18xx power management controller (pmc) 8.4 functional description 8.4.1 run-time programming the pd0_sleep0_mode register can be progra mmed at run-time to change the default power state of the lpc18xx after the next trans ition to a reduced-power state. the default state is deep power-down corresponding to a reset value of the pd0_sleep0_mode register of 0x003f ff7f. [1] when the io pads are off, the external io suppl y should be removed. pin rtc_alarm can be used to indicate when the event router and the core become active and when the io should be powered on. 8.4.2 power api table 42. typical settings for pmc power modes power mode pd0_sleep0_mode register bit settings description deep-sleep 0x0030 00aa cpu, peripherals, analog, usb phy, and retention supplies in retention mode; all sram supplies in active mode; io pads powered [1] , bod in power-down mode. power-down 0x0030 fc3a cpu, peripherals, analog supplies in retention mode; usb phy in power-down mode; retention in retention mode; sram1 in active mode; all other srams in power-down mode; io pads powered [1] , bod in power-down mode. deep power-down 0x0030 ff7f cpu, peripherals, analog, usb phy in power-down mode; all srams, io pads powered [1] , bod in power-down mode. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 66 of 1164 9.1 how to read this chapter remark: this chapter describes the clock generation of parts lpc1850/30/20/10 rev ?a? and parts lpc18xx (with on-chip flash). note that register clocks and clock control registers are specific to parts lpc1850/30/ 20/10 rev ?a? and parts lpc18xx (with on-chip flash). for a description of the cgu of parts lpc1850/30/20/10 rev ?-?, see section 42.4 . ethernet, usb0, usb1, and lcd related clo cks are not available on all packages. see section 1.3 . the corresponding clock control registers are reserved. 9.2 basic configuration the cgu is configured as follows: ? see ta b l e 4 3 for clocking and power control. ? do not reset the cgu during normal operation. 9.3 features ? pll control ? oscillator control ? clock generation and clock source multiplexing ? five integer dividers 9.4 general description the cgu generates multiple independent clocks for the core and the peripheral blocks of the lpc18x. each independent clock is called a ba se clock and itself is one of the inputs to the two clock control units (ccus) which co ntrol the branch clocks to the individual peripherals (see chapter 10 ). UM10430 chapter 9: lpc18xx clock generation unit (cgu) rev. 00.13 ? 20 july 2011 user manual table 43. cgu clocking and power control base clock branch clock maximum frequency cgu base_m3_clk clk_m3_bus 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 67 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) the cgu selects the inputs to the clock generat ors from multiple clock sources, controls the clock generation, and routes the outputs of the clock generators through the clock source bus to the output stages. each output stage provides an independent clock source and corresponds to one of the base clocks for the lpc18xx. see ta b l e 4 4 for a description of each base clock and ta b l e 4 6 for the possible clock sources for each base clock. the cgu contains four types of clock generators: 1. external clock inputs and internal clocks: the external clock inputs are the ethernet phy clocks and the general purpose input clock gp_clkin. the clocks from the internal oscillators are the irc and the 32 khz osc illator output clocks. these clock generators have no selectable inputs from the clock source bus and provide one clock output each to the clock source bus. 2. crystal oscillator: the crystal oscillator is controlled by the cgu. the input to the crystal oscillator are the xtal pins. the crystal oscilla tor creates one output to the clock source bus. 3. plls: pll0 (usb0), pll0 (audio), and pll1 are controlled by the cgu. each pll can select one input from the clock source bus and provides one output to the clock source bus. the input to the plls can be selected from all external and internal clocks and oscillators, from th e other plls, an d from the outputs of any of the integer dividers (see ta b l e 4 5 ). one pll0 cannot select the other pll0 as input. 4. integer dividers: each of the five integer dividers can select one input from the clock source bus and creates one divided output cl ock to the clock source bus. the input to all integer dividers can be selected from all external and internal clocks and oscillators, and from a ll three plls. in addition, the out put of the first integer divider can be selected as an input to all other integer dividers (see ta b l e 4 5 ). fig 17. cgu and ccu0/1 block diagram 32 khz osc pll0 (audio) pll0 (usb0) idiva /4 idivb /16 idive /256 outclk1, 3 - 6, 9 - 10 (base_xxx_clk) outclk12 - 19 (base_xxx_clk) crystal osc pll1 idivc /16 idivc /16 base_safe_clk outclk20 outclk7 outclk8 outclk11 12 mhz irc enet_rx_clk enet_rx_clk enet_tx_clk lcd_clk enet_tx_clk gp_clk 7 8 cgu xtal1 rtcx1 rtcx2 xtal2 ccu1 ccu2 branch clocks to core and peripherals branch clocks to peripherals clkout outclk25 apll outclk26 cgu_out0 outclk27 cgu_out1 wwdt www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 68 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) ? integer divider a: maximum division factor = 4 (see ta b l e 6 2 ). ? integer dividers b, c, d: maximum division factor = 16 (see ta b l e 6 3 ). ? integer divider e: maximum division factor = 256 (see ta b l e 6 4 ). the output stages select a clock source from the clock source bus for each base clock (see table 46 ). except for th e base clocks to the wwdt (base_safe_clk) and usb0 (base_usb0_clk), the clock source for each output stage can be any of the external and internal clocks and oscillato rs directly or one of the pll outputs or any of the outputs of the integer dividers. [1] maximum frequency that guarantees stable operation of the lpc18xx. ta b l e 4 5 shows all available input clock sources for each clock generator. table 44. cgu0 base clocks number name frequency [1] description 0 base_safe_clk 12 mhz base safe clock (always on) for wdt 1 base_usb0_clk 480 mhz base clock for usb0 2- - reserved 3 base_usb1_clk 150 mhz base clock for usb1 4 base_m3_clk 150 mhz system base clock for arm cortex-m3 core and apb peripheral blocks #0 and #2 5 base_spifi_clk 150 mhz base clock for spifi 6 - 150 mhz reserved 7 base_phy_rx_clk 75 mhz base clock for ethernet phy rx 8 base_phy_tx_clk 75 mhz base clock for ethernet phy tx 9 base_apb1_clk 150 mhz base clock for apb peripheral block # 1 10 base_apb3_clk 150 mhz base clock for apb peripheral block # 3 11 base_lcd_clk 150 mhz base clock for lcd 12 base_enet_csr_clk b ase clock for 13 base_sdio_clk 150 mhz base clock for sd/mmc 14 base_ssp0_clk 150 mhz base clock for ssp0 15 base_ssp1_clk 150 mhz base clock for ssp1 16 base_uart0_clk 150 mhz base clock for uart0 17 base_uart1_clk 150 mhz base clock for uart1 18 base_uart2_clk 150 mhz base clock for uart2 19 base_uart3_clk 150 mhz base clock for uart3 20 base_out_clk 150 mhz base clock for clkout pin 21-24 - - reserved 25 base_apll_clk 150 mhz base clock for audio pll 26 base_cgu_out0_clk 150 mhz base cl ock for cgu_out0 clock output 27 base_cgu_out1_clk 150 mhz base cl ock for cgu_out1 clock output www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 69 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) table 45. available clock sources for cl ock generators with selectable inputs clock generators clock sources pll0 (usb) pll0 (audio) pll1 idiva /4 idivb /16 idivc /16 idivd /16 idive /256 32 khz oscillator yes yes yes yes yes yes yes yes irc 12 mhz yes yes yes yes yes yes yes yes enet_rx_clk yes yes yes yes yes yes yes yes enet_tx_clk yes yes yes yes yes yes yes yes gp_clkin yes yes yes yes yes yes yes yes crystal oscillator yes yes yes yes yes yes yes yes pll0 (usb) no no yes yes no no no no pll0 (audio) no no yes yes yes yes yes yes pll1 yes yes no yes yes yes yes yes idiva yes yes yes no yes yes yes yes idivb yes yes yes no no no no no idivc yes yes yes no no no no no idivd yes yes yes no no no no no idive yes yes yes no no no no no table 46. clock sources for output stages output stages (d = default clock source, y = yes (clock source available), n = no (clock source not available)) clock sources base_safe_clk base_usb0_clk base_usb1_clk base_m3_clk base_spifi_clk reserved base_phy_rx_clk base_phy_tx_clk base_apb1_clk base_apb3_clk base_lcd_clk base_enetcsr_clk base_sdio_clk base_ssp0_clk base_ssp1_clk base_uart0_clk base_uart1_clk base_uart2_clk base_uart3_clk base_out_clk base_apll_clk base_cgu_out0_clk base_cgu_out1_clk 32 khz oscillator nnyyyyyyyyyyyyyyyyyyyyy irc 12 mhz dnddddddddddddddddddddd enet_ rx_clk nnyyyyyyyyyyyyyyyyyyyyy enet_ tx_clk nnyyyyyyyyyyyyyyyyyyyyy gp_ clkin nnyyyyyyyyyyyyyyyyyyyyy crystal oscillator nnyyyyyyyyyyyyyyyyyyyyy pll0 (usb) ndynnnnnnnnnnnnnnnnynyy pll0 (audio) nnyyyyyyyyyyyyyyyyyyyyy www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 70 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) pll1 nnyyyyyyyyyyyyyyyyyyyyy idiva nnyyyyyyyyyyyyyyyyyyyyy idivb nnyyyyyyyyyyyyyyyyyyyyy idivc nnyyyyyyyyyyyyyyyyyyyyy idivd nnyyyyyyyyyyyyyyyyyyyyy idive nnyyyyyyyyyyyyyyyyyyyyy table 46. clock sources for output stages output stages (d = default clock source, y = yes (clock source available), n = no (clock source not available)) clock sources base_safe_clk base_usb0_clk base_usb1_clk base_m3_clk base_spifi_clk reserved base_phy_rx_clk base_phy_tx_clk base_apb1_clk base_apb3_clk base_lcd_clk base_enetcsr_clk base_sdio_clk base_ssp0_clk base_ssp1_clk base_uart0_clk base_uart1_clk base_uart2_clk base_uart3_clk base_out_clk base_apll_clk base_cgu_out0_clk base_cgu_out1_clk fig 18. cgu block diagram 32 khz osc pll0 idiva /4 idivb /16 idive /256 outclk_2 - 19 (base_xxx_clk) crystal osc pll1 idivc /16 idivd /16 base_usb0_clk outclk_20 base_safe_clk 12 mhz irc enet_rx_clk enet_tx_clk gp_clkin 18 5 output generators integer dividers plls oscillators, clock inputs xtal1 rtcx1 rtcx2 xtal2 clkout www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 71 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.5 pin description 9.6 register description the register addresses of the cgu are shown in ta b l e 4 8 . remark: the cgu is configured by the boot loader at reset and when waking up from deep power-down to produce a 72 mhz clock us ing pll1. note that this configuration is not reflected in the re set values given in ta b l e 4 8 . table 47. cgu pin description pin name/ function name direction description xtal1 i crystal oscillator input xtal2 o crystal oscillator output rtcx1 i rtc 32 khz oscillator input rtcx2 o rtc 32 khz oscillator output gp_clkin i general purpose input clock enet_tx_clk i ethernet phy transmit clock enet_rx_clk i ethernet phy receive clock clkout o clock output pin cgu_out0 o cgu spare output 0 cgu_out1 o cgu spare output 1 table 48. register overview: cgu (base address 0x4005 0000) name access address offset description reset value - r 0x000 reserved 0x0110 0106 - r 0x004 reserved 0x0010 0500 - r 0x008 reserved 0x1c00 0000 - r 0x00c reserved 0x0000 0000 - - 0x010 reserved - freq_mon r/w 0x014 frequency monitor register 0x0000 0000 xtal_osc_ctrl r/w 0x018 crystal oscillator control register 0x0000 0005 pll0usb_stat r 0x01c pll0 (usb) status register 0x0100 0000 pll0usb_ctrl r/w 0x020 pll0 (usb) control register 0x0100 0003 pll0usb_mdiv r/w 0x024 pll0 (usb) m-divider register 0x05f8 5b6a pll0usb_np_div r/w 0x028 pll0 (usb) n/p-divider register 0x000b 1002 pll0audio_stat r 0x02c pll0 (audio) status register 0x0100 0000 pll0audio_ctrl r/w 0x030 pll0 (audio) control register 0x0100 4003 pll0audio_mdiv r/w 0x034 pll0 (audio) m-divider register 0x05f8 5b6a pll0audio_np_div r/w 0x038 pll0 (audi o) n/p-divider register 0x000b 1002 pllaudio_frac r/w 0x03c pll0 (audio) 0x0020 0000 pll1_stat r 0x040 pll1 status register 0x0100 0000 pll1_ctrl r/w 0x044 pll1 control register 0x0100 0003 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 72 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) idiva_ctrl r/w 0x048 integer divider a control register 0x0100 0000 idivb_ctrl r/w 0x04c integer divider b control register 0x0100 0000 idivc_ctrl r/w 0x050 integer divider c control register 0x0100 0000 idivd_ctrl r/w 0x054 integer divider d control register 0x0100 0000 idive_ctrl r/w 0x058 integer divider e control register 0x0100 0000 outclk_0_ctrl r/w 0x05c output stage 0 control register for base clock base_safe_clk 0x0100 0000 outclk_1_ctrl r/w 0x060 output stage 1 control register for base clock base_usb0_clk 0x0700 0000 - - 0x064 reserved - outclk_3_ctrl r/w 0x068 output stage 3 control register for base clock base_usb1_clk 0x0100 0000 outclk_4_ctrl r/w 0x06c output stage 4 control register for base clock base_m3_clk 0x0100 0000 outclk_5_ctrl r/w 0x070 output stage 5 control register for base clock base_spifi_clk 0x0100 0000 - r/w 0x074 reserved 0x0100 0000 outclk_7_ctrl r/w 0x078 output stage 7 control register for base clock base_phy_rx_clk 0x0100 0000 outclk_8_ctrl r/w 0x07c output stage 8 control register for base clock base_phy_tx_clk 0x0100 0000 outclk_9_ctrl r/w 0x080 output stage 9 control register for base clock base_apb1_clk 0x0100 0000 outclk_10_ctrl r/w 0x084 output stage 10 control register for base clock base_apb3_clk 0x0100 0000 outclk_11_ctrl r/w 0x088 output stage 11 control register for base clock base_lcd_clk 0x0100 0000 outclk_12_ctrl r/w 0x08c output stage 11 control register for base clock base_enet_csr_clk 0x0100 0000 outclk_13_ctrl r/w 0x090 output stage 13 control register for base clock base_sdio_clk 0x0100 0000 outclk_14_ctrl r/w 0x094 output stage 14 control register for base clock base_ssp0_clk 0x0100 0000 outclk_15_ctrl r/w 0x098 output stage 15 control register for base clock base_ssp1_clk 0x0100 0000 outclk_16_ctrl r/w 0x09c output stage 16 control register for base clock base_uart0_clk 0x0100 0000 outclk_17_ctrl r/w 0x0a0 output stage 17 control register for base clock base_uart1_clk 0x0100 0000 outclk_18_ctrl r/w 0x0a4 output stage 18 control register for base clock base_uart2_clk 0x0100 0000 outclk_19_ctrl r/w 0x0a8 output stage 19 control register for base clock base_uart3_clk 0x0100 0000 table 48. register overview: cgu (base address 0x4005 0000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 73 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.1 frequency m onitor register the cgu can report the relative frequency of any operating clock. the clock to be measured must be selected by software, while the fixed-frequency irc clock fref is used as the reference frequency. a 14-bit counter then counts the number of cycles of the measured clock that occur dur ing a user-defined number of reference-clock cycles. when the meas bit is set, the measured-clock counter is reset to 0 and counts up, while the 9-bit reference-clock counter is load ed with the value in rcnt and then counts down towards 0. when either counter reaches its te rminal value both counters are disabled and the meas bit is reset to 0. the current values of the counters can then be read out and the selected frequency obtained by the following equation: if rcnt is programmed to a value equal to the core clock frequency in khz and reaches 0 before the fcnt counter saturates, the value stored in fcnt would then show the measured clock?s frequency in khz without the need for any further calculation. note that the accuracy of this measurem ent can be affected by several factors: 1. quantization error is noticeable if the ra tio between the two clo cks is large (e.g. 100 khz vs. 1 khz), because one counter saturates while the other still has only a small count value. 2. due to synchronization, the counters are not started and stopped at exactly the same time. 3. the measured frequency can only be to the same level of precision as the reference frequency. outclk_20_ctrl r/w 0x0ac output stage 20 control register for base clock base_out_clk 0x0100 0000 outclk_21_ctrl to outclk_24_ctrl r/w 0x0b0 to 0x0bc reserved output stages - outclk_25_ctrl r/w 0x0c0 output stage 25 control register for base clock base_apll_clk outclk_26_ctrl r/w 0x0c4 output stage 26 control register for base clock base_cgu_out0_clk outclk_27_ctrl r/w 0x0c8 output stage 27 control register for base clock base_cgu_out1_clk table 48. register overview: cgu (base address 0x4005 0000) name access address offset description reset value fselected qselected qref initial ?? qref final ?? ? ?? ------------------------------------------------------------------------- - fref ? = www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 74 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.2 crystal oscillator control register the register xtal_osc_control contains th e control bits for the crystal oscillator. table 49. freq_mon register (freq_mon, address 0x4005 0014) bit description bit symbol value description reset value access 8:0 rcnt 9-bit reference clock-counter value 0 r/w 22:9 fcnt 14-bit selected clock-counter value 0 r 23 meas measure frequency 0 r/w 0 rcnt and fcnt disabled 1 frequency counters started 28:24 clk_sel clock-source sele ction for the clock to be measured. all other values are reserved. 0r/w 0x00 32 khz oscillator (default) 0x01 irc 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 pll0 (usb) 0x08 pll0 (audio) 0x09 pll1 0x0a reserved 0x0b reserved 0x0c idiva 0x0d idivb 0x0e idivc 0x0f idivd 0x10 idive 31:29 - reserved - - table 50. xtal_osc_ctrl register (xta l_osc_ctrl, address 0x4005 0018) bit description bit symbol value description reset value access 0 enable oscillator-pad enable. do not change the bypass and enable bits in one write-action: this will result in unstable device operation! 1r/w 0 enable 1 power-down (default) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 75 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.3 pll0 (for usb) registers the pll0 provides a dedicated clock to the high-speed usb0 interface and to usb1. see section 9.7.4.5 for instructions on ho w to set up the pll0. 9.6.3.1 pll0 (for usb) status register 9.6.3.2 pll0 (for usb) control register 1 bypass configure crystal operation or external-clock input pin xtal1. do not change the bypass and enable bits in one write-action: this will result in unstable device operation! 0r/w 0 operation with crystal connected (default). 1 bypass mode. use this mode when an external clock source is used instead of a crystal. 2 hf select frequency range 1 r/w 0 oscillator low-frequency mode (crystal or external clock source 1 to 20 mhz). between 15 mhz to 20 mhz, the state of the hf bit is don?t care. 1 oscillator high-frequency m ode; crystal or external clock source 15 to 25 mhz. between 15 mhz to 20 mhz, the state of the hf bit is don?t care (default) 31:3 - reserved - - table 50. xtal_osc_ctrl register (xta l_osc_ctrl, address 0x4005 0018) bit description bit symbol value description reset value access table 51. pll0usb status register (pll0usb_stat, address 0x4005 001c) bit description bit symbol description reset value access 0 lock pll0 lock indicator 0 r 1 fr pll0 free running indicator 0 r 31:2 - reserved - table 52. pll0usb control register (pll0usb_c trl, address 0x4005 0020) bit description bit symbol value description reset value access 0 pd pll0 power down 1 r/w 0 pll0 enabled 1 pll0 powered down 1 bypass input clock bypass control 1 r/w 0 cco clock sent to post-dividers. use this in normal operation. 1 pll0 input clock sent to post-dividers (default). 2 directi pll0 direct input 0 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 76 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.3.3 pll0 (for usb) m-divider register 3 directo pll0 direct output 0 r/w 4 clken pll0 clock enable 0 r/w 5- reserved - - 6 frm free running mode 0 r/w 7- reserved 0r/w 8 - reserved. reads as zero. do not write one to this register. 0r/w 9 - reserved. reads as zero. do not write one to this register. 0r/w 10 - reserved. reads as zero. do not write one to this register. 0r/w 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - 28:24 clk_sel clock source se lection. all other values are reserved. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x06 crystal oscillator 0x09 pll1 0x0c idiva 0x0d idivb 0x0e idivc 0x0f idivd 0x10 idive 31:29 - reserved - - table 52. pll0usb control register (pll0usb_c trl, address 0x4005 0020) bit description ?continued bit symbol value description reset value access table 53. pll0usb m-divider register (pll0usb_mdiv, address 0x4005 0024) bit description bit symbol description reset value access 16:0 mdec decoded m-divider coefficient value. select values for the m-divider between 1 and 131071. 0x5b6a r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 77 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.3.4 pll0 (for usb) np-divider register 9.6.4 pll0 (for audio) registers see section 9.7.4.5 for instructions on ho w to set up the pll0. 9.6.4.1 pll0 (for audio) status register 9.6.4.2 pll0 (for audio) control register 21:17 selp bandwidth select p value 11100 r/w 27:22 seli bandwidth select i value 010111 r/w 31:28 selr bandwidth select r value 0000 r/w table 53. pll0usb m-divider register (pll0usb_mdiv, address 0x4005 0024) bit description ?continued bit symbol description reset value access table 54. pll0usb np-divider register (pll0usb_np_div, address 0x4005 0028) bit description bit symbol description reset value access 6:0 pdec decoded p-divider coefficient value 000 0010 r/w 11:7 - reserved - - 21:12 ndec decoded n-divider coefficient value 1011 0001 r/w 31:22 - reserved - - table 55. pll0audio status register (pll 0audio_stat, address 0x4005 002c) bit description bit symbol description reset value access 0 lock pll0 lock indicator 0 r 1 fr pll0 free running indicator 0 r 31:2 - reserved - table 56. pll0audio control register (pll0audio_ctrl, address 0x4005 0030) bit description bit symbol value description reset value access 0 pd pll0 power down 1 r/w 0 pll0 enabled 1 pll0 powered down 1 bypass input clock bypass control 1 r/w 0 cco clock sent to post-dividers. use this in normal operation. 1 pll0 input clock sent to post-dividers (default). www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 78 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 2 directi pll0 direct input 0 r/w 3 directo pll0 direct output 0 r/w 4 clken pll0 clock enable 0 r/w 5- reserved - - 6 frm free running mode 0 r/w 7- reserved 0r/w 8 - reserved. reads as zero. do not write one to this register. 0r/w 9 - reserved. reads as zero. do not write one to this register. 0r/w 10 - reserved. reads as zero. do not write one to this register. 0r/w 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 12 pllfraq_ req fractional pll word write request 0 r/w 13 sel_ext sd modulator bypass 0 r/w 14 mod_pd sd modulator power-down 1 r/w 0 sd modulator enabled 1 sd modulator powered down 23:15 - reserved - - 28:24 clk_sel clock source se lection. all other values are reserved. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x06 crystal oscillator 0x09 pll1 0x0c idiva 0x0d idivb 0x0e idivc 0x0f idivd 0x10 idive 31:29 - reserved - - table 56. pll0audio control register (pll0audio_ctrl, address 0x4005 0030) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 79 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.4.3 pll0 (for audio) m-divider register 9.6.4.4 pll0 (for audio) np-divider register 9.6.4.5 pll0 (for audio) fractional divider register 9.6.5 pll1 registers the pll1 is used for the co re and all peripheral blocks. 9.6.5.1 pll1 status register table 57. pll0audio m-divider register (p ll0audio_mdiv, address 0x4005 0034) bit description bit symbol description reset value access 16:0 mdec decoded m-divider coefficient value. select values for the m-divider between 1 and 131071. 0x5b6a r/w 21:17 selp bandwidth select p value 11100 r/w 27:22 seli bandwidth select i value 010111 r/w 31:28 selr bandwidth select r value 0000 r/w table 58. pll0 audio np-divider register (p ll0audio_np_div, address 0x4005 0038) bit description bit symbol description reset value access 6:0 pdec decoded p-divider coefficient value 000 0010 r/w 11:7 - reserved - - 21:12 ndec decoded n-divider coefficient value 1011 0001 r/w 31:22 - reserved - - table 59. pll0audio fractional divider regi ster (pll0audio_frac, address 0x4005 003c) bit description bit symbol description reset value access 21:0 pllfract_ctrl pll fractional divider control word 000 0000 r/w 31:22 - reserved - - table 60. pll1 status register (pll1_st at, address 0x4005 0040) bit description bit symbol description reset value access 0 lock pll1 lock indicator 0 r 31:1 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 80 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.5.2 pll1 control register table 61. pll1_ctrl register (pll1_ctrl , address 0x4005 0044) bit description bit symbol value description reset value access 0 pd pll1 power down 1 r/w 0 pll1 enabled 1 pll1 powered down 1 bypass input clock bypass control 1 r/w 0 cco clock sent to post-dividers. use for normal operation. 1 pll1 input clock sent to post-dividers (default). 2 - reserved. do not write one to this bit. 0 r/w 5:3 - reserved. do not write one to these bits. - - 6 fbsel pll feedback select (see figure 20 ? pll1 block diagram ? ). 0r/w 0 cco output is used as feedback divider input clock. 1 pll output clock (clkout) is used as feedback divider input clock. use for normal operation. 7 direct pll direct cco output 0 r/w 0 disabled 1 enabled 9:8 psel[ post-divider division ratio. the value applied is 2xp. 01 r/w 0x0 1 0x1 2 (default) 0x2 4 0x3 8 10 - reserved - - 11 autoblock block clock auto matically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 13:12 nsel pre-divider division ratio 10 r/w 0x0 1 0x1 2 0x2 3 (default) 0x3 4 15:14 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 81 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.6 integer divider register a 23:16 msel feedback-divider division ratio (m) 00000000 = 1 00000001 = 2 ... 11111111 = 256 11000 r/w 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 pll0 0x08 reserved 0x09 reserved 0x0a reserved 0x0b idiva 0x0c idivb 0x0d idivc 0x0e idivd 0x0f idive 31:28 - reserved - - table 61. pll1_ctrl register (pll1_ctrl , address 0x4005 0044) bit description ?continued bit symbol value description reset value access table 62. idiva control register (idiva_c trl, address 0x4005 0048) bit description bit symbol value description reset value access 0 pd integer divider a power down 0 r/w 0 idiva enabled (default) 1 power-down 1- reserved - - 3:2 idiv integer divider a divider values (1/(idiv + 1)) 00 r/w 0x0 1 (default) 0x1 2 0x2 3 0x3 4 10:4 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 82 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.7 integer divider register b, c, d 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - 28:24 clk_sel clock source selection. all other values are reserved. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x06 crystal oscillator 0x07 pll0 (for usb) 0x08 pll0 (for audio) 0x09 pll1 31:29 - reserved - - table 62. idiva control register (idiva_c trl, address 0x4005 0048) bit description ?continued bit symbol value description reset value access table 63. idivb/c/d control re gisters (idivb_ctrl, address 0x4005 004c; idivc_ctrl, address 0x4005 0050; idivc_ctrl, address 0x4005 0054) bit description bit symbol value description reset value access 0 pd integer divider power down 0 r/w 0 idiv enabled (default) 1 power-down 1- reserved -- 5:2 idiv integer divider b, c, d divider values (1/(idiv + 1)) 0000 = 1 (default) 0001 = 2 ... 1111 = 16 0000 r/w 10:6 - reserved - - 11 autoblock block clock automa tically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 83 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.8 integer divider register e 28:24 clk_sel clock-source selection. all other values are reserved. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x06 crystal oscillator 0x08 pll0 (for audio) 0x09 pll1 0x0c idiva 31:29 - reserved - - table 63. idivb/c/d control re gisters (idivb_ctrl, address 0x4005 004c; idivc_ctrl, address 0x4005 0050; idivc_ctrl, address 0x4005 0054) bit description bit symbol value description reset value access table 64. idive control regist er (idive_ctrl, address 0x4005 0058) bit description bit symbol value description reset value access 0 pd integer divider power down 0 r/w 0 idiv enabled (default) 1 power-down 1- reserved - - 9:2 idiv integer divider e divider values (1/(idiv + 1)) 00000000 = 1 (default) 00000001 = 2 ... 111111111 = 256 000000 00 r/w 10 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 84 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.9 output stage 0 control register this register controls the base_safe_clk to the watchdog os cillator. the only possible clock source for this base clock is the irc. 9.6.10 output stage 1 control register this register contro ls the base_usb0_clk to the high- speed usb0. the only possible clock source for this base cl ock is the pll0 (usb) output. 27:24 clk_sel clock-source selection. all other values are reserved. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x06 crystal oscillator 0x08 pll0 (for audio) 0x09 pll1 0x0c idiva 31:28 - reserved - - table 64. idive control regist er (idive_ctrl, address 0x4005 0058) bit description bit symbol value description reset value access table 65. output stage 0 control register (outclk_0_ctrl, address 0x4005 005c) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - 28:24 clk_sel clock source selection. all other values are reserved. 0x01 r/w 0x01 irc (default) 31:29 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 85 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.11 output stage 3 control register these registers control base clocks 3 (usb1). table 66. output stage 1 control register (outclk_1_ctrl, address 0x4005 0060) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock auto matically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - 28:24 clk_sel clock-source selection. 0x07 r/w 0x07 pll0 (for usb, default) 31:29 - reserved - - table 67. output stage 3 control register (outclk_3_ctrl, address 0x4005 0068) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 86 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.12 output stage 4 to 19 control registers these registers control base clocks 4 to 19. 28:24 clk_sel clock source selection. all other values are reserved. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x06 crystal oscillator 0x07 pll0 (for usb) 0x08 pll0 (for audio) 0x09 pll1 0x0c idiva 0x0d idivb 0x0e idivc 0x0f idivd 0x10 idive 31:29 - reserved - - table 67. output stage 3 control register (outclk_3_ctrl, address 0x4005 0068) bit description ?continued bit symbol value description reset value access table 68. output stage 4 to 19 control registers (outclk_4_ctrl to outclk_19_ctrl, address 0x4005 006c to 0x4005 00a8) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 87 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.13 output stage 20 register this register controls the clock output to t he clkout pin. all clock generator outputs can be monitored through this pin. 28:24 clk_sel clock source selection. all other values are reserved. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x06 crystal oscillator 0x08 pll0 (for audio) 0x09 pll1 0x0c idiva 0x0d idivb 0x0e idivc 0x0f idivd 0x10 idive 31:29 - reserved - - table 68. output stage 4 to 19 control registers (outclk_4_ctrl to outclk_19_ctrl, address 0x4005 006c to 0x4005 00a8) bit description ?continued bit symbol value description reset value access table 69. output stage 20 control register (outclk_20_ctrl, addresses 0x4005 00ac) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 88 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.14 output stage 25 register this register controls the clock output to the . 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 pll0 (for usb) 0x08 pll0 (for audio) 0x09 pll1 0x0c idiva 0x0d idivb 0x0e idivc 0x0f idivd 0x10 idive 31:28 - reserved - - table 69. output stage 20 control register (outclk_20_ctrl, addresses 0x4005 00ac) bit description ?continued bit symbol value description reset value access table 70. output stage 25 control register (outclk_25_ctrl, addresses 0x4005 00c0) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 89 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.6.15 output stage 26 to 27 register this register controls the clock output to the spare cgu outputs pins cgu_out0 and cgu_out1. all clock generator outputs can be monitored through this pin. 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 reserved 0x08 pll0 (for audio) 0x09 pll1 0x0c idiva 0x0d idivb 0x0e idivc 0x0f idivd 0x10 idive 31:28 - reserved - - table 70. output stage 25 control register (outclk_25_ctrl, addresses 0x4005 00c0) bit description ?continued bit symbol value description reset value access table 71. output stage 26 to 27 control register (outclk_26_ctrl to outclk_27_ctrl, addresses 0x4005 00c4 to 0x4005 00c8) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 90 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.7 functional description 9.7.1 32 khz oscillator the 32 khz oscillator output is controlled by the creg block (see ta b l e 3 1 ). the rtc and the alarm timer are connected directly to the 32 khz oscillator. 9.7.2 irc the irc is a trimmed 12 mhz internal oscillato r. although it's part of the cgu, the cgu has no control over this clock source. the irc is put into power down depending on the power saving mode. 9.7.3 crystal oscillator the crystal oscillator is controlled by t he xtal_osc_ctrl register in the cgu (see ta b l e 5 0 ). 9.7.4 pll0 (for usb and audio) 9.7.4.1 features ? input frequency: 14 khz to 150 mhz. the inpu t from an external crystal is limited to 25 mhz. ? cco frequency: 275 mhz to 550 mhz. 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 pll0 (for usb) 0x08 pll0 (for audio) 0x09 pll1 0x0c idiva 0x0d idivb 0x0e idivc 0x0f idivd 0x10 idive 31:28 - reserved - - table 71. output stage 26 to 27 control register (outclk_26_ctrl to outclk_27_ctrl, addresses 0x4005 00c4 to 0x4005 00c8) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 91 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) ? output clock range: 4.3 mhz to 550 mhz. ? programmable dividers: ? pre-divider n (n, 1 to 2 8 ) ? feedback-divider 2 x m (m, 1 to 2 15 ) ? post-divider p x 2 (p, 1 to 2 5 ). ? programmable bandwidth (integrating acti on, proportional action, high frequency pole). ? on-the-fly adjustment of the clock possi ble (dividers with handshake control). ? positive edge clocking. ? frequency limiter to avoid hang-up of the pll. ? lock detector. ? power-down mode. ? free running mode remark: both pll0 blocks are functionally identic al. the pll0 for audio applications (pll0 for audio) supports an additional fractional divider stage (see section 9.7.5 ). 9.7.4.2 pll0 description the block diagram of the pll is shown in figure 19 . the clock input has to be fed to pin clkin. pin clkout is the pll clock output. the analog part of the pll consists of a phase frequency detector (pfd), f ilter and a current controlled oscillator (cco). the pfd has two inputs, a reference input from the (divided) external clock and one input from the divided cco output clock. the pfd compares the phase/frequency of these input signals and generates a control signal if they don?t ma tch. this control signal is fed to a filter which drives the cco. the pll contains three programmable dividers: pre-divider (n), feedback-divider (m) and post-divider (p). the pll contains a lock det ector which measures the phase difference between the rising edges of the input and feedba ck clocks. only when this difference is fig 19. pll0 block diagram bypass pll0_ctrl [1] clkout clkin 32khz irc enet_rx_clk enet_tx_clk gp_clkin crystal pll1 idiva idivb idivc idivd idive pll0_ctrl[27:24] ?1? n-divider pll0 npdiv [ 21:12 ] direct input pll0_ctrl[2] pfd filter cco q d clken pll0_ctrl[4] /2 pll0_npdiv[6:0] p-divider /2 m-divider pll0_mdiv[16:0] direct output pll0_ctrl [3] bandwidth select p,i,r pll0_mdiv[31:17] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 92 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) smaller than the so called ?lock criterion? for more than seven consecutive input clock periods, the lock output switches from low to high. a single too large phase difference immediately resets the counter and causes the lock signal to drop (if it was high). requiring seven phase measurements in a row to be below a certain figure ensures that the lock detector will not indicate lock until both the phase and freque ncy of the input and feedback clocks are very well aligned. this ef fectively prevents false lock indications, and thus ensures a glitch free lock signal. to avoid frequency hang-up the pll contains a frequency limiter. this feature is built in to prevent the cco from running too fast, this ca n occur if e.g. a wrong feedback-divider (m) ratio is applied to the pll. 9.7.4.3 use of pll0 operating modes 9.7.4.3.1 normal mode mode 1 is the normal operating mode. the pre- and post-divider can be selected to give: ? mode 1a: normal operating mode without post-divider and without pre-divider ? mode 1b: normal operating mode with post-divider and without pre-divider ? mode 1c: normal operating mode without post-divider and with pre-divider ? mode 1d: normal operating mode with post-divider and with pre-divider to get at the output of the pll (clkout) the best phase-noise and jitter performance, the highest possible reference clock (clkref) at the pfd has to be used. therefore mode 1a and 1b are recommended, when it is possible to make the right output frequency without pre-divider. by using the post-divider the clock at the out put of the pll (clkout) the divider ratio is always even because the divide-by-2 divider after the post-divider. 9.7.4.3.2 mode 1a: normal operating mode without post-divider and without pre-divider in normal operating mode 1a the post-divider and pre-divider are bypassed. the operating frequencies are: table 72. pll operating modes pll0_mode bit settings: mode pd clken bypass directi directo frm 1: normal 0 1 0 1/0 1/0 0 3: power down 1 x x x x x table 73. directl and directo bit settings in hp0/1_mode register mode directi directo 1a 1 1 1b 1 0 1c 0 1 1d 0 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 93 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) fout = fcco = 2 x m x fin ?? (275 mhz ? fcco ? 550 mhz, 4 khz ? fin ? 150 mhz) the feedback divider ratio is programmable: ? feedback-divider m (m, 1 to 2 15 ) 9.7.4.3.3 mode 1b: normal operating mode with post-divider and without pre-divider in normal operating mode 1b the pre-divider is bypassed. the operating frequencies are: fout = fcco /(2 x p) = (m / p) x fin ? (275 mhz ? fcco ? 550 mhz, 4 khz ? fin ? 150 mhz) the divider ratios are programmable: ? feedback-divider m (m, 1 to 2 15 ) ? post-divider p (p, 1 to 32) 9.7.4.3.4 mode 1c: normal operating mode without post-divider and with pre-divider in normal operating mode 1c the post-divider with divide-by-2 divider is bypassed. the operating frequencies are: fout = fcco = 2 x m x fin / n ? (275 mhz ? fcco ? 550 mhz, 4 khz ? fin/n ? 150 mhz) the divider ratios are programmable: ? pre-divider n (n, 1 to 256) ? feedback-divider m (m, 1 to 2 15 ) 9.7.4.3.5 mode 1d: normal operating mode with post-divider and with pre-divider in normal operating mode 1d none of the dividers are bypassed. the operating frequencies are: fout = fcco /(2 x p) = m x fin /(n x p) ? (275 mhz ? fcco ? 550 mhz, 4 khz ? fin/n ? 150 mhz) the divider ratios are programmable: ? pre-divider n (n, 1 to 256) ? feedback-divider m (m, 1 to 2 15 ) ? post-divider p (p, 1 to 32) 9.7.4.3.6 mode 3: power down mode (pd) in this mode (pd = '1'), the oscillator will be st opped, the lock output will be made low, and the internal current refe rence will be turned off. during pd it is also possible to load new divider ratios at the input buses (msel, psel, nsel). power-down mode is ended by making pd low, causing the pll to start up. the lock signal will be made hi gh once the pll has regained lock on the input clock. 9.7.4.4 settings for usb0 ta b l e 7 4 shows the divider settings used for co nfiguring a certain output frequency f out for usb0. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 94 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.7.4.5 usage notes in order to set up the pll0, follow these steps: 1. power down the pll0 by setting bit 1 in the pll0_ctrl register to 1. this step is only needed if the pll0 is currently enabled. 2. configure the pll0 m, n, and p divider values in the pll0_m and pll0_np registers. 3. power up the pll0 by setting bit 1 in the pll0_ctrl register to 0. 4. wait for the pll0 to lock by monitoring the lock bit in the pll0_stat register. 5. enable the pll0 clock output in the pll0_ctrl register. 9.7.5 fractional divider fo r the pll0 (for audio) the pll0 for audio applications (pll0 (for audio)) includes an additional fractional divider. 9.7.6 pll1 9.7.6.1 features ? 1 mhz to 50 mhz input frequency. the input from an external crystal is limited to 25 mhz. ? 9.75 mhz to 320 mhz selectable output frequency with 50% duty cycle. ? 156 mhz to 320 mhz current cont rolled oscillator (cco) frequency. ? power-down mode. ? lock detector. table 74. system pll divider ratio settings for 12 mhz fout (mhz) fcco (mhz) ndec mdec pdec selr seli selp www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 95 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.7.6.2 pll1 description the block diagram of this pll is shown in figure 20 . the input frequency range is 10 mhz to 25 mhz. the input clock is fed directly to the phase-frequency detector (pfd). this block compares the phase and frequency of its inputs, and generates a control signal when phase and/ or frequency do not match. t he loop filter filters these control signals and drives the current contro lled oscillator (cco), which ge nerates the main clock. the cco frequency range is 156 mhz to 320 mhz.the se clocks are either divided by 2xp by the programmable post divider to create the output clocks, or are sent directly to the outputs. the main output clock is then divided by m by the programmable feedback divider to generate the feedback clock. the out put signal of the phase-frequency detector is also monitored by the lock detector, to signal when the pll has locked on to the input clock. 9.7.6.3 lock detector the lock detector measures the phase differen ce between the rising edges of the input and feedback clocks. only when this difference is smaller than the so called ?lock criterion? for more than eight consecutive i nput clock periods, the lock output switches from low to high. a single too large phase difference immediately resets the counter and causes the lock signal to drop (if it was high). requiring eight phase measurements in a row to be below a certain figure ensures that the lock detector will no t indicate lock until both the phase and frequency of the input and feedback clocks are very well aligned. this effectively prevents false lock indications, and thus ensures a glitch free lock signal. 9.7.6.4 power-down control to reduce the power consumption when th e pll clock is not needed, a power-down mode has been incorporated. in this mode, the internal current referenc e will be turned off, the oscillator and the phas e-frequency detector will be stopped and th e dividers will enter a reset stat e. while in power-down mode, the lock output will be low to indicate that fig 20. pll1 block diagram lock detect pfd fclkout pd analog section pd cd /m /2p /n cd psel<1:0> pd 2 msel<7:0> 8 nsel<1:0> 2 fclkin fclkin fcco lock 1 0 1 0 fbsel cco direct 1 0 bypass www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 96 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) the pll is not in lock. when the power-down mode is termi nated, the pll will resume its normal operation and will make the lock signal high once it has regained lock on the input clock. 9.7.6.5 selectable feedback divider clock to allow a trade-off to be made betwee n functionality and powe r consumption, the feedback divider can be connecte d to either the cco clock by setting fbsel to 0 or to the output clock by setting fbsel to 1. if the po st-divider is used to divide down the cco clock the current consumption of the feedback divider can be reduced by making it run on the lower output clock instead of the cco clock, but doing so will limit the relation between output and phase detector clock frequencies to integer values. 9.7.6.6 direct output mode in normal operating mode (with direct set to 0) the cco clock is divided by 2, 4, 8 or 16 depending on the value of psel[1:0], automati cally giving an output clock with a 50% duty cycle. if a higher output frequency is needed, the cco clock can be sent directly to the output by setting direct to 1. since the cco was designed to directly generate a clock with a 50% duty cycle, the output cloc k duty cycle will also be 50% in direct mode. 9.7.6.7 divider ratio programming pre-divider the pre-divider?s division ratio is controlled by the nsel[1:0] input. the division ratio between pll?s input clock and the phase detector clock is the decimal value on nsel[1:0] plus one. post-divider the division ratio of the post divider is controlled by the psel bits. the division ratio is two times the value of p selected by psel bits. this guarantees an ou tput clock with a 50% duty cycle. feedback divider the feedback divider?s division ratio is cont rolled by the msel bits. the division ratio between the pll?s output clock and the input cl ock is the decimal value on msel bits plus one. changing the divider values changing the divider ratio while the pll is running is not recommended. as there is no way to synchronize the change of the nsel, msel, and psel values with the dividers, the risk exists that the counter will read in an undefined value, which could lead to unwanted spikes or drops in the frequency of the output clock. the recommended way of changing between divider settings is to po wer down the pll, adjust the divider settings and then let the pll start up again. 9.7.6.8 frequency selection the pll frequency equations use the following parameters (also see figure 20 ): integer mode in this mode the post divider is enabled and th e feedback divider is set to run on the pll output clock, giving the following frequency relations: www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 97 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) (1) (2) non-integer mode in this mode the post-divider is enabled and the feedback divider is set to run directly on the cco clock, which gives the following frequency dividers: (3) (4) direct mode in this mode, the post-divider is disabled and the cco clock is sent directly to the output, leading to the following frequency equation: (5) power-down mode in this mode, the internal current reference will be turned off, the oscillator and the phase-frequency detector will be stoppe d and the dividers will ente r a reset state. while in power-down mode, the lock output will be low, to indicate that the pll is not in lock. when the power-down mode is term inated, the pll will resume its normal operation and will make the lock signal high once it has regained lock on the input clock. fclkout m fclkin n ---------------------- ? = fcco 2 p fclkout ? ? 2pm fclkin n ---------------------- ? ? ? == fclkout fcco 2p ? ---------------- - m 2p ? ------------ fclkin n ---------------------- ? == fcco m fclkin n ---------------------- ? = fclkout fcco m fclkin n ---------------------- ? == www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 98 of 1164 nxp semiconductors UM10430 chapter 9: lpc18xx cloc k generation unit (cgu) 9.8 example cgu configurations 9.8.1 programming the cgu for de ep-sleep and power-down modes before the lpc18xx enters deep-sleep or power-down mode, the irc must be programmed as the clock source in the contro l registers for all out put stages (outclk_0 to outclk_27). in addition, the plls must be in power-down mode. when the lpc18xx wakes up from deep-sleep or power-down mode, the irc is used as the clock sources for all output stages. also see and . 9.8.2 programming the cgu for using i2 s at peripheral clock rate of 30 mhz in this example the peripheral clock of the i2s interface is set to 30 mhz. the peripheral i2s clock is a branch of the base_apb1_clk. us ing a crystal of 12 mhz as clock source, a pll1 multiplier of 10, and an integer divider of 4 provide the desired clock rate. for this example, program the cgu as follows: 1. enable the crystal oscillator in the xtal_osc_c trl register ( table 50 ). 2. wait for the crystal to stabilize. 3. select the crystal oscillator as input to the pll1 and set up the divider in the pll1_ctrl register (see ta b l e 6 1 ): ? set bits clk_sel in the pl l1_ctrl register to 0x6. ? set msel = 9. ? set nsel = 0. ? set psel = 1. ? set fbsel = 1. ? set bypass = 0, direct = 0. 4. wait for the pll1 to lock. 5. select the pll1 as clock source of the in teger divider a (idiva) in the idiva register and set autoblock = 1 (see table 61 ). 6. select idiva as clock source of the base clock base_apb1_clk and set autoblock = 1 (see ta b l e 6 2 ). 7. ensure that the i2s branch clock cl k_apb1_i2s is enabled in the ccu (see ta b l e 7 8 ). 30mhz 120mhz 12mhz xtal_osc pll1 x 10 diva / 4 base_apb1_clk www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 99 of 1164 10.1 how to read this chapter remark: this chapter applies to parts lpc1850_30_20_10 rev ?a?. remark: the vadc is not available on parts lpc1850_30_10_10 rev ?a?. ethernet, usb0, usb1, and lcd related clo cks are not available on all packages. see ta b l e 4 . 10.2 basic configuration the ccu1/2 are configured as follows: ? see ta b l e 7 5 for clocking and power control. ? do not reset the ccus during normal operation. ? the output clock for the emc clock divider ( ta b l e 8 4 ) must be configured together with bit 16 in the creg6 register ( ta b l e 3 7 ). 10.3 features the ccus switch the clocks to individual peripherals on or off. ? auto mode activates the ahb disable protoc ol before switching off the branch clock. ? wake-up mode allows to select clocks to run automatically after a wake-up event. 10.4 general description each cgu base clock has several clock branches which can be turned on or off independently by the clock control units ccu1 or ccu2. the branch clocks are distributed between ccu1 and ccu2. UM10430 chapter 10: lpc18xx clock control unit (ccu) rev. 00.13 ? 20 july 2011 user manual table 75. ccu clocking and power control base clock branch clock maximum frequency ccu1 base_m3_clk clk_m3_bus 150 mhz ccu2 base_m3_clk clk_m3_bus 150 mhz table 76. ccu1 branch clocks base clock branch clock description base_apb3_clk clk_apb3_bus apb3 bus clock. clk_apb3_i2c1 clock to the i2c1 register interface and i2c1 peripheral clock. clk_apb3_dac clock to the dac register interface. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 100 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) clk_apb3_adc0 clock to the adc0 register interface and adc0 peripheral clock. clk_apb3_adc1 clock to the adc1 register interface and adc1 peripheral clock. clk_apb3_can0 clock to the c_can0 register interface and c_can0 peripheral clock. base_apb1_clk clk_apb1_bus apb1 bus clock. clk_apb1_motocon clock to the pwm motor control block and pwm motocon peripheral clock. clk_apb1_i2c0 clock to the i2c0 register interface and i2c0 peripheral clock. clk_apb1_i2s clock to the i2s0 and i2s1 register interfaces and i2s0 and i2s1 peripheral clock. clk_apb1_can1 clock to the c_can1 register interface and c_can1 peripheral clock. base_spifi_clk clk_spifi clock for the spifi scki clock input. base_m3_clk clk_m3_bus m3 bus clock. clk_m3_spifi clock to the spi fi register interface. clk_m3_gpio clock to the gp io register interface clk_m3_lcd clock to the lcd register interface. clk_m3_ethernet clock to the ethernet register interface. clk_m3_usb0 clock to the u sb0 register interface. clk_m3_emc clock to the exte rnal memory controller. clk_m3_sdio clock to the sd/mmc register interface. clk_m3_dma clock to the dma register interface. clk_m3_m3core clock to the cortex-m3 core clk_m3_aes clock to the aes register interface. clk_m3_sct clock to the sct register interface. clk_m3_usb1 clock to the u sb1 register interface. clk_m3_emc_div clock to the emc with clock divider. clk_m3_vadc clock to the vadc. clk_m3_wwdt clock to the wwdt register interface. clk_m3_uart0 clock to the usart0 register interface. clk_m3_uart1 clock to the uart1 register interface. clk_m3_ssp0 clock to the ssp0 register interface. clk_m3_timer0 clock to the timer0 register interface and timer0 peripheral clock. clk_m3_timer1 clock to the timer1 register interface and timer1 peripheral clock. clk_m3_scu clock to the system control unit register interface. clk_m3_creg clock to the creg register interface. clk_m3_ritimer clock to the ri timer register interface and ri timer peripheral clock. table 76. ccu1 branch clocks base clock branch clock description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 101 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) clk_m3_uart2 clock to the uart2 register interface. clk_m3_uart3 clock to the uart3 register interface. clk_m3_timer2 clock to the timer2 register interface and timer2 peripheral clock. clk_m3_timer3 clock to the timer3 register interface and timer3 peripheral clock. base_m3_clk clk_m3_ssp1 clk_m3_qei clock to the qei register interface and qei peripheral clock. base_usb0_clk clk_usb0 usb0 peripheral clock. base_usb1_clk clk_usb1 usb1 peripheral clock. - - reserved. base_enet_csr _clk clk_vadc vadc clock. table 77. ccu2 branch clocks base clock branch clock description base_apll_clk clk_apll a udio pll clock base_uart3_clk clk_apb2_uart3 u sart3 peripheral clock. base_uart2_clk clk_apb2_uart2 u sart2 peripheral clock. base_uart1_clk clk_apb0_uart1 uart1 peripheral clock. base_uart0_clk clk_apb0_uart0 u sart0 peripheral clock. base_ssp1_clk clk_apb2_ssp1 ssp1 peripheral clock. base_ssp0_clk clk_apb0_ssp0 ssp0 peripheral clock. base_sdio_clk clk_sdio sd/mmc peripheral clock. table 76. ccu1 branch clocks base clock branch clock description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 102 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) 10.5 register description table 78. register overview: ccu1 (base address 0x4005 1000) name access address offset description reset value pm r/w 0x000 ccu1 power mode register 0x0000 0000 base_stat r 0x004 ccu1 base clocks status register 0x0000 0fff - - 0x008 to 0x0fc reserved - clk_apb3_bus_cfg r/w 0x100 clk_apb3 _bus clock configuration register 0x0000 0001 clk_apb3_bus_stat r 0x104 clk_apb3_bus clock status register 0x0000 0001 clk_apb3_i2c1_cfg r/w 0x108 clk_apb3_i2c1 configuration register 0x0000 0001 clk_apb3_i2c1_stat r 0x10c clk_apb3_i2c1v status register 0x0000 0001 clk_apb3_dac_cfg r/w 0x110 clk_apb3_dac configuration register 0x0000 0001 clk_apb3_dac_stat r 0x114 clk_apb3_dac status register 0x0000 0001 clk_apb3_adc0_cfg r/w 0x118 clk_apb3_adc0 configuration register 0x0000 0001 clk_apb3_adc0_stat r 0x11c clk_apb3_adc0 status register 0x0000 0001 clk_apb3_adc1_cfg r/w 0x120 clk_apb3_adc1 configuration register 0x0000 0001 clk_apb3_adc1_stat r 0x124 clk_apb3_adc1 status register 0x0000 0001 clk_apb3_can0_cfg r/w 0x128 clk_apb3_can0 configuration register 0x0000 0001 clk_apb3_can0_stat r 0x12c clk_apb3_can0 status register 0x0000 0001 - - 0x130 to 0x1fc reserved - clk_apb1_bus_cfg r/w 0x200 clk_apb1_bus configuration register 0x0000 0001 clk_apb1_bus_stat r 0x204 clk_apb1_bus status register 0x0000 0001 clk_apb1_motoconpwm_cfg r/w 0x208 cl k_apb1_motocon configuration register 0x0000 0001 clk_apb1_motoconpwm_stat r 0x20c clk_apb1_motocon status register 0x0000 0001 clk_apb1_i2c0_cfg r/w 0x210 clk_apb1_i2c0 configuration register 0x0000 0001 clk_apb1_i2c0_stat r 0x214 clk_apb1_i2c0 status register 0x0000 0001 clk_apb1_i2s_cfg r/w 0x218 clk_apb1_i2s configuration register 0x0000 0001 clk_apb1_i2s_stat r 0x21c clk_apb1_i2s status register 0x0000 0001 clk_apb1_can1_cfg r/w 0x220 clk_apb3_can1 configuration register 0x0000 0001 clk_apb1_can1_stat r 0x224 clk_apb3_can1 status register 0x0000 0001 - - 0x220 to 0x2fc reserved - clk_spifi_cfg r/w 0x300 clk_spifi c onfiguration register 0x0000 0001 clk_spifi_stat r 0x304 clk_spifi status register 0x0000 0001 - - 0x308 to 0x3fc reserved - clk_m3_bus_cfg r/w 0x400 clk_m3_bus configuration register 0x0000 0001 clk_m3_bus_stat r 0x404 clk_m3_bus status register 0x0000 0001 clk_m3_spifi_cfg r/w 0x408 clk_m3_spifi configuration register 0x0000 0001 clk_m3_spifi_stat r 0x40c clk_m3_spifi status register 0x0000 0001 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 103 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) clk_m3_gpio_cfg r/w 0x410 clk_m3_gpio configuration register 0x0000 0001 clk_m3_gpio_stat r 0x414 clk_m3_gpio status register 0x0000 0001 clk_m3_lcd_cfg r/w 0x418 clk_m3_lcd configuration register 0x0000 0001 clk_m3_lcd_stat r 0x41c clk_m3_lcd status register 0x0000 0001 clk_m3_ethernet_cfg r/w 0x420 clk_m3_ethernet configuration register 0x0000 0001 clk_m3_ethernet_stat r 0x424 clk_m3_ethernet status register 0x0000 0001 clk_m3_usb0_cfg r/w 0x428 clk_m3_usb0 configuration register 0x0000 0001 clk_m3_usb0_stat r 0x42c clk_m3_usb0 status register 0x0000 0001 clk_m3_emc_cfg r/w 0x430 clk_m3_emc configuration register 0x0000 0001 clk_m3_emc_stat r 0x434 clk_m3_emc status register 0x0000 0001 clk_m3_sdio_cfg r/w 0x438 clk_m3_sdio configuration register 0x0000 0001 clk_m3_sdio_stat r 0x43c clk_m3_sdio status register 0x0000 0001 clk_m3_dma_cfg r/w 0x440 clk_m3_dma configuration register 0x0000 0001 clk_m3_dma_stat r 0x444 clk_m3_dma status register 0x0000 0001 clk_m3_m3core_cfg r/w 0x448 clk_m3_m3core configuration register 0x0000 0001 clk_m3_m3core_stat r 0x44c clk_m3_m3core status register 0x0000 0001 - - 0x450 to 0x45c reserved - clk_m3_aes_cfg r/w 0x460 clk_m3_aes configuration register 0x0000 0001 clk_m3_aes_stat r 0x464 clk_m3_aes status register 0x0000 0001 clk_m3_sct_cfg r/w 0x468 clk_m3_sct configuration register 0x0000 0001 clk_m3_sct_stat r 0x46c clk_m3_sct status register 0x0000 0001 clk_m3_usb1_cfg r/w 0x470 clk_m3_usb1 configuration register 0x0000 0001 clk_m3_usb1_stat r 0x474 clk_m3_usb1 status register 0x0000 0001 clk_m3_emcdiv_cfg r/w 0x478 clk_m3_emcdi v configuration register 0x0000 0001 clk_m3_emcdiv_stat r 0x47c clk_m3_emcdiv status register 0x0000 0001 - - 0x480 to 0x4fc reserved - clk_m3_wwdt_cfg r/w 0x500 clk_m3_wwdt configuration register 0x0000 0001 clk_m3_wwdt_stat r 0x504 clk_m3_wwdt status register 0x0000 0001 clk_m3_usart0_cfg r/w 0x508 clk_m3_uart0 configuration register 0x0000 0001 clk_m3_usart0_stat r 0x50c clk_m3_uart0 status register 0x0000 0001 clk_m3_uart1_cfg r/w 0x510 clk_m3_uart1 configuration register 0x0000 0001 clk_m3_uart1_stat r 0x514 clk_m3_uart1 status register 0x0000 0001 clk_m3_ssp0_cfg r/w 0x518 clk_m3_ssp0 configuration register 0x0000 0001 clk_m3_ssp0_stat r 0x51c clk_m3_ssp0 status register 0x0000 0001 clk_m3_timer0_cfg r/w 0x520 clk_m3_timer0 configuration register 0x0000 0001 clk_m3_timer0_stat r 0x524 clk_m3_timer0 status register 0x0000 0001 clk_m3_timer1_cfg r/w 0x528 clk_m3_timer1 configuration register 0x0000 0001 clk_m3_timer1_stat r 0x52c clk_m3_timer1 status register 0x0000 0001 clk_m3_scu_cfg r/w 0x530 clk_m3_scu configuration register 0x0000 0001 table 78. register overview: ccu1 (base address 0x4005 1000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 104 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) clk_m3_scu_stat r 0x534 clk_m3_scu status register 0x0000 0001 clk_m3_creg_cfg r/w 0x538 clk_m3_creg configuration register 0x0000 0001 clk_m3_creg_stat r 0x53c clk_m3_creg status register 0x0000 0001 - - 0x540 to 0x5fc reserved - clk_m3_ritimer_cfg r/w 0x600 clk_m3_ritim er configuration register 0x0000 0001 clk_m3_ritimer_stat r 0x604 clk_m3_ritimer status register 0x0000 0001 clk_m3_usart2_cfg r/w 0x608 clk_m3_uart2 configuration register 0x0000 0001 clk_m3_usart2_stat r 0x60c clk_m3_uart2 status register 0x0000 0001 clk_m3_usart3_cfg r/w 0x610 clk_m3_uart3 configuration register 0x0000 0001 clk_m3_usart3_stat r 0x614 clk_m3_uart3 status register 0x0000 0001 clk_m3_timer2_cfg r/w 0x618 clk_m3_timer2 configuration register 0x0000 0001 clk_m3_timer2_stat r 0x61c clk_m3_timer2 status register 0x0000 0001 clk_m3_timer3_cfg r/w 0x620 clk_m3_timer3 configuration register 0x0000 0001 clk_m3_timer3_stat r 0x624 clk_m3_timer3 status register 0x0000 0001 clk_m3_ssp1_cfg r/w 0x628 clk_m3_ssp1 configuration register 0x0000 0001 clk_m3_ssp1_stat r 0x62c clk_m3_ssp1 status register 0x0000 0001 clk_m3_qei_cfg r/w 0x630 clk_m3_qei configuration register 0x0000 0001 clk_m3_qei_stat r 0x634 clk_m3_qei status register 0x0000 0001 - r/w 0x638 to 0x6fc reserved - - r/w 0x700 to 0x7fc reserved - clk_usb0_cfg r/w 0x800 clk_usb0 c onfiguration register 0x0000 0001 clk_usb0_stat r 0x804 clk_usb0 status register 0x0000 0001 - - 0x808 to 0x8fc reserved - clk_usb1_cfg r/w 0x900 clk_usb1 configuration register 0x0000 0001 clk_usb1_stat r 0x904 clk_usb1 status register 0x0000 0001 - - 0x908 to 0x9fc reserved - clk_vadc_cfg r/w 0xa00 clk_vadc configuration register 0x0000 0001 clk_vadc_stat r 0xa04 clk_vadc status register 0x0000 0001 table 78. register overview: ccu1 (base address 0x4005 1000) name access address offset description reset value table 79. register overview: ccu2 (base address 0x4005 2000) name access address offset description reset value pm r/w 0x000 ccu2 power mode register 0x0000 0000 base_stat r 0x004 ccu2 base clocks status register 0x0000 0fff - - 0x008 to 0x0fc reserved - clk_apll_cfg r/w 0x100 clk_apll configuration register 0x0000 0001 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 105 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) 10.5.1 power mode register this register contains a single bit, pd, th at when set will disable all output clocks with wake-up enabled (i.e. w = 1 in the ccu branch clock configuration registers, section 10.5.3 ). clocks disabled by writing to th is register will be reactivated when a wake-up interrupt is detected or when a 0 is written into the pd bit. clk_apll_stat r 0x104 clk_apll status register 0x0000 0001 - - 0x108 to 0x1fc reserved - clk_apb2_usart3_cfg r/w 0x200 clk_apb2_uart3 configuration register 0x0000 0001 clk_apb2_usart3_stat r 0x204 clk_apb2_uart3 status register 0x0000 0001 - - 0x208 to 0x2fc reserved - clk_apb2_usart2_cfg r/w 0x300 clk_apb2_uart2 configuration register 0x0000 0001 clk_apb2_usart2_stat r 0x304 clk_apb2_uart2 status register 0x0000 0001 - - 0x308 to 0x3fc reserved - clk_apb0_uart1_cfg r/w 0x400 clk_apb0_uart1 configuration register 0x0000 0001 clk_apb0_uart1_stat r 0x404 clk_apb0_uart1 status register 0x0000 0001 - - 0x408 to 0x4fc reserved - clk_apb0_usart0_cfg r/w 0x500 clk_apb0_uart0 configuration register 0x0000 0001 clk_apb0_usart0_stat r 0x504 clk_apb0_uart0 status register 0x0000 0001 - - 0x508 to 0x5fc reserved - clk_apb2_ssp1_cfg r/w 0x600 clk_apb2_ssp1 configuration r egister 0x0000 0001 clk_apb2_ssp1_stat r 0x604 clk_apb2_ ssp1 status regi ster 0x0000 0001 - - 0x608 to 0x6fc reserved - clk_apb0_ssp0_cfg r/w 0x700 clk_apb0_ssp0 configuration r egister 0x0000 0001 clk_apb0_ssp0_stat r 0x704 clk_apb0_ ssp0 status regi ster 0x0000 0001 - - 0x708 to 0x7fc reserved - clk_sdio_cfg r/w 0x800 clk_sdio co nfiguration register 0x0000 0001 clk_sdio_stat r 0x804 clk_sdio status register 0x0000 0001 table 79. register overview: ccu2 (base address 0x4005 2000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 106 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) 10.5.2 base clock status register each bit in this register indicates if the spec ified base clock can be safely switched off. a logic zero indicates that all branch clocks generated from this base clock are disabled. hence, the base clock can also be switched off. a logic one value indicates that there is still at least one branch clock running. remark: the base clock must be reactivated before writing to the configuration register of the branch clock. table 80. ccu1/2 power mode register (ccu 1_pm, address 0x4005 1000 and ccu2_pm, address 0x4005 2000) bit description bit symbol value description reset value access 0 pd initiate power-down mode 0 r/w 0 normal operation. 1 clocks with wake-up mode enabled (w = 1) are disabled. 31:1 - reserved. - - table 81. ccu1 base clock status register (ccu1_base_stat, address 0x4005 1004) bit description bit symbol description reset value access 0 base_apb3_ clk_ind base clock indicato r for base_apb3_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 1 base_apb1_ clk_ind base clock indicato r for base_apb1_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 2 base_spifi_ clk_ind base clock indicato r for base_spifi_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 3 base_m3_ clk_ind base clock indica tor for base_m3_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 6:4 - reserved - - 7 base_usb0_ clk_ind base clock indicator for base_usb0_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 8 base_usb1_ clk_ind base clock indicator for base_usb1_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 31:9 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 107 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) 10.5.3 ccu1/2 branch clo ck configuration registers each generated output clock from the ccu has a configuration r egister. they all follow the format as described in ta b l e 8 3 and table 85 . on the lpc18xx, all branch clocks are in run mode after reset. auto and wake-up features are disabled. the clock can be configured to run in the following modes described by the bits run, auto, and wakeup in th e clk_xxx_cfg registers: run ? the wakeup, pd, and auto control bits de termine the activati on of the branch clock. if register bit auto is set the ahb di sable protocol must complete before the clock is switched off. the pd bit is set in ta b l e 8 0 . auto ? enable auto (ahb disable mechanism). the pmu initiates the ahb disable protocol before switching the clock off. this protocol ensures that all ahb transactions have been completed before turning the clock off. wakeup ? the branch clock is wake-up enabled when the pd bit in the power mode register (see ta b l e 8 0 ) is set and clocks which are wake-up enabled are switched off. these clocks will be switched on if a wake-up event is detected or if th e pd bit is cleared. if register bit auto is set, the ahb disable protocol must complete before the clock is switched off. table 82. ccu2 base clock status register (ccu2_base_stat, address 0x4005 2004) bit description bit symbol description reset value access 0 - reserved. - - 1 base_uart3_ clk base clock indicator for base_uart3_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 2 base_uart2_ clk base clock indicator for base_uart2_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 3 base_uart1_ clk base clock indicator for base_uart1_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 4 base_uart0_ clk base clock indicator for base_uart0_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 5 base_ssp1_ clk base clock indicator for base_ssp1_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 6 base_ssp0_ clk base clock indicator for base_ssp0_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 7 - reserved. - - 31:8 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 108 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) remark: in order to safely disable any of the br anch clocks, use two separate writes to the clk_xxx_cfg register: first set the auto bi t, and then on the ne xt write, disable the clock by setting the run bit to zero. remark: the output clock for the emc clock divider ( ta b l e 8 4 ) must be configured together with bit 16 in the creg6 register ( ta b l e 3 7 ). table 83. ccu1 branch clock configuration register (c lk_xxx_cfg, addresses 0x4005 1100, 0x4005 1104,..., 0x4005 1a00) bit description bit symbol value description reset value access 0 run run enable 1 r/w 0 clock is disabled. 1 clock is enabled. 1 auto auto (ahb disable mechanism) enable 0 r/w 0 auto is disabled. 1 auto is enabled. 2 wakeup wake-up mechanism enable 0 r/w 0 wake-up is disabled. 1 wake-up is enabled. 31:3 - reserved - - table 84. ccu1 branch clock configuration register (clk_emcdiv_cfg, addresses 0x4005 1478) bit description bit symbol value description reset value access 0 run run enable 1 r/w 0 clock is disabled. 1 clock is enabled. 1 auto auto (ahb disable mechanism) enable 0 r/w 0 auto is disabled. 1 auto is enabled. 2 wakeup wake-up mechanism enable 0 r/w 0 wake-up is disabled. 1 wake-up is enabled. 3- reserved - - 4- reserved - - 7:5 div clock divider value 0 r/w 0x0 no division (divide by 1). 0x1 divide by 2. 0x2 reserved 0x3 reserved 0x4 reserved 31:8 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 109 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) 10.5.4 ccu1/2 branch cl ock status registers like the configuration register, each genera ted output clock from the ccu has a status register. when the configuration register of an output clock is written into, the value of the actual hardware signals may not be updated immediately because of the auto or wake-up mechanism. the status register shows the curr ent value of these sign als. all output clock status registers follow the format as described in ta b l e 8 6 and ta b l e 8 7 . table 85. ccu2 branch clock configuration register (c lk_xxx_cfg, addresses 0x4005 2100, 0x4005 2200,..., 0x4005 2800) bit description bit symbol value description reset value access 0 run run enable 1 r/w 0 clock is disabled. 1 clock is enabled. 1 auto auto (ahb disable mechanism) enable 0 r/w 0 auto is disabled. 1 auto is enabled. 2 wakeup wake-up mechanism enable 0 r/w 0 wake-up is disabled. 1 wake-up is enabled. 31:3 - reserved - - table 86. ccu1 branch clock status regist er (clk_xxx_stat, addresses 0x4005 1104, 0x4005 110c,..., 0x4005 1a04) bit description bit symbol description reset value access 0 run run enable status 0 = clock is disabled. 1 = clock is enabled. 1r 1 auto auto (ahb disable mechanism) enable status 0 = auto is disabled. 1 = auto is enabled. 0r 2 wakeup wake-up mechanism enable status 0 = wake-up is disabled. 1 = wake-up is enabled. 0r 31:3 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 110 of 1164 nxp semiconductors UM10430 chapter 10: lpc18xx clock control unit (ccu) 10.6 functional description table 87. ccu2 branch clock status register (clk_xxx_stat, addresses 0x4005 2104, 0x4005 2204,..., 0x4005 2804) bit description bit symbol description reset value access 0 run run enable status 0 = clock is disabled 1 = clock is enabled 1r 1 auto auto (ahb disable mechanism) enable status 0 = auto is disabled 1 = auto is enabled 0r 2 wakeup wake-up mechanism enable status 0 = wake-up is disabled 1 = wake-up is enabled 0r 31:3 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 111 of 1164 11.1 how to read this chapter the c_can1 reset (#54) is available on parts lpc1850_30_20_10 rev ?a? only. 11.2 basic configuration the rgu is reset by a bus_rst (reset #8). remark: support for the arm cortex-m3 sysresetreq is not implemented on the lpc18xx. 11.3 general description the rgu allows generation of independent reset signals for various blocks and peripherals on the lpc18xx. each reset signal is asserted by a reset generator with one output (the reset signal) and one or more inputs, which link the reset generators together and create a reset hierarchy. UM10430 chapter 11: lpc18xx rese t generation unit (rgu) rev. 00.13 ? 20 july 2011 user manual table 88. rgu clocking and power control base clock branch clock maximum frequency rgu base_m3_clk clk_m3_bus 150 mhz rgu delay clocks base_safe_clk - 12 mhz fig 21. rgu block diagram 24 rgu reset bod reset wwdt reset core_rst generator periph_rst generator master_rst generator wwdt apb peripherals, gpio bus bridges, memory controllers ahb peripherals (usb0/1, lcd, ethernet, gpdma, sdio, aes) cortex-m3 core creg; rtc domain peripherals; pmc 7 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 112 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) table 89. reset output configuration reset output generator reset output # reset source parts of the device reset when activated core_rst 0 external reset, bod reset, wwdt time-out reset entire chip including peripherals in the battery-powered domain: cgu, power management controller, general purpose registers, alarm timer, parts of the creg block, and rtc. periph_rst 1 core_rst all peripherals with reset source periph_rst and master_rst master_rst 2 periph_rst all peripherals with reset source master_rst reserved 3 - - wwdt_rst 4 core_rst wwdt. no software reset. creg_rst 5 core_rst configuration register block, event router, backup registers, rtc, alarm timer. no software reset. reserved 6 - 7 - - bus_rst 8 periph_rst buses; rgu, ccu, and cgu registers; memory controllers; bus bridges. do not use during normal operation. scu_rst 9 periph_rst system control unit reserved 10 - 12 - - m3_rst 13 master_rst cortex-m3 system reset reserved 14 - - reserved 15 - - lcd_rst 16 master_rst lcd controller reset usb0_rst 17 master_rst usb0 reset usb1_rst 18 master_rst usb1 reset dma_rst 19 master_rst dma reset sdio_rst 20 master_rst sdio reset emc_rst 21 master_rst external memory controller reset ethernet_rst 22 master _rst ethernet reset aes_rst 23 master_rst aes reset reserved 24 - 27 - - gpio_rst 28 periph_rst gpio reset reserved 29 - 31 - - timer0_rst 32 periph_rst timer0 reset timer1_rst 33 periph_rst timer1 reset timer2_rst 34 periph_rst timer2 reset timer3_rst 35 periph_rst timer3 reset ritimer_rst 36 periph_rst repetitive interrupt timer reset sct_rst 37 periph_rst state configurable timer reset motoconpwm_rst 38 periph_rst motor control pwm reset qei_rst 39 periph_rst qei reset www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 113 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) the rgu also monitors the reset cause for each reset output. the reset cause can be retrieved with two leve ls of granularity. the first level is moni tored by the reset_status0 to 3 registers and in dicates one of the following reset causes (see table 94 to ta b l e 9 7 ): ? no reset has taken place. ? reset generated by software (using the registers reset_ctrl0 and reset_ctrl1). ? reset generated by any of the reset sources. the second level of granularity is monitor ed by one individual register for each reset output (reset_ext_statusn) in which the deta iled reset cause is indicated, that is whether or not any of the possible inputs to each reset generator are activated. the following lists all inputs, but note that only a subset of inputs are connected to each reset generator: ? external reset (from external reset pin) ? core_rst output ? periph_rst output ? master_rst output adc0_rst 40 periph_rst adc0 reset (adc register interface and analog block) adc1_rst 41 periph_rst adc1 reset (adc register interface and analog block) dac_rst 42 periph_rst dac reset (dac register interface and analog block) reserved 43 - - uart0_rst 44 periph_rst usart0 reset uart1_rst 45 periph_rst uart1 reset uart2_rst 46 periph_rst usart2 reset uart3_rst 47 periph_rst usart3 reset i2c0_rst 48 periph_rst i2c0 reset i2c1_rst 49 periph_rst i2c1 reset ssp0_rst 50 periph_rst ssp0 reset ssp1_rst 51 periph_rst ssp1 reset i2s_rst 52 periph_rst i2s0 and i2s1 reset spifi_rst 53 periph_rst spifi reset can1_rst 54 periph_rst c_can1 reset can0_rst 55 periph_rst c_can0 reset reserved 56 - - reserved 57 - - reserved 59 - 63 - - table 89. reset output configuration ?continued reset output generator reset output # reset source parts of the device reset when activated www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 114 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) ? bod reset signal ? wwdt time-out signal 11.3.1 reset hierarchy the hierarchy is as follows (see table 90 ): 1. external reset, bod reset signal, wwdt time-out, and reset signal from the pmu 2. core_rst (inputs are the external reset pin, bod reset, and the wwdt time-out reset); resets th e whole chip including the wwdt an d the configuration register block creg. 3. periph_rst (input is the core_rst); resets all apb peripherals and the arm core, but not the wwdt and the creg block. 4. master_rst (input is th e periph_rst); resets the arm cortex-m3 core and the ahb peripherals (dma, usb0 /1, lcd, sdio, emc, aes). table 90. reset priority priority reset input wwdt creg/ rtc/ event router abp peripherals cortex- m3 core ahb peripherals rgu emc gpio sram controllers 1 external reset pin, bod, wwdt yes yes yes yes yes yes yes yes yes 2 core_rst yes yes yes yes yes yes yes yes yes 3 periph_rst no no yes yes yes yes yes yes yes 4 master_rst no no no yes yes yes yes yes yes fig 22. rgu reset structure ext_rst_an(0) bod_rst_an(4) wwdt_rst_an(5) pmc_rst_an delay=1 wwdt_rst_out_n creg_rst_out_n core_rst_out_n core_rst_an(1) delay=3 delay=3 periph_rst_an(2) master_rst_an(3) delay=1 no sw delay=1 no sw periph_rst_out_n master_rst_out_n m3,usb,lcd,etc... spi,etc .... delay=0 delay=0 trstn trstn_loc www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 115 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 11.4 register overview table 91. register overview: rgu (base address: 0x4005 3000) name access address offset description reset value reference reset_ctrl0 w 0x100 reset control register 0 - see ta b l e 9 2 reset_ctrl1 w 0x104 reset control register 1 - see ta b l e 9 3 reset_status0 r/w 0x110 reset status register 0 0x5555 0050 see ta b l e 9 4 reset_status1 r/w 0x114 reset status register 1 0x5555 5555 see ta b l e 9 5 reset_status2 r/w 0x118 reset status register 2 0x5555 5555 see ta b l e 9 6 reset_status3 r/w 0x11c reset status register 3 0x5555 5555 see ta b l e 9 7 reset_active_status0 r 0x150 reset active status register 0 0x0 see ta b l e 9 8 reset_active_status1 r 0x154 reset active status register 1 0x0 see ta b l e 9 9 reset_ext_stat0 r/w 0x400 reset external status register 0 for core_rst 0x0 see ta b l e 1 0 0 reset_ext_stat1 r/w 0x404 reset external status register 1 for periph_rst 0x0 see ta b l e 1 0 1 reset_ext_stat2 r/w 0x408 reset external status register 2 for master_rst 0x0 see ta b l e 1 0 2 reset_ext_stat3 - 0x40c reserved - reset_ext_stat4 r/w 0x410 reset external status register 4 for wwdt_rst 0x0 see ta b l e 1 0 3 reset_ext_stat5 r/w 0x414 reset external status register 5 for creg_rst 0x0 see ta b l e 1 0 4 reset_ext_stat6 - 0x418 reserved - - reset_ext_stat7 - 0x41c reserved - - reset_ext_stat8 r/w 0x420 reset external status register 8 for bus_rst 0x0 see ta b l e 1 0 5 reset_ext_stat9 r/w 0x424 reset external status register 9 for scu_rst 0x0 see ta b l e 1 0 5 reset_ext_stat10 - 0x428 reserved - - reset_ext_stat11 - 0x42c reserved - - reset_ext_stat12 - 0x430 reserved - - reset_ext_stat13 r/w 0x434 reset external status register 13 for m3_rst 0x0 see ta b l e 1 0 6 reset_ext_stat14 - 0x438 reserved - - reset_ext_stat15 - 0x43c reserved - - reset_ext_stat16 r/w 0x440 reset external status register 16 for lcd_rst 0x0 see ta b l e 1 0 6 reset_ext_stat17 r/w 0x444 reset external status register 17 for usb0_rst 0x0 see ta b l e 1 0 6 reset_ext_stat18 r/w 0x448 reset external status register 18 for usb1_rst 0x0 see ta b l e 1 0 6 reset_ext_stat19 r/w 0x44c reset external status register 19 for dma_rst 0x0 see ta b l e 1 0 6 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 116 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) reset_ext_stat20 r/w 0x450 reset external status register 20 for sdio_rst 0x0 see ta b l e 1 0 6 reset_ext_stat21 r/w 0x454 reset external status register 21 for emc_rst 0x0 see ta b l e 1 0 6 reset_ext_stat22 r/w 0x458 reset external status register 22 for ethernet_rst 0x0 see ta b l e 1 0 6 reset_ext_stat23 r/w 0x45c reset external status register 23 for aes_rst 0x0 see ta b l e 1 0 6 reset_ext_stat24 - 0x460 reserved - - reset_ext_stat25 - 0x464 reserved - - reset_ext_stat26 - 0x468 reserved - - reset_ext_stat27 - 0x46c reserved - - reset_ext_stat28 r/w 0x470 reset external status register 28 for gpio_rst 0x0 see ta b l e 1 0 5 reset_ext_stat29 - 0x474 reserved - - reset_ext_stat30 - 0x478 reserved - - reset_ext_stat31 - 0x47c reserved - - reset_ext_stat32 r/w 0x480 reset external status register 32 for timer0_rst 0x0 see ta b l e 1 0 5 reset_ext_stat33 r/w 0x484 reset external status register 33 for timer1_rst 0x0 see ta b l e 1 0 5 reset_ext_stat34 r/w 0x488 reset external status register 34 for timer2_rst 0x0 see ta b l e 1 0 5 reset_ext_stat35 r/w 0x48c reset external status register 35 for timer3_rst 0x0 see ta b l e 1 0 5 reset_ext_stat36 r/w 0x490 reset external status register 36 for ritimer_rst 0x0 see ta b l e 1 0 5 reset_ext_stat37 r/w 0x494 reset external status register 37 for sct_rst 0x0 see ta b l e 1 0 5 reset_ext_stat38 r/w 0x498 reset external status register 38 for motoconpwm_rst 0x0 see ta b l e 1 0 5 reset_ext_stat39 r/w 0x49c reset external status register 39 for qei_rst 0x0 see ta b l e 1 0 5 reset_ext_stat40 r/w 0x4a0 reset external status register 40 for adc0_rst 0x0 see ta b l e 1 0 5 reset_ext_stat41 r/w 0x4a4 reset external status register 41 for adc1_rst 0x0 see ta b l e 1 0 5 reset_ext_stat42 r/w 0x4a8 reset external status register 42 for dac_rst 0x0 see ta b l e 1 0 5 reset_ext_stat43 - 0x4ac reserved 0x0 - reset_ext_stat44 r/w 0x4b0 reset external status register 44 for uart0_rst 0x0 see ta b l e 1 0 5 reset_ext_stat45 r/w 0x4b4 reset external status register 45 for uart1_rst 0x0 see ta b l e 1 0 5 table 91. register overview: rgu (base address: 0x4005 3000) ?continued name access address offset description reset value reference www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 117 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 11.4.1 rgu reset control register the rgu reset control register allows software to activate and clear individual reset outputs. each bit corresponds to an individ ual reset output, and writing a one activates that output. the reset output is automatically de-activated after a fixed delay period. if the reset output has a manual release, it stays ac tivated once pulled low until a 0 is written to the appropriate bit in this register. this applie s whether the reset activation came from the reset control register or any other source reset_ext_stat46 r/w 0x4b8 reset external status register 46 for uart2_rst 0x0 see ta b l e 1 0 5 reset_ext_stat47 r/w 0x4bc reset external status register 47 for uart3_rst 0x0 see ta b l e 1 0 5 reset_ext_stat48 r/w 0x4c0 reset external status register 48 for i2c0_rst 0x0 see ta b l e 1 0 5 reset_ext_stat49 r/w 0x4c4 reset external status register 49 for i2c1_rst 0x0 see ta b l e 1 0 5 reset_ext_stat50 r/w 0x4c8 reset external status register 50 for ssp0_rst 0x0 see ta b l e 1 0 5 reset_ext_stat51 r/w 0x4cc reset external status register 51 for ssp1_rst 0x0 see ta b l e 1 0 5 reset_ext_stat52 r/w 0x4d0 reset external status register 52 for i2s_rst 0x0 see ta b l e 1 0 5 reset_ext_stat53 r/w 0x4d4 reset external status register 53 for spifi_rst 0x0 see ta b l e 1 0 5 reset_ext_stat54 r/w 0x4d8 reset external status register 54 for can1_rst 0x0 see ta b l e 1 0 5 reset_ext_stat55 r/w 0x4dc reset external status register 55 for can0_rst 0x0 see ta b l e 1 0 5 reset_ext_stat56 - 0x4e0 reserved - - reset_ext_stat57 - 0x4e4 reserved - - reset_ext_stat58 - 0x4e8 reserved - - reset_ext_stat59 - 0x4ec reserved - - reset_ext_stat60 - 0x4f0 reserved - - reset_ext_stat61 - 0x4f4 reserved - - reset_ext_stat62 - 0x4f8 reserved - - reset_ext_stat63 - 0x4fc reserved - - table 91. register overview: rgu (base address: 0x4005 3000) ?continued name access address offset description reset value reference www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 118 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) table 92. reset contro l register 0 (reset_ctrl0, addr ess 0x4005 3100) bi t description bit symbol description reset value access 0 core_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 1 periph_rst writing a one activates the reset. this bit is automatically cleared to 0 after three clock cycles. 0w 2 master_rst writing a one activates the reset. this bit is automatically cleared to 0 after three clock cycles. 0w 3- reserved 0- 4 wwdt_rst writing a one to this bit has no effect. 0 - 5 creg_rst writing a one to this bit has no effect. 0 - 6- reserved 0- 7- reserved 0- 8 bus_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. do not use during normal operation 0w 9 scu_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 10 pinmux_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 11 - reserved 0 - 11 - reserved 0 - 13 m3_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 14 - reserved 0 - 15 - reserved 0 - 16 lcd_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 17 usb0_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 18 usb1_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 19 dma_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 20 sdio_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 21 emc_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 22 ethernet_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 23 aes_rst writing a one activates the reset. this bit is automati cally cleared to 0 after one clock cycle. 0w 24 - reserved - - 25 - reserved - - 26 - reserved - - 27 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 119 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 28 gpio_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 29 - reserved - - 30 - reserved - - 31 - reserved - - table 92. reset contro l register 0 (reset_ctrl0, addr ess 0x4005 3100) bi t description ?continued bit symbol description reset value access table 93. reset control regi ster 1 (reset_ctrl1, address 0x4005 3104) bit description bit symbol description reset value access 0 timer0_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 1 timer1_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 2 timer2_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 3 timer3_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 4 ostimer_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 5 sct_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 6 motoconpwm_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 7 qei_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 8 adc0_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 9 adc1_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 10 dac_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 11 - reserved - - 12 uart0_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 13 uart1_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 14 uart2_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 15 uart3_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 16 i2c0_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 17 i2c1_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 120 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 11.4.2 rgu reset status register the reset status register shows which source (i f any) caused the last reset activation per individual reset output of the rgu. when o ne (or more) inputs of the rgu caused the reset output to go active (indicate d by value 01), the corresponding reset_ext_status register can be read, see section 11.4.4 . the reset_status registers are cleared by writing 0 to each of the status bits. 18 ssp0_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 19 ssp1_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 20 i2s_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 21 spifi_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 22 can1_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 23 can0_rst writing a one activates the reset. this bit is automatically cleared to 0 after one clock cycle. 0w 24 - reserved - - 25 - reserved - - 26 - reserved - - 27 - reserved - - 28 - reserved - - 29 - reserved - - 30 - reserved - - 31 - reserved - - table 93. reset control regi ster 1 (reset_ctrl1, address 0x4005 3104) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 121 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) table 94. reset status register 0 (reset_s tatus0, address 0x4005 3110) bit description bit symbol description reset value access 1:0 core_rst status of the core _rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activa ted by software write to reset_ctrl register 00 r/w 3:2 periph_rst status of the per iph_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activa ted by software write to reset_ctrl register 00 r/w 5:4 master_rst status of the master_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activa ted by software write to reset_ctrl register 01 r/w 7:6 - reserved 01 9:8 wwdt_rst status of the wwdt_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reserved 01 r/w 11:10 creg_rst status of the cre g_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reserved 01 r/w 13:12 - reserved 01 - 15:14 - reserved 01 - 17:16 bus_rst status of the bus_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activa ted by software write to reset_ctrl register 01 r/w 19:18 scu_rst status of the scu_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activa ted by software write to reset_ctrl register 01 r/w 21:20 - reserved 01 - 23:22 - reserved 01 - 25:24 - reserved 01 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 122 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 27:26 m3_rst status of the m3_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activa ted by software write to reset_ctrl register 01 r/w 29:28 - reserved 01 - 31:30 - reserved 01 - table 94. reset status register 0 (reset_s tatus0, address 0x4005 3110) bit description bit symbol description reset value access table 95. reset status register 1 (reset_s tatus1, address 0x4005 3114) bit description bit symbol description reset value access 1:0 lcd_rst status of the lcd_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activa ted by software write to reset_ctr l register 01 r/w 3:2 usb0_rst status of the usb0_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to reset_ctrl register 01 r/w 5:4 usb1_rst status of the usb1_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to reset_ctrl register 01 r/w 7:6 dma_rst status of the dm a_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to reset_ctrl register 01 r/w 9:8 sdio_rst status of the sdio_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to reset_ctrl register 01 r/w 11:10 emc_rst status of the emc_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to reset_ctrl register 01 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 123 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 13:12 ethernet_rst status of the ethernet_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to reset_ctrl register 01 r/w 15:14 aes_rst status of the aes_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to reset_ctrl register 01 r/w 17:16 - reserved 01 - 19:18 - reserved 01 - 21:20 - reserved 01 - 23:22 - reserved 01 - 25:24 gpio_rst status of the gp io_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to reset_ctrl register 01 r/w 27:26 - reserved 01 - 29:28 - reserved 01 - 31:30 - reserved 01 - table 95. reset status register 1 (reset_s tatus1, address 0x4005 3114) bit description ?continued bit symbol description reset value access table 96. reset status register 2 (reset_s tatus2, address 0x4005 3118) bit description bit symbol description reset value access 1:0 timer0_rst status of the time r0_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 3:2 timer1_rst status of the time r1_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 5:4 timer2_rst status of the time r2_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 124 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 7:6 timer3_rst status of the time r3_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 9:8 ritimer_rst status of the ostimer_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 11:10 sct_rst status of the sct_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 13:12 motoconpwm_ rst status of the motoconpwm_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 15:14 qei_rst status of the qei_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 17:16 adc0_rst status of the adc0_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 19:18 adc1_rst status of the adc1_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 21:20 dac_rst status of the dac_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 23:22 - reserved 01 r/w table 96. reset status register 2 (reset_s tatus2, address 0x4005 3118) bit description ?continued ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 125 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 25:24 uart0_rst status of the uart0_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 27:26 uart1_rst status of the uart1_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 29:28 uart2_rst status of the uart2_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w 31:30 uart3_rst status of the uart3_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by software write to reset_ctrl register 01 r/w table 96. reset status register 2 (reset_s tatus2, address 0x4005 3118) bit description ?continued ?continued bit symbol description reset value access table 97. reset status register 3 (reset_s tatus3, address 0x4005 311c) bit description bit symbol description reset value access 1:0 i2c0_rst status of the i2c0_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to r eset_ctrl register 01 r/w 3:2 i2c1_rst status of the i2c1_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to r eset_ctrl register 01 r/w 5:4 ssp0_rst status of the ssp 0_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to r eset_ctrl register 01 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 126 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 11.4.3 rgu reset active status register the reset active status register shows the cu rrent value of the reset outputs of the rgu. note that the resets are active low. 7:6 ssp1_rst status of the ssp 1_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to r eset_ctrl register 01 r/w 9:8 i2s_rst status of the i2 s_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to r eset_ctrl register 01 r/w 11:10 spifi_rst status of the spi fi_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to r eset_ctrl register 01 r/w 13:12 can1_rst status of the can1_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to r eset_ctrl register 01 r/w 15:14 can0_rst status of the can0_rst reset generator output 00 = no reset activated 01 = reset output activated by input to the reset generator 10 = reserved 11 = reset output activated by soft ware write to r eset_ctrl register 01 r/w 17:16 - reserved 01 - 19:18 - reserved 01 - 21:20 - reserved 01 - 23:22 - reserved 01 - 25:24 - reserved 01 - 27:26 - reserved 01 - 29:28 - reserved 01 - 31:30 - reserved 01 - table 97. reset status register 3 (reset_s tatus3, address 0x4005 311c) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 127 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) table 98. reset active status register 0 (reset_active_status0, address 0x4005 3150) bit description bit symbol description reset value access 0 core_rst current status of the core_rst 0 = reset asserted 1 = no reset 0r 1 periph_rst current status of the periph_rst 0 = reset asserted 1 = no reset 0r 2 master_rst current status of the master_rst 0 = reset asserted 1 = no reset 0r 3 - reserved 0 4 wwdt_rst current status of the wwdt_rs 0 = reset asserted 1 = no reset 0r 5 creg_rst current status of the creg_rst 0 = reset asserted 1 = no reset 0r 6 - reserved 0 7 - reserved 0 8 bus_rst current status of the bus_rst 0 = reset asserted 1 = no reset 0r 9 scu_rst current status of the scu_rst 0 = reset asserted 1 = no reset 0r 10 pinmux_rst current status of the pinmux_rst 0 = reset asserted 1 = no reset 0r 11 - reserved 0 - 12 - reserved 0 - 13 m3_rst current status of the m3_rst 0 = reset asserted 1 = no reset 0r 14 - reserved 0 15 - reserved 0 16 lcd_rst current status of the lcd_rst 0 = reset asserted 1 = no reset 0r 17 usb0_rst current status of the usb0_rst 0 = reset asserted 1 = no reset 0r www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 128 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 18 usb1_rst current status of the usb1_rst 0 = reset asserted 1 = no reset 0r 19 dma_rst current status of the dma_rst 0 = reset asserted 1 = no reset 0r 20 sdio_rst current status of the sdio_rst 0 = reset asserted 1 = no reset 0r 21 emc_rst current status of the emc_rst 0 = reset asserted 1 = no reset 0r 22 ethernet_rst current status of the ethernet_rst 0 = reset asserted 1 = no reset 0r 23 aes_rst current status of the aes_rst 0 = reset asserted 1 = no reset 0r 24 - reserved - - 25 - reserved - - 26 - reserved - - 27 - reserved - - 28 gpio_rst current status of the gpio_rst 0 = reset asserted 1 = no reset 0r 29 - reserved - - 30 - reserved - - 31 - reserved - - table 98. reset active status register 0 (reset_active_status0, address 0x4005 3150) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 129 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) table 99. reset active status register 1 (reset_active_status1, address 0x4005 3154) bit description bit symbol description reset value access 0 timer0_rst current status of the timer0_rst 0 = reset asserted 1 = no reset 0r 1 timer1_rst current status of the timer1_rst 0 = reset asserted 1 = no reset 0r 2 timer2_rst current status of the timer2_rst 0 = reset asserted 1 = no reset 0r 3 timer3_rst current status of the timer3_rst 0 = reset asserted 1 = no reset 0r 4 ritimer_rst current status of the ostimer_rst 0 = reset asserted 1 = no reset 0r 5 sct_rst current status of the sct_rst 0 = reset asserted 1 = no reset 0r 6 motoconpwm_rst current status of the motoconpwm_rst 0 = reset asserted 1 = no reset 0r 7 qei_rst current status of the qei_rst 0 = reset asserted 1 = no reset 0r 8 adc0_rst current status of the adc0_rst 0 = reset asserted 1 = no reset 0r 9 adc1_rst current status of the adc1_rst 0 = reset asserted 1 = no reset 0r 10 dac_rst current status of the dac_rst 0 = reset asserted 1 = no reset 0r 11 - - - 12 uart0_rst current status of the uart0_rst 0 = reset asserted 1 = no reset 0r 13 uart1_rst current status of the uart1_rst 0 = reset asserted 1 = no reset 0r www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 130 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 14 uart2_rst current status of the uart2_rst 0 = reset asserted 1 = no reset 0r 15 uart3_rst current status of the uart3_rst 0 = reset asserted 1 = no reset 0r 16 i2c0_rst current status of the i2c0_rst 0 = reset asserted 1 = no reset 0r 17 i2c1_rst current status of the i2c1_rst 0 = reset asserted 1 = no reset 0r 18 ssp0_rst current stat us of the ssp0_rst 0 = reset asserted 1 = no reset 0r 19 ssp1_rst current stat us of the ssp1_rst 0 = reset asserted 1 = no reset 0r 20 i2s_rst current status of the i2s_rst 0 = reset asserted 1 = no reset 0r 21 spifi_rst current status of the spifi_rst 0 = reset asserted 1 = no reset 0r 22 can1_rst current status of the can1_rst 0 = reset asserted 1 = no reset 0r 23 can0_rst current status of the can0_rst 0 = reset asserted 1 = no reset 0r 24 - reserved. - - 24 - reserved. - - 26 - reserved. - - 27 - reserved. - - 28 - reserved. - - 29 - reserved. - - 30 - reserved. - - 31 - reserved. - - table 99. reset active status register 1 (reset_active_status1, address 0x4005 3154) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 131 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 11.4.4 reset external status registers the external status registers indicate which input to the reset generator caused the reset output to go active. any bit set to 1 in the reset external status register should be cleared to 0 after a read operation to allow the detection of the next reset. all reset generators except the wwdt time- out reset, the bod reset, the reset signal from the pmu, and the software reset, which have no inputs, have an associated external status register. the core_rst reset gener ator has three possible inputs (the wwdt time-out reset, the bod reset, and the pmu), and which input caused the reset is indicated in the external status register. a ll other reset generators have only one input which, depending on the hierarchy, can be either the core_rst, the peripheral_rst, or the master_rst. note that the external status register do es not show whether or not the reset was activated by a software reset. the software reset is indicated in the reset status registers 0 to 3 (see ta b l e 9 4 to ta b l e 9 7 ). 11.4.4.1 reset external status register 0 for core_rst this register shows whether or not any of the inputs to the core_rst reset generator has activated the core_rst. the core_rst can be activated by the external reset pin, a wwdt time-out, a bod reset or by writ ing to bit 0 of the reset_ctrl0 register. 11.4.4.2 reset external status register 1 for periph_rst this register shows whether or not t he core_rst output has activated the periph_rst. a reset generated from the core_rst is the only possible reset source for the periph_rst aside from a software reset by writing to the reset_ctrl register. table 100. reset external st atus register 0 (reset_ext_stat0, address 0x4005 3400) bit description bit symbol description reset value access 0 ext_reset reset activated by exte rnal reset from reset pin. write 0 to clear. 0 = reset not activated by reset pin 1 = reset activated 0r/w 1 - reserved. do not modify; read as logic 0. 0 - 2 - reserved. do not modify; read as logic 0. 0 - 3 - reserved. do not modify; read as logic 0. 0 - 4 bod_reset reset activated by bod reset. write 0 to clear. 0 = reset not activated by bod 1 = reset activated 0r/w 5 wwdt_reset reset activated by ww dt time-out. write 0 to clear. 0 = reset not activated by wwdt 1 = reset activated 0r/w 31:6 - reserved. do not modify; read as logic 0. 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 132 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 11.4.4.3 reset external status register 2 for master_rst 11.4.4.4 reset external status register 4 for wwdt_rst 11.4.4.5 reset external status register 5 for creg_rst table 101. reset external st atus register 1 (reset_ext_stat1, address 0x4005 3404) bit description bit symbol description reset value access 0 - reserved. do not modify; read as logic 0. 0 - 1 core_reset reset activated by core_rst output. write 0 to clear. 0 = reset not activated 1 = reset activated 0r/w 31:2 - reserved. do not modify; read as logic 0. 0 - table 102. reset external st atus register 2 (reset_ext_stat2, address 0x4005 3408) bit description bit symbol description reset value access 1:0 - reserved. do not modify; read as logic 0. 0 - 2 peripheral_reset reset acti vated by peripheral_rst output. write 0 to clear. 0 = reset not activated 1 = reset activated 0r/w 31:3 - reserved. do not modify; read as logic 0. 0 - table 103. reset external st atus register 4 (reset_ext_stat4, address 0x4005 3410) bit description bit symbol description reset value access 0 - reserved. do not modify; read as logic 0. 0 - 1 core_reset reset activated by core_rst output. write 0 to clear. 0 = reset not activated 1 = reset activated 0r/w 31:2 - reserved. do not modify; read as logic 0. 0 - table 104. reset external st atus register 5 (reset_ext_stat5, address 0x4005 3414) bit description bit symbol description reset value access 0 - reserved. do not modify; read as logic 0. 0 - 1 core_reset reset activated by core_rst output. write 0 to clear. 0 = reset not activated 1 = reset activated 0r/w 31:2 - reserved. do not modify; read as logic 0. 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 133 of 1164 nxp semiconductors UM10430 chapter 11: lpc18xx reset generation unit (rgu) 11.4.4.6 reset external status registers for peripheral_reset refer to ta b l e 9 1 for reset generators which have the periph_rst output as reset source. 11.4.4.7 reset external status registers for master_reset refer to ta b l e 9 1 for reset generators which have the master_rst output as reset source. these are the arm cortex-m3 core, the lcd controller, the usb0, the gpdma, the sdio controller, the extern al memory controller, the et hernet controll er, and the aes. the reset value is dependent on the peripheral, see ta b l e 9 1 . table 105. reset external stat us registers x (reset_ext_statx, address 0x4005 34xx) bit description bit symbol description reset value access 1:0 - reserved. do not modify; read as logic 0. 0 - 2 peripheral_reset reset acti vated by peripheral_rst output. write 0 to clear. 0 = reset not activated 1 = reset activated 0r/w 31:3 - reserved. do not modify; read as logic 0. 0 - table 106. reset external st atus registers y (reset_ext_staty, address 0x4005 34yy) bit description bit symbol description reset value access 2:0 - reserved. do not modify; read as logic 0. 0 - 3 master_reset reset activated by master_r st output. write 0 to clear. 0 = reset not activated 1 = reset activated 0r/w 31:4 - reserved. do not modify; read as logic 0. 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 134 of 1164 12.1 how to read this chapter this chapter applies to parts lpc1850_30_20_10 rev ?a? only. 12.2 pin description on the lpc18xx, digital pins are grouped into 16 ports, named p0 to p9 and pa to pf, with up to 20 pins used per port. each digital pin may support up to four different digital functions, including general purpose i/o (gpi o), selectable through the scu registers. note that the pin name is not indicati ve of the gpio port assigned to it. UM10430 chapter 12: lpc18xx pin configuration rev. 00.13 ? 20 july 2011 user manual www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 135 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration table 107. pin description symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description multiplexed digital pins p0_0 l3 x x x 32 [3] i; pu i/o gpio0[0] ? general purpose digi tal input/output pin. i/o ssp1_miso ? master in slave out for ssp1. i enet_rxd1 ? ethernet receive data 1 (rmii/mii interface). - r ? function reserved. - r ? function reserved. - r ? function reserved. i/o i2s0_tx_ws ? transmit word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . i/o i2s1_tx_ws ? transmit word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . p0_1 m2 x x x 34 [3] i; pu i/o gpio0[1] ? general purpose digi tal input/output pin. i/o ssp1_mosi ? master out slave in for ssp1. i enet_col ? ethernet collision det ect (mii interface). - r ? function reserved. - r ? function reserved. - r ? function reserved. enet_tx_en ? ethernet transmit enable (rmii/mii interface). i/o i2s1_tx_sda ? i2s1 transmit data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . p1_0 p2 x x x 38 [3] i; pu i/o gpio0[4] ? general purpose digi tal input/output pin. i ctin_3 ? sct input 3. capture input 1 of timer 1. i/o emc_a5 ? external memory address line 5. - r ? function reserved. - r ? function reserved. i/o ssp0_ssel ? slave select for ssp0. - r ? function reserved. - r ? function reserved. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 136 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p1_1 r2 x x x 42 [3] i; pu i/o gpio0[8] ? general purpose digita l input/output pin. boot pin (see ta b l e 8 ). o ctout_7 ? sct output 7. match output 3 of timer 1. i/o emc_a6 ? external memory address line 6. - r ? function reserved. - r ? function reserved. i/o ssp0_miso ? master in slave out for ssp0. - r ? function reserved. - r ? function reserved. p1_2 r3 x x x 43 [3] i; pu i/o gpio0[9] ? general purpose digita l input/output pin. boot pin (see ta b l e 8 ). o ctout_6 ? sct output 6. match output 2 of timer 1. i/o emc_a7 ? external memory address line 7. - r ? function reserved. - r ? function reserved. i/o ssp0_mosi ? master out slave in for ssp0. - r ? function reserved. - r ? function reserved. p1_3 p5 x x x 44 [3] i; pu i/o gpio0[10] ? general purpose digital input/output pin. o ctout_8 ? sct output 8. match output 0 of timer 2. - r ? function reserved. o emc_oe ? low active output enable signal. o usb0_ind1 ? usb0 port indicator led control output 1. i/o ssp1_miso ? master in slave out for ssp1. - r ? function reserved. o sd_rst ? sd/mmc reset signal for mmc4.4 card. p1_4 t3 x x x 47 [3] i; pu i/o gpio0[11] ? general purpose digital input/output pin. o ctout_9 ? sct output 9. match output 1 of timer 2. - r ? function reserved. o emc_bls0 ? low active byte lane select signal 0. o usb0_ind0 ? usb0 port indicator led control output 0. i/o ssp1_mosi ? master out slave in for ssp1. - r ? function reserved. o sd_volt1 ? sd/mmc bus voltage select output 1. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 137 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p1_5 r5 x x x 48 [3] i; pu i/o gpio1[8] ? general purpose digi tal input/output pin. o ctout_10 ? sct output 10. match output 2 of timer 2. - r ? function reserved. o emc_cs0 ? low active chip select 0 signal. o usb0_pwr_fault ? port power fault signal indicating overcurrent condition; this signal monitors over-current on the usb bus (external circuitry required to detect over-current condition). i/o ssp1_ssel ? slave select for ssp1. - r ? function reserved. o sd_pow ? . p1_6 t4 x x x 49 [3] i; pu i/o gpio1[9] ? general purpose digi tal input/output pin. i ctin_5 ? sct input 5. capture input 2 of timer 2. - r ? function reserved. o emc_we ? low active write enable signal. - r ? function reserved. - r ? function reserved. - r ? function reserved. i/o sd_cmd ? sd/mmc command signal. p1_7 t5 x x x 50 [3] i; pu i/o gpio1[0] ? general purpose digi tal input/output pin. i u1_dsr ? data set ready input for uart1. o ctout_13 ? sct output 13. match output 1 of timer 3. i/o emc_d0 ? external memory data line 0. o usb0_pwr_en ? vbus drive signal (towards external charge pump or power management unit); indicates that vbus must be driven (active high). - r ? function reserved. - r ? function reserved. - r ? function reserved. p1_8 r7 x x x 51 [3] i; pu i/o gpio1[1] ? general purpose digi tal input/output pin. o u1_dtr ? data terminal ready output for uart1. o ctout_12 ? sct output 12. match output 0 of timer 3. i/o emc_d1 ? external memory data line 1. - r ? function reserved. - r ? function reserved. - r ? function reserved. o sd_volt0 ? sd/mmc bus voltage select output 0. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 138 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p1_9 t7 x x x 52 [3] i; pu i/o gpio1[2] ? general purpose digi tal input/output pin. o u1_rts ? request to send output for uart1. o ctout_11 ? sct output 11. match output 3 of timer 2. i/o emc_d2 ? external memory data line 2. - r ? function reserved. - r ? function reserved. - r ? function reserved. i/o sd_dat0 ? sd/mmc data bus line 0. p1_10 r8 x x x 53 [3] i; pu i/o gpio1[3] ? general purpose digi tal input/output pin. i u1_ri ? ring indicator input for uart1. o ctout_14 ? sct output 14. match output 2 of timer 3. i/o emc_d3 ? external memory data line 3. - r ? function reserved. - r ? function reserved. - r ? function reserved. i/o sd_dat1 ? sd/mmc data bus line 1. p1_11 t9 x x x 55 [3] i; pu i/o gpio1[4] ? general purpose digi tal input/output pin. i u1_cts ? clear to send input for uart1. o ctout_15 ? sct output 15. match output 3 of timer 3. i/o emc_d4 ? external memory data line 4. - r ? function reserved. - r ? function reserved. - r ? function reserved. i/o sd_dat2 ? sd/mmc data bus line 2. p1_12 r9 x x x 56 [3] i; pu i/o gpio1[5] ? general purpose digi tal input/output pin. i u1_dcd ? data carrier detect input for uart1. - r ? function reserved. i/o emc_d5 ? external memory data line 5. i t0_cap1 ? capture input 1 of timer 0. - r ? function reserved. - r ? function reserved. i/o sd_dat3 ? sd/mmc data bus line 3. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 139 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p1_13 r10 x x x 60 [3] i; pu i/o gpio1[6] ? general purpose digi tal input/output pin. o u1_txd ? transmitter output for uart1. - r ? function reserved. i/o emc_d6 ? external memory data line 6. i t0_cap0 ? capture input 0 of timer 0. - r ? function reserved. - r ? function reserved. i sd_cd ? sd/mmc card detect input. p1_14 r11 x x x 61 [3] i; pu i/o gpio1[7] ? general purpose digi tal input/output pin. i u1_rxd ? receiver input for uart1. - r ? function reserved. i/o emc_d7 ? external memory data line 7. o t0_mat2 ? match output 2 of timer 0. - r ? function reserved. - r ? function reserved. - r ? function reserved. p1_15 t12 x x x 62 [3] i; pu i/o gpio0[2] ? general purpose digi tal input/output pin. o u2_txd ? transmitter output for usart2. - r ? function reserved. i enet_rxd0 ? ethernet receive data 0 (rmii/mii interface). o t0_mat1 ? match output 1of timer 0. - r ? function reserved. - r ? function reserved. - r ? function reserved. p1_16 m7 x x x 64 [3] i; pu i/o gpio0[3] ? general purpose digi tal input/output pin. i u2_rxd ? receiver input for usart2. - r ? function reserved. i enet_crs ? ethernet carrier sense (mii interface). o t0_mat0 ? match output 0 of timer 0. - r ? function reserved. - r ? function reserved. i enet_rx_dv ? ethernet receive data valid (rmii/mii interface). table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 140 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p1_17 m8 x x x 66 [4] i; pu i/o gpio0[12] ? general purpose digital input/output pin. i/o u2_uclk ? serial clock input/output for usart2 in synchronous mode. - r ? function reserved. i/o enet_mdio ? ethernet miim data input and output. i t0_cap3 ? capture input 3 of timer 0. o can1_td ? can1 transmitter output. - r ? function reserved. - r ? function reserved. p1_18 n12 x x x 67 [3] i; pu i/o gpio0[13] ? general purpose digital input/output pin. i/o u2_dir ? rs-485/eia-485 output enable/direction control for usart2. - r ? function reserved. o enet_txd0 ? ethernet transmit data 0 (rmii/mii interface). o t0_mat3 ? match output 3 of timer 0. i can1_rd ? can1 receiver input. - r ? function reserved. - r ? function reserved. p1_19 m11 x x x 68 [3] i; pu i enet_tx_clk (enet_ref_clk) ? ethernet transmit clock (mii interface) or et hernet reference clock (rmii interface). i/o ssp1_sck ? serial clock for ssp1. - r ? function reserved. - r ? function reserved. o clkout ? clock output pin. - r ? function reserved. o i2s0_rx_mclk ? i2s receive master clock. i/o i2s1_tx_sck ? receive clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification. p1_20 m10 x x x 70 [3] i; pu i/o gpio0[15] ? general purpose digital input/output pin. i/o ssp1_ssel ? slave select for ssp1. - r ? function reserved. o enet_txd1 ? ethernet transmit data 1 (rmii/mii interface). i t0_cap2 ? capture input 2 of timer 0. - r ? function reserved. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 141 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p2_0 t16 x x x 75 [3] i; pu - r ? function reserved. o u0_txd ? transmitter output for usart0. i/o emc_a13 ? external memory address line 13. o usb0_pwr_en ? vbus drive signal (towards external charge pump or power management unit); indicates that vbus must be driven (active high). i/o gpio5[0] ? general purpose digi tal input/output pin. - r ? function reserved. i t3_cap0 ? capture input 0 of timer 3. o enet_mdc ? ethernet miim clock. p2_1 n15 x x x 81 [3] i; pu - r ? function reserved. i u0_rxd ? receiver input for usart0. i/o emc_a12 ? external memory address line 12. o usb0_pwr_fault ? port power fault signal indicating overcurrent condition; this signal monitors over-current on the usb bus (external circuitry required to detect over-current condition). i/o gpio5[1] ? general purpose digi tal input/output pin. - r ? function reserved. i t3_cap1 ? capture input 1 of timer 3. - r ? function reserved. p2_2 m15 x x x 84 [3] i; pu - r ? function reserved. i/o u0_uclk ? serial clock input/output for usart0 in synchronous mode. i/o emc_a11 ? external memory address line 11. o usb0_ind1 ? usb0 port indicator led control output 1. i/o gpio5[2] ? general purpose digi tal input/output pin. o ctout_6 ? sct output 6. match output 2 of timer 1. i t3_cap2 ? capture input 2 of timer 3. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 142 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p2_3 j12 x x x 87 [4] i; pu - r ? function reserved. i/o i2c1_sda ? i 2 c1 data input/output (this pin does not use a specialized i 2 c pad). o u3_txd ? transmitter output for usart3. i ctin_1 ? sct input 1. capture input 1 of timer 0. capture input 1 of timer 2. i/o gpio5[3] ? general purpose digi tal input/output pin. - r ? function reserved. o t3_mat0 ? match output 0 of timer 3. o usb0_pwr_en ? vbus drive signal (towards external charge pump or power management unit); indicates that vbus must be driven (active high). p2_4 k11 x x x 88 [4] i; pu - r ? function reserved. i/o i2c1_scl ? i 2 c1 clock input/output (this pin does not use a specialized i 2 c pad). i u3_rxd ? receiver input for usart3. i ctin_0 ? sct input 0. capture inpu t 0 of timer 0, 1, 2, 3. i/o gpio5[4] ? general purpose digi tal input/output pin. - r ? function reserved. o t3_mat1 ? match output 1 of timer 3. o usb0_pwr_fault ? port power fault signal indicating overcurrent condition; this signal monitors over-current on the usb bus (external circuitry required to detect over-current condition). p2_5 k14 x x x 91 [4] i; pu - r ? function reserved. i ctin_2 ? sct input 2. capture input 2 of timer 0. i usb1_vbus ? monitors the presence of usb1 bus power. note: this signal must be h igh for usb reset to occur. i adctrig1 ? adc trigger input 1. i/o gpio5[5] ? general purpose digi tal input/output pin. - r ? function reserved. o t3_mat2 ? match output 2 of timer 3. o usb0_ind0 ? usb0 port indicator led control output 0. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 143 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p2_6 k16 x x x 95 [3] i; pu - r ? function reserved. i/o u0_dir ? rs-485/eia-485 output enable/direction control for usart0. i/o emc_a10 ? external memory address line 10. o usb0_ind0 ? usb0 port indicator led control output 0. i/o gpio5[6] ? general purpose digi tal input/output pin. i ctin_7 ? sct input 7. i t3_cap3 ? capture input 3 of timer 3. - r ? function reserved. p2_7 h14 x x x 96 [3] i; pu i/o gpio0[7] ? general purpose digital input/output pin. isp entry pin. if this pin is pulled low at reset, the part enters isp mode using usart0. o ctout_1 ? sct output 1. match output 1 of timer 0. i/o u3_uclk ? serial clock input/output for usart3 in synchronous mode. i/o emc_a9 ? external memory address line 9. - r ? function reserved. - r ? function reserved. o t3_mat3 ? match output 3 of timer 3. - r ? function reserved. p2_8 j16 x x x 98 [3] i; pu - n.c. - boot pin (see table 8 ). o ctout_0 ? sct output 0. match output 0 of timer 0. i/o u3_dir ? rs-485/eia-485 output enable/direction control for usart3. i/o emc_a8 ? external memory address line 8. i/o gpio5[7] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. p2_9 h16 x x x 102 [3] i; pu i/o gpio1[10] ? general purpose digital input/output pin. boot pin (see ta b l e 8 ). o ctout_3 ? sct output 3. match output 3 of timer 0. i/o u3_baud ? for usart3. i/o emc_a0 ? external memory address line 0. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 144 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p2_10 g16 x x x 104 [3] i; pu i/o gpio0[14] ? general purpose digital input/output pin. o ctout_2 ? sct output 2. match output 2 of timer 0. o u2_txd ? transmitter output for usart2. i/o emc_a1 ? external memory address line 1. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. p2_11 f16 x x x 105 [3] i; pu i/o gpio1[11] ? general purpose digital input/output pin. o ctout_5 ? sct output 5. match output 1 of timer 1. i u2_rxd ? receiver input for usart2. i/o emc_a2 ? external memory address line 2. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. p2_12 e15 x x x 106 [3] i; pu i/o gpio1[12] ? general purpose digital input/output pin. o ctout_4 ? sct output 4. match output 0 of timer 1. - r ? function reserved. i/o emc_a3 ? external memory address line 3. - r ? function reserved. - r ? function reserved. - r ? function reserved. i/o u2_uclk ? serial clock input/output for usart2 in synchronous mode. p2_13 c16 x x x 108 [3] i; pu i/o gpio1[13] ? general purpose digital input/output pin. i ctin_4 ? sct input 4. capture input 2 of timer 1. - r ? function reserved. i/o emc_a4 ? external memory address line 4. - r ? function reserved. - r ? function reserved. - r ? function reserved. i/o u2_dir ? rs-485/eia-485 output enable/direction control for usart2. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 145 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p3_0 f13 x x x 112 [3] i; pu i/o i2s0_rx_sck ? i2s transmit clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification . o i2s0_rx_mclk ? i2s receive master clock. i/o i2s0_tx_sck ? receive clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification. o i2s0_tx_mclk ? i2s transmit master clock. i/o ssp0_sck ? serial clock for ssp0. - r ? function reserved. - r ? function reserved. - r ? function reserved. p3_1 g11 x x x 114 [3] i; pu i/o i2s0_tx_ws ? transmit word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . i/o i2s0_rx_ws ? receive word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . i can0_rd ? can receiver input. o usb1_ind1 ? usb1 port indicator led control output 1. i/o gpio5[8] ? general purpose digi tal input/output pin. - r ? function reserved. o lcd_vd15 ? lcd data. - r ? function reserved. p3_2 f11 x x x 116 [3] i; pu i/o i2s0_tx_sda ? i2s transmit data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . i/o i2s0_rx_sda ? i2s receive data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . o can0_td ? can transmitter output. o usb1_ind0 ? usb1 port indicator led control output 0. i/o gpio5[9] ? general purpose digi tal input/output pin. - r ? function reserved. o lcd_vd14 ? lcd data. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 146 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p3_3 b14 x x x 118 [5] i; pu - r ? function reserved. - r ? function reserved. i/o ssp0_sck ? serial clock for ssp0. o spifi_sck ? serial clock for spifi. o cgu_out1 ? cgu spare clock output 1. - r ? function reserved. o i2s0_tx_mclk ? i2s transmit master clock. i/o i2s1_tx_sck ? receive clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification. p3_4 a15 x x x 119 [3] i; pu i/o gpio1[14] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. i/o spifi_sio3 ? i/o lane 3 for spifi. o u1_txd ? transmitter output for uart 1. i/o i2s0_tx_ws ? transmit word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . i/o i2s1_rx_sda ? i2s1 receive data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . o lcd_vd13 ? lcd data. p3_5 c12 x x x 121 [3] i; pu i/o gpio1[15] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. i/o spifi_sio2 ? i/o lane 2 for spifi. i u1_rxd ? receiver input for uart 1. i/o i2s0_tx_sda ? i2s transmit data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . i/o i2s1_rx_ws ? receive word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . o lcd_vd12 ? lcd data. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 147 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p3_6 b13 x x x 122 [3] i; pu i/o gpio0[6] ? general purpose digi tal input/output pin. - r ? function reserved. i/o ssp0_ssel ? slave select for ssp0. i/o spifi_miso ? input 1 in spifi qu ad mode; spifi output io1. - r ? function reserved. i/o ssp0_miso ? master in slave out for ssp0. - r ? function reserved. - r ? function reserved. p3_7 c11 x x x 123 [3] i; pu - r ? function reserved. - r ? function reserved. i/o ssp0_miso ? master in slave out for ssp0. i/o spifi_mosi ? input i0 in spifi quad mode; spifi output io0. i/o gpio5[10] ? general purpose digital input/output pin. i/o ssp0_mosi ? master out slave in for ssp0. - r ? function reserved. - r ? function reserved. p3_8 c10 x x x 124 [3] i; pu - r ? function reserved. - r ? function reserved. i/o ssp0_mosi ? master out slave in for ssp0. i/o spifi_cs ? spifi serial flas h chip select. i/o gpio5[11] ? general purpose digital input/output pin. i/o ssp0_ssel ? slave select for ssp0. - r ? function reserved. - r ? function reserved. p4_0 d5 x - x 1 [3] i; pu i/o gpio2[0] ? general purpose digi tal input/output pin. o mcoa0 ? motor control pwm channel 0, output a. i nmi ? external interrupt input to nmi. - r ? function reserved. - r ? function reserved. o lcd_vd13 ? lcd data. i/o u3_uclk ? serial clock input/output for usart3 in synchronous mode. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 148 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p4_1 a1 x - x 3 [6] i; pu i/o gpio2[1] ? general purpose digi tal input/output pin. o ctout_1 ? sct output 1. match output 1 of timer 0. o lcd_vd0 ? lcd data. - r ? function reserved. - r ? function reserved. o lcd_vd19 ? lcd data. o u3_txd ? transmitter output for usart3. i enet_col ? ethernet collision det ect (mii interface). i adc0_1 ? adc0, input channel 1. p4_2 d3 x - x 8 [3] i; pu i/o gpio2[2] ? general purpose digi tal input/output pin. o ctout_0 ? sct output 0. match output 0 of timer 0. o lcd_vd3 ? lcd data. - r ? function reserved. - r ? function reserved. o lcd_vd12 ? lcd data. i u3_rxd ? receiver input for usart3. - r ? function reserved. p4_3 c2 x - x 7 [6] i; pu i/o gpio2[3] ? general purpose digi tal input/output pin. o ctout_3 ? sct output 0. match output 3 of timer 0. o lcd_vd2 ? lcd data. - r ? function reserved. - r ? function reserved. o lcd_vd21 ? lcd data. i/o u3_baud ? for usart3. - r ? function reserved. i adc0_0 ? adc0, input channel 0. p4_4 b1 x - x 9 [6] i; pu i/o gpio2[4] ? general purpose digi tal input/output pin. o ctout_2 ? sct output 2. match output 2 of timer 0. o lcd_vd1 ? lcd data. - r ? function reserved. - r ? function reserved. o lcd_vd20 ? lcd data. i/o u3_dir ? rs-485/eia-485 output enable/direction control for usart3. - r ? function reserved. o dac ? dac output. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 149 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p4_5 d2 x - x 10 [3] i; pu i/o gpio2[5] ? general purpose digi tal input/output pin. o ctout_5 ? sct output 5. match output 1 of timer 1. o lcd_fp ? frame pulse (stn). vertical synchronization pulse (tft). - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. p4_6 c1 x - x 11 [3] i; pu i/o gpio2[6] ? general purpose digi tal input/output pin. o ctout_4 ? sct output 4. match output 0 of timer 1. o lcd_enab/lcdm ? stn ac bias drive or tft data enable input. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. p4_7 h4 x - x 14 [3] o lcd_dclk ? lcd panel clock. i gp_clkin ? general purpose clock input to the cgu. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. i/o i2s1_tx_sck ? receive clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification. i/o i2s0_tx_sck ? receive clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification. p4_8 e2 x - x 15 [3] i; pu - r ? function reserved. i ctin_5 ? sct input 5. capture input 2 of timer 2. o lcd_vd9 ? lcd data. - r ? function reserved. i/o gpio5[12] ? general purpose digital input/output pin. o lcd_vd22 ? lcd data. o can1_td ? can1 transmitter output. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 150 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p4_9 l2 x - x 33 [3] i; pu - r ? function reserved. i ctin_6 ? sct input 6. capture input 1 of timer 3. o lcd_vd11 ? lcd data. - r ? function reserved. i/o gpio5[13] ? general purpose digital input/output pin. o lcd_vd15 ? lcd data. i can1_rd ? can1 receiver input. - r ? function reserved. p4_10 m3 x - x 35 [3] i; pu - r ? function reserved. i ctin_2 ? sct input 2. capture input 2 of timer 0. o lcd_vd10 ? lcd data. - r ? function reserved. i/o gpio5[14] ? general purpose digital input/output pin. o lcd_vd14 ? lcd data. - r ? function reserved. - r ? function reserved. p5_0 n3 x - x 37 [3] i; pu i/o gpio2[9] ? general purpose digi tal input/output pin. o mcob2 ? motor control pwm channel 2, output b. i/o emc_d12 ? external memory data line 12. - r ? function reserved. i u1_dsr ? data set ready input for uart 1. i t1_cap0 ? capture input 0 of timer 1. - r ? function reserved. - r ? function reserved. p5_1 p3 x - x 39 [3] i; pu i/o gpio2[10] ? general purpose digital input/output pin. i mci2 ? motor control pwm channel 2, input. i/o emc_d13 ? external memory data line 13. - r ? function reserved. o u1_dtr ? data terminal ready output for uart 1. can also be configured to be an rs-485/eia-485 output enable signal for uart 1. i t1_cap1 ? capture input 1 of timer 1. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 151 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p5_2 r4 x - x 46 [3] i; pu i/o gpio2[11] ? general purpose digital input/output pin. i mci1 ? motor control pwm channel 1, input. i/o emc_d14 ? external memory data line 14. - r ? function reserved. o u1_rts ? request to send output for uart 1. can also be configured to be an rs-485/eia-485 output enable signal for uart 1. i t1_cap2 ? capture input 2 of timer 1. - r ? function reserved. - r ? function reserved. p5_3 t8 x - x 54 [3] i; pu i/o gpio2[12] ? general purpose digital input/output pin. i mci0 ? motor control pwm channel 0, input. i/o emc_d15 ? external memory data line 15. - r ? function reserved. i u1_ri ? ring indicator input for uart 1. i t1_cap3 ? capture input 3 of timer 1. - r ? function reserved. - r ? function reserved. p5_4 p9 x - x 57 [3] i; pu i/o gpio2[13] ? general purpose digital input/output pin. o mcob0 ? motor control pwm channel 0, output b. i/o emc_d8 ? external memory data line 8. - r ? function reserved. i u1_cts ? clear to send input for uart 1. o t1_mat0 ? match output 0 of timer 1. - r ? function reserved. - r ? function reserved. p5_5 p10 x - x 58 [3] i; pu i/o gpio2[14] ? general purpose digital input/output pin. o mcoa1 ? motor control pwm channel 1, output a. i/o emc_d9 ? external memory data line 9. - r ? function reserved. i u1_dcd ? data carrier detect input for uart 1. o t1_mat1 ? match output 1 of timer 1. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 152 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p5_6 t13 x - x 63 [3] i; pu i/o gpio2[15] ? general purpose digital input/output pin. o mcob1 ? motor control pwm channel 1, output b. i/o emc_d10 ? external memory data line 10. - r ? function reserved. o u1_txd ? transmitter output for uart 1. o t1_mat2 ? match output 2 of timer 1. - r ? function reserved. - r ? function reserved. p5_7 r12 x - x 65 [3] i; pu i/o gpio2[7] ? general purpose digi tal input/output pin. o mcoa2 ? motor control pwm channel 2, output a. i/o emc_d11 ? external memory data line 11. - r ? function reserved. i u1_rxd ? receiver input for uart 1. o t1_mat3 ? match output 3 of timer 1. - r ? function reserved. - r ? function reserved. p6_0 m12 x x x 73 [3] i; pu - r ? function reserved. o i2s0_rx_mclk ? i2s receive master clock. - r ? function reserved. - r ? function reserved. i/o i2s0_rx_sck ? receive clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification . - r ? function reserved. - r ? function reserved. - r ? function reserved. p6_1 r15 x x x 74 [3] i; pu i/o gpio3[0] ? general purpose digi tal input/output pin. o emc_dycs1 ? sdram chip select 1. i/o u0_uclk ? serial clock input/output for usart0 in synchronous mode. i/o i2s0_rx_ws ? receive word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . - r ? function reserved. i t2_cap0 ? capture input 2 of timer 2. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 153 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p6_2 l13 x x x 78 [3] i; pu i/o gpio3[1] ? general purpose digi tal input/output pin. o emc_ckeout1 ? sdram clock enable 1. i/o u0_dir ? rs-485/eia-485 output enable/direction control for usart0. i/o i2s0_rx_sda ? i2s receive data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . - r ? function reserved. i t2_cap1 ? capture input 1 of timer 2. - r ? function reserved. - r ? function reserved. p6_3 p15 x - x 79 [3] i; pu i/o gpio3[2] ? general purpose digi tal input/output pin. o usb0_pwr_en ? vbus drive signal (towards external charge pump or power management unit); indicates that the vbus signal must be driven (active high). - r ? function reserved. o emc_cs1 ? low active chip select 1 signal. - r ? function reserved. i t2_cap2 ? capture input 2 of timer 2. - r ? function reserved. - r ? function reserved. p6_4 r16 x x x 80 [3] i; pu i/o gpio3[3] ? general purpose digi tal input/output pin. i ctin_6 ? sct input 6. capture input 1 of timer 3. o u0_txd ? transmitter output for usart0. o emc_cas ? low active sdram column address strobe. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. p6_5 p16 x x x 82 [3] i; pu i/o gpio3[4] ? general purpose digi tal input/output pin. o ctout_6 ? sct output 6. match output 2 of timer 1. i u0_rxd ? receiver input for usart0. o emc_ras ? low active sdram row address strobe. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 154 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p6_6 l14 x - x 83 [3] i; pu i/o gpio0[5] ? general purpose digi tal input/output pin. o emc_bls1 ? low active byte lane select signal 1. - r ? function reserved. o usb0_pwr_fault ? port power fault signal indicating overcurrent condition; this signal monitors over-current on the usb bus (external circuitry required to detect over-current condition). - r ? function reserved. i t2_cap3 ? capture input 3 of timer 2. - r ? function reserved. - r ? function reserved. p6_7 j13 x - x 85 [3] i; pu - r ? function reserved. i/o emc_a15 ? external memory address line 15. - r ? function reserved. o usb0_ind1 ? usb0 port indicator led control output 1. i/o gpio5[15] ? general purpose digital input/output pin. o t2_mat0 ? match output 0 of timer 2. - r ? function reserved. - r ? function reserved. p6_8 h13 x - x 86 [3] i; pu - r ? function reserved. i/o emc_a14 ? external memory address line 14. - r ? function reserved. o usb0_ind0 ? usb0 port indicator led control output 0. i/o gpio5[16] ? general purpose digital input/output pin. o t2_mat1 ? match output 1 of timer 2. - r ? function reserved. - r ? function reserved. p6_9 j15 x x x 97 [3] i; pu i/o gpio3[5] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. o emc_dycs0 ? sdram chip select 0. - r ? function reserved. o t2_mat2 ? match output 2 of timer 2. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 155 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p6_10 h15 x - x 100 [3] i; pu i/o gpio3[6] ? general purpose digi tal input/output pin. o mcabort ? motor control pwm, low-active fast abort. - r ? function reserved. o emc_dqmout1 ? data mask 1 used with sdram and static devices. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. p6_11 h12 x x x 101 [3] i; pu i/o gpio3[7] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. o emc_ckeout0 ? sdram clock enable 0. - r ? function reserved. o t2_mat3 ? match output 2 of timer 3. - r ? function reserved. - r ? function reserved. p6_12 g15 x - x 103 [3] i; pu i/o gpio2[8] ? general purpose digi tal input/output pin. o ctout_7 ? sct output 7. match output 3 of timer 1. - r ? function reserved. o emc_dqmout0 ? data mask 0 used with sdram and static devices. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. p7_0 b16 x - x 110 [3] i; pu i/o gpio3[8] ? general purpose digi tal input/output pin. o ctout_14 ? sct output 14. match output 2 of timer 3. - r ? function reserved. o lcd_le ? line end signal. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 156 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p7_1 c14 x - x 113 [3] i; pu i/o gpio3[9] ? general purpose digi tal input/output pin. o ctout_15 ? sct output 15. match output 3 of timer 3. i/o i2s0_tx_ws ? transmit word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . o lcd_vd19 ? lcd data. o lcd_vd7 ? lcd data. - r ? function reserved. o u2_txd ? transmitter output for usart2. - r ? function reserved. p7_2 a16 x - x 113 [3] i; pu i/o gpio3[10] ? general purpose digital input/output pin. i ctin_4 ? sct input 4. capture input 2 of timer 1. i/o i2s0_tx_sda ? i2s transmit data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . o lcd_vd18 ? lcd data. o lcd_vd6 ? lcd data. - r ? function reserved. i u2_rxd ? receiver input for usart2. - r ? function reserved. p7_3 c13 x - x 117 [3] i; pu i/o gpio3[11] ? general purpose digital input/output pin. i ctin_3 ? sct input 3. capture input 1 of timer 1. - r ? function reserved. o lcd_vd17 ? lcd data. o lcd_vd5 ? lcd data. - r ? function reserved. - r ? function reserved. - r ? function reserved. p7_4 c8 x - x 132 [6] i; pu i/o gpio3[12] ? general purpose digital input/output pin. o ctout_13 ? sct output 13. match output 1 of timer 3. - r ? function reserved. o lcd_vd16 ? lcd data. o lcd_vd4 ? lcd data. o tracedata[0] ? trace data, bit 0. - r ? function reserved. - r ? function reserved. i adc0_4 ? adc0, input channel 4. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 157 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p7_5 a7 x - x 133 [6] i; pu i/o gpio3[13] ? general purpose digital input/output pin. o ctout_12 ? sct output 12. match output 0 of timer 3. - r ? function reserved. o lcd_vd8 ? lcd data. o lcd_vd23 ? lcd data. o tracedata[1] ? trace data, bit 1. - r ? function reserved. - r ? function reserved. i adc0_3 ? adc0, input channel 3. p7_6 c7 x - x 134 [3] i; pu i/o gpio3[14] ? general purpose digital input/output pin. o ctout_11 ? sct output 1. match output 3 of timer 2. - r ? function reserved. o lcd_lp ? line synchronization pulse (stn). horizontal synchronization pulse (tft). - r ? function reserved. o tracedata[2] ? trace data, bit 2. - r ? function reserved. - r ? function reserved. p7_7 b6 x - x 140 [6] i; pu i/o gpio3[15] ? general purpose digital input/output pin. o ctout_8 ? sct output 8. match output 0 of timer 2. - r ? function reserved. o lcd_pwr ? lcd panel power enable. - r ? function reserved. o tracedata[3] ? trace data, bit 3. o enet_mdc ? ethernet miim clock. - r ? function reserved. i adc1_6 ? adc1, input channel 6. p8_0 e5 x - x - [4] i; pu i/o gpio4[0] ? general purpose digi tal input/output pin. o usb0_pwr_fault ? port power fault signal indicating overcurrent condition; this signal monitors over-current on the usb bus (external circuitry required to detect over-current condition). - r ? function reserved. i mci2 ? motor control pwm channel 2, input. - r ? function reserved. - r ? function reserved. - r ? function reserved. o t0_mat0 ? match output 0 of timer 0. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 158 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p8_1 h5 x - x - [4] i; pu i/o gpio4[1] ? general purpose digi tal input/output pin. o usb0_ind1 ? usb0 port indicator led control output 1. - r ? function reserved. i mci1 ? motor control pwm channel 1, input. - r ? function reserved. - r ? function reserved. - r ? function reserved. o t0_mat1 ? match output 1 of timer 0. p8_2 k4 x - x - [4] i; pu i/o gpio4[2] ? general purpose digi tal input/output pin. o usb0_ind0 ? usb0 port indicator led control output 0. - r ? function reserved. i mci0 ? motor control pwm channel 0, input. - r ? function reserved. - r ? function reserved. - r ? function reserved. o t0_mat2 ? match output 2 of timer 0. p8_3 j3 x - x - [3] i; pu i/o gpio4[3] ? general purpose digi tal input/output pin. i/o usb1_ulpi_d2 ? ulpi link bidirectional data line 2. - r ? function reserved. o lcd_vd12 ? lcd data. o lcd_vd19 ? lcd data. - r ? function reserved. - r ? function reserved. o t0_mat3 ? match output 3 of timer 0. p8_4 j2 x - x - [3] i; pu i/o gpio4[4] ? general purpose digi tal input/output pin. i/o usb1_ulpi_d1 ? ulpi link bidirectional data line 1. - r ? function reserved. o lcd_vd7 ? lcd data. o lcd_vd16 ? lcd data. - r ? function reserved. - r ? function reserved. i t0_cap0 ? capture input 0 of timer 0. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 159 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p8_5 j1 x - x - [3] i; pu i/o gpio4[5] ? general purpose digi tal input/output pin. i/o usb1_ulpi_d0 ? ulpi link bidirectional data line 0. - r ? function reserved. o lcd_vd6 ? lcd data. o lcd_vd8 ? lcd data. - r ? function reserved. - r ? function reserved. i t0_cap1 ? capture input 1 of timer 0. p8_6 k3 x - x - [3] i; pu i/o gpio4[6] ? general purpose digi tal input/output pin. i usb1_ulpi_nxt ? ulpi link nxt signal. data flow control signal from the phy. - r ? function reserved. o lcd_vd5 ? lcd data. o lcd_lp ? line synchronization pulse (stn). horizontal synchronization pulse (tft). - r ? function reserved. - r ? function reserved. i t0_cap2 ? capture input 2 of timer 0. p8_7 k1 x - x - [3] i; pu i/o gpio4[7] ? general purpose digi tal input/output pin. o usb1_ulpi_stp ? ulpi link stp signal. asserted to end or interrupt transfers to the phy. - r ? function reserved. o lcd_vd4 ? lcd data. o lcd_pwr ? lcd panel power enable. - r ? function reserved. - r ? function reserved. i t0_cap3 ? capture input 3 of timer 0. p8_8 l1 x - x - [3] i; pu - r ? function reserved. i usb1_ulpi_clk ? ulpi link clk sig nal. 60 mhz clock generated by the phy. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. o cgu_out0 ? cgu spare clock output 0. o i2s1_tx_mclk ? i2s1 transmit master clock. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 160 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p9_0 t1 x - x - [3] i; pu i/o gpio4[12] ? general purpose digital input/output pin. o mcabort ? motor control pwm, low-active fast abort. - r ? function reserved. - r ? function reserved. - r ? function reserved. i enet_crs ? ethernet carrier sense (mii interface). - r ? function reserved. i/o ssp0_ssel ? slave select for ssp0. p9_1 n6 x - x - [3] i; pu i/o gpio4[13] ? general purpose digital input/output pin. o mcoa2 ? motor control pwm channel 2, output a. - r ? function reserved. - r ? function reserved. i/o i2s0_tx_ws ? transmit word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . i enet_rx_er ? ethernet receive error (mii interface). - r ? function reserved. i/o ssp0_miso ? master in slave out for ssp0. p9_2 n8 x - x - [3] i; pu i/o gpio4[14] ? general purpose digital input/output pin. o mcob2 ? motor control pwm channel 2, output b. - r ? function reserved. - r ? function reserved. i/o i2s0_tx_sda ? i2s transmit data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . i enet_rxd3 ? ethernet receive data 3 (mii interface). - r ? function reserved. i/o ssp0_mosi ? master out slave in for ssp0. p9_3 m6 x - x - [3] i; pu i/o gpio4[15] ? general purpose digital input/output pin. o mcoa0 ? motor control pwm channel 0, output a. o usb1_ind1 ? usb1 port indicator led control output 1. - r ? function reserved. - r ? function reserved. i enet_rxd2 ? ethernet receive data 2 (mii interface). - r ? function reserved. o u3_txd ? transmitter output for usart3. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 161 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration p9_4 n10 x - x - [3] i; pu - r ? function reserved. o mcob0 ? motor control pwm channel 0, output b. o usb1_ind0 ? usb1 port indicator led control output 0. - r ? function reserved. i/o gpio5[17] ? general purpose digital input/output pin. o enet_txd2 ? ethernet transmit data 2 (mii interface). - r ? function reserved. i u3_rxd ? receiver input for usart3. p9_5 m9 x - x 69 [3] i; pu - r ? function reserved. o mcoa1 ? motor control pwm channel 1, output a. o usb1_vbus_en ? usb1 vbus power enable. - r ? function reserved. i/o gpio5[18] ? general purpose digital input/output pin. o enet_txd3 ? ethernet transmit data 3 (mii interface). - r ? function reserved. o u0_txd ? transmitter output for usart0. p9_6 l11 x - x 72 [3] i; pu i/o gpio4[11] ? general purpose digital input/output pin. o mcob1 ? motor control pwm channel 1, output b. o usb1_pwr_fault ? usb1 port power fault signal indicating over-current condition; this signal monitors over-current on the usb1 bus (external circuitry required to detect over-current condition). - r ? function reserved. - r ? function reserved. i enet_col ? ethernet collision det ect (mii interface). - r ? function reserved. i u0_rxd ? receiver input for usart0. pa_0 l12 x - x - [3] i; pu - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. o i2s1_rx_mclk ? i2s1 receive master clock. o cgu_out1 ? cgu spare clock output 1. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 162 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pa_1 j14 x - x - [4] i; pu i/o gpio4[8] ? general purpose digi tal input/output pin. i qei_idx ? quadrature encoder interface index input. - r ? function reserved. o u2_txd ? transmitter output for usart2. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. pa_2 k15 x - x - [4] i; pu i/o gpio4[9] ? general purpose digi tal input/output pin. i qei_phb ? quadrature encoder interface phb input. - r ? function reserved. i u2_rxd ? receiver input for usart2. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. pa_3 h11 x - x - [4] i; pu i/o gpio4[10] ? general purpose digital input/output pin. i qei_pha ? quadrature encoder interface pha input. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. pa_4 g13 x - x - [3] i; pu - r ? function reserved. o ctout_9 ? sct output 9. match output 1 of timer 2. - r ? function reserved. i/o emc_a23 ? external memory address line 23. i/o gpio5[19] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 163 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pb_0 b15 x - x - [3] i; pu - r ? function reserved. o ctout_10 ? sct output 10. match output 2 of timer 2. o lcd_vd23 ? lcd data. - r ? function reserved. i/o gpio5[20] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pb_1 a14 x - x - [3] i; pu - r ? function reserved. i usb1_ulpi_dir ? ulpi link dir signal. controls the ulp data line direction. o lcd_vd22 ? lcd data. - r ? function reserved. i/o gpio5[21] ? general purpose digital input/output pin. o ctout_6 ? sct output 6. match output 2 of timer 1. - r ? function reserved. - r ? function reserved. pb_2 b12 x - x - [3] i; pu - r ? function reserved. i/o usb1_ulpi_d7 ? ulpi link bidirectional data line 7. o lcd_vd21 ? lcd data. - r ? function reserved. i/o gpio5[22] ? general purpose digital input/output pin. o ctout_7 ? sct output 7. match output 3 of timer 1. - r ? function reserved. - r ? function reserved. pb_3 a13 x - x - [3] i; pu - r ? function reserved. i/o usb1_ulpi_d6 ? ulpi link bidirectional data line 6. o lcd_vd20 ? lcd data. - r ? function reserved. i/o gpio5[23] ? general purpose digital input/output pin. o ctout_8 ? sct output 8. match output 0 of timer 2. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 164 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pb_4 b11 x - x - [3] i; pu - r ? function reserved. i/o usb1_ulpi_d5 ? ulpi link bidirectional data line 5. o lcd_vd15 ? lcd data. - r ? function reserved. i/o gpio5[24] ? general purpose digital input/output pin. i ctin_5 ? sct input 5. capture input 2 of timer 2. - r ? function reserved. - r ? function reserved. pb_5 a12 x - x - [3] i; pu - r ? function reserved. i/o usb1_ulpi_d4 ? ulpi link bidirectional data line 4. o lcd_vd14 ? lcd data. - r ? function reserved. i/o gpio5[25] ? general purpose digital input/output pin. i ctin_7 ? sct input 7. o lcd_pwr ? lcd panel power enable. - r ? function reserved. pb_6 a6 x - x - [6] i; pu - r ? function reserved. i/o usb1_ulpi_d3 ? ulpi link bidirectional data line 3. o lcd_vd13 ? lcd data. - r ? function reserved. i/o gpio5[26] ? general purpose digital input/output pin. i ctin_6 ? sct input 6. capture input 1 of timer 3. o lcd_vd19 ? lcd data. - r ? function reserved. i adc0_6 ? adc0, input channel 6. pc_0 d4 x - x - [6] i; pu - r ? function reserved. i usb1_ulpi_clk ? ulpi link clk sig nal. 60 mhz clock generated by the phy. - r ? function reserved. i/o enet_rx_clk ? ethernet receive clock (mii interface). o lcd_dclk ? lcd panel clock. - r ? function reserved. - r ? function reserved. i/o sd_clk ? sd/mmc card clock. i adc1_1 ? adc1, input channel 1. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 165 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pc_1 e4 - - x - [3] i; pu i/o usb1_ulpi_d7 ? ulpi link bidirectional data line 7. - r ? function reserved. i u1_ri ? ring indicator input for uart 1. o enet_mdc ? ethernet miim clock. i/o gpio6[0] ? general purpose digi tal input/output pin. - r ? function reserved. i t3_cap0 ? capture input 0 of timer 3. o sd_volt0 ? sd/mmc bus voltage select output 0. pc_2 f6 - - x - [3] i; pu i/o usb1_ulpi_d6 ? ulpi link bidirectional data line 6. - r ? function reserved. i u1_cts ? clear to send input for uart 1. o enet_txd2 ? ethernet transmit data 2 (mii interface). i/o gpio6[1] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. o sd_rst ? sd/mmc reset signal for mmc4.4 card. pc_3 f5 - - x - [6] i; pu i/o usb1_ulpi_d5 ? ulpi link bidirectional data line 5. - r ? function reserved. o u1_rts ? request to send output for uart 1. can also be configured to be an rs-485/eia-485 output enable signal for uart 1. o enet_txd3 ? ethernet transmit data 3 (mii interface). i/o gpio6[2] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. o sd_volt1 ? sd/mmc bus voltage select output 1. i adc1_0 ? adc1, input channel 0. pc_4 f4 - - x - [3] i; pu - r ? function reserved. i/o usb1_ulpi_d4 ? ulpi link bidirectional data line 4. - r ? function reserved. enet_tx_en ? ethernet transmit enable (rmii/mii interface). i/o gpio6[3] ? general purpose digi tal input/output pin. - r ? function reserved. i t3_cap1 ? capture input 1 of timer 3. i/o sd_dat0 ? sd/mmc data bus line 0. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 166 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pc_5 g4 - - x - [3] i; pu - r ? function reserved. i/o usb1_ulpi_d3 ? ulpi link bidirectional data line 3. - r ? function reserved. o enet_tx_er ? ethernet transmit error (mii interface). i/o gpio6[4] ? general purpose digi tal input/output pin. - r ? function reserved. i t3_cap2 ? capture input 2 of timer 3. i/o sd_dat1 ? sd/mmc data bus line 1. pc_6 h6 - - x - [3] i; pu - r ? function reserved. i/o usb1_ulpi_d2 ? ulpi link bidirectional data line 2. - r ? function reserved. i enet_rxd2 ? ethernet receive data 2 (mii interface). i/o gpio6[5] ? general purpose digi tal input/output pin. - r ? function reserved. i t3_cap3 ? capture input 3 of timer 3. i/o sd_dat2 ? sd/mmc data bus line 2. pc_7 g5 - - - - [3] i; pu - r ? function reserved. i/o usb1_ulpi_d1 ? ulpi link bidirectional data line 1. - r ? function reserved. i enet_rxd3 ? ethernet receive data 3 (mii interface). i/o gpio6[6] ? general purpose digi tal input/output pin. - r ? function reserved. o t3_mat0 ? match output 0 of timer 3. i/o sd_dat3 ? sd/mmc data bus line 3. pc_8 n4 - - - - [3] i; pu - r ? function reserved. i/o usb1_ulpi_d0 ? ulpi link bidirectional data line 0. - r ? function reserved. i enet_rx_dv ? ethernet receive data valid (rmii/mii interface). i/o gpio6[7] ? general purpose digi tal input/output pin. - r ? function reserved. o t3_mat1 ? match output 1 of timer 3. i sd_cd ? sd/mmc card detect input. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 167 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pc_9 k2 - - - - [3] i; pu - r ? function reserved. i usb1_ulpi_nxt ? ulpi link nxt signal. data flow control signal from the phy. - r ? function reserved. i enet_rx_er ? ethernet receive error (mii interface). i/o gpio6[8] ? general purpose digi tal input/output pin. - r ? function reserved. o t3_mat2 ? match output 2 of timer 3. o sd_pow ? . pc_10 m5 - - - - [3] i; pu - r ? function reserved. o usb1_ulpi_stp ? ulpi link stp signal. asserted to end or interrupt transfers to the phy. i u1_dsr ? data set ready input for uart 1. - r ? function reserved. i/o gpio6[9] ? general purpose digi tal input/output pin. - r ? function reserved. o t3_mat3 ? match output 3 of timer 3. i/o sd_cmd ? sd/mmc command signal. pc_11 l5 - - - - [3] i; pu - r ? function reserved. i usb1_ulpi_dir ? ulpi link dir signal. controls the ulp data line direction. i u1_dcd ? data carrier detect input for uart 1. - r ? function reserved. i/o gpio6[10] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. i/o sd_dat4 ? sd/mmc data bus line 4. pc_12 l6 - - - - [3] i; pu - r ? function reserved. - r ? function reserved. o u1_dtr ? data terminal ready output for uart 1. can also be configured to be an rs-485/eia-485 output enable signal for uart 1. - r ? function reserved. i/o gpio6[11] ? general purpose digital input/output pin. - r ? function reserved. i/o i2s0_tx_sda ? i2s transmit data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . i/o sd_dat5 ? sd/mmc data bus line 5. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 168 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pc_13 m1 - - - - [3] i; pu - r ? function reserved. - r ? function reserved. o u1_txd ? transmitter output for uart 1. - r ? function reserved. i/o gpio6[12] ? general purpose digital input/output pin. - r ? function reserved. i/o i2s0_tx_ws ? transmit word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . i/o sd_dat6 ? sd/mmc data bus line 6. pc_14 n1 - - - - [3] i; pu - r ? function reserved. - r ? function reserved. i u1_rxd ? receiver input for uart 1. - r ? function reserved. i/o gpio6[13] ? general purpose digital input/output pin. - r ? function reserved. o enet_tx_er ? ethernet transmit error (mii interface). i/o sd_dat7 ? sd/mmc data bus line 7. pd_0 n2 - - - - [3] i; pu - r ? function reserved. o ctout_15 ? sct output 15. match output 3 of timer 3. o emc_dqmout2 ? data mask 2 used with sdram and static devices. - r ? function reserved. i/o gpio6[14] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pd_1 p1 - - - - [3] i; pu - r ? function reserved. - r ? function reserved. o emc_ckeout2 ? sdram clock enable 2. - r ? function reserved. i/o gpio6[15] ? general purpose digital input/output pin. o sd_pow ? . - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 169 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pd_2 r1 - - - - [3] i; pu - r ? function reserved. o ctout_7 ? sct output 7. match output 3 of timer 1. i/o emc_d16 ? external memory data line 16. - r ? function reserved. i/o gpio6[16] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pd_3 p4 - - - - [3] i; pu - r ? function reserved. o ctout_6 ? sct output 7. match output 2 of timer 1. i/o emc_d17 ? external memory data line 17. - r ? function reserved. i/o gpio6[17] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pd_4 t2 - - - - [3] i; pu - r ? function reserved. o ctout_8 ? sct output 8. match output 0 of timer 2. i/o emc_d18 ? external memory data line 18. - r ? function reserved. i/o gpio6[18] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pd_5 p6 - - - - [3] i; pu - r ? function reserved. o ctout_9 ? sct output 9. match output 1 of timer 2. i/o emc_d19 ? external memory data line 19. - r ? function reserved. i/o gpio6[19] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 170 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pd_6 r6 - - x - [3] i; pu - r ? function reserved. o ctout_10 ? sct output 10. match output 2 of timer 2. i/o emc_d20 ? external memory data line 20. - r ? function reserved. i/o gpio6[20] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pd_7 t6 - - x - [3] i; pu - r ? function reserved. i ctin_5 ? sct input 5. capture input 2 of timer 2. i/o emc_d21 ? external memory data line 21. - r ? function reserved. i/o gpio6[21] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pd_8 p8 - - x - [3] i; pu - r ? function reserved. i ctin_6 ? sct input 6. capture input 1 of timer 3. i/o emc_d22 ? external memory data line 22. - r ? function reserved. i/o gpio6[22] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pd_9 t11 - - x - [3] i; pu - r ? function reserved. o ctout_13 ? sct output 13. match output 1 of timer 3. i/o emc_d23 ? external memory data line 23. - r ? function reserved. i/o gpio6[23] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 171 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pd_10 p11 - - x - [3] i; pu - r ? function reserved. i ctin_1 ? sct input 1. capture input 1 of timer 0. capture input 1 of timer 2. o emc_bls3 ? low active byte lane select signal 3. - r ? function reserved. i/o gpio6[24] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pd_11 n9 x - x - [3] i; pu - r ? function reserved. - r ? function reserved. o emc_cs3 ? low active chip select 3 signal. - r ? function reserved. i/o gpio6[25] ? general purpose digital input/output pin. i/o usb1_ulpi_d0 ? ulpi link bidirectional data line 0. o ctout_14 ? sct output 14. match output 2 of timer 3. - r ? function reserved. pd_12 n11 x - x - [3] i; pu - r ? function reserved. - r ? function reserved. o emc_cs2 ? low active chip select 2 signal. - r ? function reserved. i/o gpio6[26] ? general purpose digital input/output pin. - r ? function reserved. o ctout_10 ? sct output 10. match output 2 of timer 2. - r ? function reserved. pd_13 t14 x - - - [3] i; pu - r ? function reserved. i ctin_0 ? sct input 0. capture inpu t 0 of timer 0, 1, 2, 3. o emc_bls2 ? low active byte lane select signal 2. - r ? function reserved. i/o gpio6[27] ? general purpose digital input/output pin. - r ? function reserved. o ctout_13 ? sct output 13. match output 1 of timer 3. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 172 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pd_14 r13 x - x - [3] i; pu - r ? function reserved. - r ? function reserved. o emc_dycs2 ? sdram chip select 2. - r ? function reserved. i/o gpio6[28] ? general purpose digital input/output pin. - r ? function reserved. o ctout_11 ? sct output 11. match output 3 of timer 2. - r ? function reserved. pd_15 t15 x - x - [3] i; pu - r ? function reserved. - r ? function reserved. i/o emc_a17 ? external memory address line 17. - r ? function reserved. i/o gpio6[29] ? general purpose digital input/output pin. i sd_wp ? sd/mmc card write protect input. o ctout_8 ? sct output 8. match output 0 of timer 2. - r ? function reserved. pd_16 r14 x - x - [3] i; pu - r ? function reserved. - r ? function reserved. i/o emc_a16 ? external memory address line 16. - r ? function reserved. i/o gpio6[30] ? general purpose digital input/output pin. o sd_volt2 ? sd/mmc bus voltage select output 2. o ctout_12 ? sct output 12. match output 0 of timer 3. - r ? function reserved. pe_0 p14 x - x - [3] i; pu - r ? function reserved. - r ? function reserved. - r ? function reserved. i/o emc_a18 ? external memory address line 18. i/o gpio7[0] ? general purpose digi tal input/output pin. o can1_td ? can1 transmitter output. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 173 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pe_1 n14 x - x - [3] i; pu - r ? function reserved. - r ? function reserved. - r ? function reserved. i/o emc_a19 ? external memory address line 19. i/o gpio7[1] ? general purpose digi tal input/output pin. i can1_rd ? can1 receiver input. - r ? function reserved. - r ? function reserved. pe_2 m14 x - x - [3] i; pu i adctrig0 ? adc trigger input 0. i can0_rd ? can receiver input. - r ? function reserved. i/o emc_a20 ? external memory address line 20. i/o gpio7[2] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pe_3 k12 x - x - [3] i; pu - r ? function reserved. o can0_td ? can transmitter output. i adctrig1 ? adc trigger input 1. i/o emc_a21 ? external memory address line 21. i/o gpio7[3] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pe_4 k13 x - x - [3] i; pu - r ? function reserved. i nmi ? external interrupt input to nmi. - r ? function reserved. i/o emc_a22 ? external memory address line 22. i/o gpio7[4] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 174 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pe_5 n16 - - x - [3] i; pu - r ? function reserved. o ctout_3 ? sct output 3. match output 3 of timer 0. o u1_rts ? request to send output for uart 1. can also be configured to be an rs-485/eia-485 output enable signal for uart 1. i/o emc_d24 ? external memory data line 24. i/o gpio7[5] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pe_6 m16 - - x - [3] i; pu - r ? function reserved. o ctout_2 ? sct output 2. match output 2 of timer 0. i u1_ri ? ring indicator input for uart 1. i/o emc_d25 ? external memory data line 25. i/o gpio7[6] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pe_7 f15 - - x - [3] i; pu - r ? function reserved. o ctout_5 ? sct output 5. match output 1 of timer 1. i u1_cts ? clear to send input for uart1. i/o emc_d26 ? external memory data line 26. i/o gpio7[7] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pe_8 f14 - - x - [3] i; pu - r ? function reserved. o ctout_4 ? sct output 4. match output 0 of timer 0. i u1_dsr ? data set ready input for uart 1. i/o emc_d27 ? external memory data line 27. i/o gpio7[8] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 175 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pe_9 e16 - - x - [3] i; pu - r ? function reserved. i ctin_4 ? sct input 4. capture input 2 of timer 1. i u1_dcd ? data carrier detect input for uart 1. i/o emc_d28 ? external memory data line 28. i/o gpio7[9] ? general purpose digi tal input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pe_10 e14 - - x - [3] i; pu - r ? function reserved. i ctin_3 ? sct input 3. capture input 1 of timer 1. o u1_dtr ? data terminal ready output for uart 1. can also be configured to be an rs-485/eia-485 output enable signal for uart 1. i/o emc_d29 ? external memory data line 29. i/o gpio7[10] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pe_11 d16 - - - - [3] i; pu - r ? function reserved. o ctout_12 ? sct output 12. match output 0 of timer 3. o u1_txd ? transmitter output for uart 1. i/o emc_d30 ? external memory data line 30. i/o gpio7[11] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pe_12 d15 - - - - [3] i; pu - r ? function reserved. o ctout_11 ? sct output 11. match output 3 of timer 2. i u1_rxd ? receiver input for uart 1. i/o emc_d31 ? external memory data line 31. i/o gpio7[12] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 176 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pe_13 g14 - - - - [3] i; pu - r ? function reserved. o ctout_14 ? sct output 14. match output 2 of timer 3. i/o i2c1_sda ? i 2 c1 data input/output (this pin does not use a specialized i 2 c pad). o emc_dqmout3 ? data mask 3 used with sdram and static devices. i/o gpio7[13] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pe_14 c15 - - - - [3] i; pu - r ? function reserved. - r ? function reserved. - r ? function reserved. o emc_dycs3 ? sdram chip select 3. i/o gpio7[14] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pe_15 e13 - - - - [3] i; pu - r ? function reserved. o ctout_0 ? sct output 0. match output 0 of timer 0. i/o i2c1_scl ? i 2 c1 clock input/output (this pin does not use a specialized i 2 c pad). o emc_ckeout3 ? sdram clock enable 3. i/o gpio7[15] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pf_0 d12 - - - - [3] i;ia i/o ssp0_sck ? serial clock for ssp0. i gp_clkin ? general purpose clock input to the cgu. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. - r ? function reserved. o i2s1_tx_mclk ? i2s1 transmit master clock. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 177 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pf_1 e11 - - - - [3] i; pu - r ? function reserved. - r ? function reserved. i/o ssp0_ssel ? slave select for ssp0. - r ? function reserved. i/o gpio7[16] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pf_2 d11 - - x - [3] i; pu - r ? function reserved. o u3_txd ? transmitter output for usart3. i/o ssp0_miso ? master in slave out for ssp0. - r ? function reserved. i/o gpio7[17] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pf_3 e10 - - x - [3] i; pu - r ? function reserved. i u3_rxd ? receiver input for usart3. i/o ssp0_mosi ? master out slave in for ssp0. - r ? function reserved. i/o gpio7[18] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. pf_4 d10 x x x 120 [3] i;ia i/o ssp1_sck ? serial clock for ssp1. i gp_clkin ? general purpose clock input to the cgu. o traceclk ? trace clock. - r ? function reserved. - r ? function reserved. - r ? function reserved. o i2s0_tx_mclk ? i2s transmit master clock. i/o i2s0_rx_sck ? i2s transmit clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification . table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 178 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pf_5 e9 - - x - [6] i; pu - r ? function reserved. i/o u3_uclk ? serial clock input/output for usart3 in synchronous mode. i/o ssp1_ssel ? slave select for ssp1. o tracedata[0] ? trace data, bit 0. i/o gpio7[19] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. i adc1_4 ? adc1, input channel 4. pf_6 e7 - - x - [6] i; pu - r ? function reserved. i/o u3_dir ? rs-485/eia-485 output enable/direction control for usart3. i/o ssp1_miso ? master in slave out for ssp1. o tracedata[1] ? trace data, bit 1. i/o gpio7[20] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. i/o i2s1_tx_sda ? i2s1 transmit data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . i adc1_3 ? adc1, input channel 3. pf_7 b7 - - x - [6] i; pu - r ? function reserved. i/o u3_baud ? for usart3. i/o ssp1_mosi ? master out slave in for ssp1. o tracedata[2] ? trace data, bit 2. i/o gpio7[21] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. i/o i2s1_tx_ws ? transmit word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . i/o adc1_7 ? adc1, input channel 7 or band gap output. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 179 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration pf_8 e6 - - x - [6] i; pu - r ? function reserved. i/o u0_uclk ? serial clock input/output for usart0 in synchronous mode. i ctin_2 ? sct input 2. capture input 2 of timer 0. o tracedata[3] ? trace data, bit 3. i/o gpio7[22] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. i adc0_2 ? adc0, input channel 2. pf_9 d6 - - x - [6] i; pu - r ? function reserved. i/o u0_dir ? rs-485/eia-485 output enable/direction control for usart0. o ctout_1 ? sct output 1. match output 1 of timer 0. - r ? function reserved. i/o gpio7[23] ? general purpose digital input/output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. i adc1_2 ? adc1, input channel 2. pf_10 a3 - - x - [6] i; pu - r ? function reserved. o u0_txd ? transmitter output for usart0. - r ? function reserved. - r ? function reserved. i/o gpio7[24] ? general purpose digital input/output pin. - r ? function reserved. i sd_wp ? sd/mmc card write protect input. - r ? function reserved. i adc0_5 ? adc0, input channel 5. pf_11 a2 - - x - [6] i; pu - r ? function reserved. i u0_rxd ? receiver input for usart0. - r ? function reserved. - r ? function reserved. i/o gpio7[25] ? general purpose digital input/output pin. - r ? function reserved. o sd_volt2 ? sd/mmc bus voltage select output 2. - r ? function reserved. i adc1_5 ? adc1, input channel 5. clock pins table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 180 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration clk0 n5 x x x 45 [5] o; pu o emc_clk0 ? sdram clock 0. o clkout ? clock output pin. - r ? function reserved. - r ? function reserved. i/o sd_clk ? sd/mmc card clock. o emc_clk01 ? sdram clock 0 and clock 1 combined. i/o ssp1_sck ? serial clock for ssp1. i enet_tx_clk (enet_ref_clk) ? ethernet transmit clock (mii interface) or et hernet reference clock (rmii interface). clk1 t10 x - - - [5] o; pu o emc_clk1 ? sdram clock 1. o clkout ? clock output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. o cgu_out0 ? cgu spare clock output 0. - r ? function reserved. o i2s1_tx_mclk ? i2s1 transmit master clock. clk2 d14 x x x 99 [5] o; pu o emc_clk3 ? sdram clock 3. o clkout ? clock output pin. - r ? function reserved. - r ? function reserved. i/o sd_clk ? sd/mmc card clock. o emc_clk23 ? sdram clock 2 and clock 3 combined. o i2s0_tx_mclk ? i2s transmit master clock. i/o i2s1_rx_sck ? receive clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification. clk3 p12 x - - - [5] o; pu o emc_clk2 ? sdram clock 2. o clkout ? clock output pin. - r ? function reserved. - r ? function reserved. - r ? function reserved. o cgu_out1 ? cgu spare clock output 1. - r ? function reserved. i/o i2s1_rx_sck ? receive clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification. debug pins table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 181 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration dbgen l4 x x x 28 [3] i; pd i jtag interface control signal. also used for boundary scan. tck/swdclk j5 x x x 27 [3] i; f i test clock for jtag interface (default) or serial wire (sw) clock. trst m4 x x x 29 [3] i; pu i test reset for jtag interface. tms/swdio k6 x x x 30 [3] i; pu i test mode select for jtag interface (default) or sw debug data input/output. tdo/swo k5 x x x 31 [3] o; pu o test data out for jtag interface (default) or sw trace output. tdi j4 x x x 26 [3] i; pu i test data in for jtag interface. usb0 pins usb0_dp f2 x x x 18 [7] - i/o usb0 bidirectional d+ line. usb0_dm g2 x x x 20 [7] - i/o usb0 bidirectional d ? line. usb0_vbus f1 x x x 21 [7] - i/o vbus pin (power on usb cable). usb0_id h2 x x x 22 [8] - i indicates to the transceiver whether connected to an a-device (low) or a b-device (high). usb0_rref h1 x x x 24 [8] -12.0 k ? (accuracy 1%) on-board resistor to ground for current reference. usb1 pins usb1_dp f12 x x x 89 [9] - i/o usb1 bidirectional d+ line. usb1_dm g12 x x x 90 [9] - i/o usb1 bidirectional d ? line. i 2 c-bus pins i2c0_scl l15 x x x 92 [10] i; f i/o i 2 c clock input/output. open-drain output (for i 2 c-bus compliance). i2c0_sda l16 x x x 93 [10] i; f i/o i 2 c data input/output. open- drain output (for i 2 c-bus compliance). reset and wake-up pins reset d9 x x x 128 [11] i; ia i external reset input: a low on this pin resets the device, causing i/o ports and peripherals to take on their default states, and processor execution to begin at address 0. wakeup0 a9 x x x 130 [11] i; ia i external wake-up input; can raise an interrupt and can cause wake-up from any of the low power modes. wakeup1 a10 x - - - [11] i; ia i external wake-up input; can raise an interrupt and can cause wake-up from any of the low power modes. wakeup2 c9 x - - - [11] i; ia i external wake-up input; can raise an interrupt and can cause wake-up from any of the low power modes. wakeup3 d8 x - - - [11] i; ia i external wake-up input; can raise an interrupt and can cause wake-up from any of the low power modes. adc pins adc0_0/ adc1_0/dac e3 x x x 6 [8] i; ia i adc input channel 0. shared between 10-bit adc0/1 and dac. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 182 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration adc0_1/ adc1_1 c3 x x x 2 [8] i; ia i adc input channel 1. shared between 10-bit adc0/1. adc0_2/ adc1_2 a4 x x x 143 [8] i; ia i adc input channel 2. shared between 10-bit adc0/1. adc0_3/ adc1_3 b5 x x x 139 [8] i; ia i adc input channel 3. shared between 10-bit adc0/1. adc0_4/ adc1_4 c6 x - x 138 [8] i; ia i adc input channel 4. shared between 10-bit adc0/1. adc0_5/ adc1_5 b3 x - x 144 [8] i; ia i adc input channel 5. shared between 10-bit adc0/1. adc0_6/ adc1_6 a5 x - x 142 [8] i; ia i adc input channel 6. shared between 10-bit adc0/1. adc0_7/ adc1_7 c5 x - x 136 [8] i; ia i adc input channel 7. shared between 10-bit adc0/1. rtc rtc_alarm a11 x x x 129 [11] - o rtc controlled output. rtcx1 a8 x x x 125 [8] - i input to the rtc 32 khz ultra-low power oscillator circuit. rtcx2 b8 x x x 126 [8] - o output from the rtc 32 khz ultra-low power oscillator circuit. crystal oscillator pins xtal1 d1 x x x 12 [8] - i input to the oscillator circuit and internal clock generator circuits. xtal2 e1 x x x 13 [8] - o output from the oscillator amplifier. power and ground pins usb0_vdda 3v3_driver f3 x x x 16 - - separate analog 3.3 v power supply for driver. usb0 _vdda3v3 g3 x x x 17 - - usb 3.3 v separate power supply voltage. usb0_vssa _term h3 x x x 19 - - dedicated analog ground for clean reference for termination resistors. usb0_vssa _ref g1 x x x 23 - - dedicated clean analog ground for generation of reference currents and voltages. vdda b4 x x x 137 - - analog power supply and adc reference voltage. vbat b10 x x x 127 - - rtc power supply: 3.3 v on this pin supplies power to the rtc. vddreg f10, f9, l8, l7 x x x 94, 131, 59, 25 - main regulator power supply. vpp e8 x x x x - - otp programming voltage. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 183 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration [1] x = available; - = not pinned out. [2] i = input, o = output, ia = inactive; pu = pull- up enabled (weak pull-up resistor pulls up pin to v dd(io) ); f = floating [3] 5 v tolerant pad with 15 ns glitch filter; provides digita l i/o functions with ttl levels and hysteresis; normal drive stren gth. [4] 5 v tolerant pad with 15 ns glitch filter providing digita l i/o functions with ttl levels , and hysteresis; high drive streng th. [5] 5 v tolerant pad with 15 ns glitch filter providing hi gh-speed digital i/o functions wi th ttl levels and hysteresis. [6] 5 v tolerant pad providing digital i/o functions (with ttl levels and hysteresis) and analog input or output. when configure d as a adc input or dac output, the pin is not 5 v tolerant and the digital se ction of the pad must be disabled by setting the pin to an i nput function and disabling the pull-up resistor through the pin?s sfsp register. [7] 5 v tolerant transparent analog pad. [8] transparent analog pad. not 5 v tolerant. [9] pad provides usb functions. it is designed in accordance with the usb specification, revision 2.0 (full-speed and low-speed mode only). this pad is not 5 v tolerant. vddio d7, e12, f7, f8, g10, h10, j6, j7, k7, l9, l10, n7, n13 xxx5, 36, 41, 71, 77, 107, 111, 141 - - i/o power supply. vss g9, h7, j10, j11, k8 xxx- [12] - - ground. vssio c4, d13, g6, g7, g8, h8, h9, j8, j9, k9, k10, m13, p7, p13 xxx4, 40, 76, 109 [12] - - ground. vssa b2 x x x 135 - - analog ground. not connected -b9 --n.c. table 107. pin description ?continued symbol lbga256 bga180 [1] bga100 [1] lqfp208 [1] lqfp144 reset state [2] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 184 of 1164 nxp semiconductors UM10430 chapter 12: lpc18xx pin configuration [10] open-drain 5 v tolerant digital i/o pad, compatible with i2c-bus 400 khz specification. th is pad requires an external pull- up to provide output functionality. when power is switched off, this pin connec ted to the i2c-bus is floating and does not disturb the i2c li nes. open-drain configuration applies to all functions on this pin. [11] 5 v tolerant pad with 20 ns glitch filter; provides digita l i/o functions with open-drain output with weak pull-up resistor and hysteresis. [12] for the lqfp144 package, vssio and vss are connected to a common ground plane. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 185 of 1164 13.1 how to read this chapter remark: this chapter describes parts lpc1850/30/20/10 rev ?a? and parts lpc18xx (with on-chip flash). for a description of t he scu for parts lpc1850/30/20/10 rev ?-?, see section 42.7 . the following peripherals are not available on all parts, and the corresponding bit values that select those functions in the sfsp registers are reserved: ? ethernet: available on lpc1850/30. ? usb0: available on lpc1850/30/20. ? usb1: available on lpc1850/30. 13.2 basic configuration the scu is configured as follows: ? see ta b l e 1 0 8 for clocking and power control. ? the scu is reset by the scu_rst (reset # 9). 13.3 general description the system control unit determines the function and electrical mode of the digital pins. by default function 0 is selected for all pins with pull-up enabled. remark: analog i/os for the adcs and the dac as well as several usb functions reside on separate pins and are not controlled through the scu. 13.3.1 digital pin function the func bits in the sfsx_y registers control the function of each pi n. if the function is gpio, the gpiondir registers determine whet her the pin is configured as an input or output (see ta b l e 2 8 0 ). for any peripheral function, the pin direction is controlled automatically depending on the pin?s functionalit y. the gpiondir registers have no effect for peripheral functions. 13.3.2 digital pin mode the mode bits in the sfsx_y registers allow the selection of on-chip pull-up or pull-down resistors for each pin or select the repeater mode. UM10430 chapter 13: lpc18xx system control unit (scu) rev. 00.13 ? 20 july 2011 user manual table 108. scu clocking and power control base clock branch clock maximum frequency clock to scu register interf ace base_m3_clk clk_m3_scu 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 186 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) the possible on-chip resistor configurations are pull-up enabled, pull-down enabled, or no pull-up/pull-down. the default value is pull-up enabled. the repeater mode enables the pull-up resistor if the pin is at a logic high and enables the pull-down resistor if the pin is at a logic low. this causes the pin to retain its last known state if it is configured as an input and is not driven externally. repeater mode may typically be used to prevent a pin from floating (and potentially using significant power if it floats to an indeterminate state) if it is temporarily not driven. 13.3.3 i 2 c0-bus pins the ehs bits of the sfsi2c0 register ( ta b l e 1 2 0 ) configure different i 2 c-modes: ? standard mode/fast-mode i 2 c (this includes an open-drai n output according to the i 2 c-bus specification). ? fast-mode plus and high-speed mode (this includes an open-drain output according to the i 2 c-bus specification). 13.3.4 usb1 dp1/dm1 pins the input signal to the usb1 is controlled by the sfsusb register ( ta b l e 11 9 ). the usb_esea bit in this register must be set to one to enabl e the usb1 block. 13.3.5 emc signal delay control the scu contains a programmable delay control for all emc input and output data, address, and control signals. for detail on use of the emc delay modes, see ta b l e 2 7 1 . www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 187 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.3.6 pin multiplexing table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 p0_0 l3 x x x 32 gpio0[0] ssp1_ miso enet_ rxd1 r r r i2s0_ tx_ws i2s1_ tx_ws - table 111 p0_1 m2 x x x 34 gpio0[1] ssp1_ mosi enet_ col r rrenet_ tx_en i2s1_ tx_sda - table 111 p1_0 p2 x x x 38 gpio0[4] ctin_3 emc_a5 r r ssp0_ ssel rr- table 111 p1_1 r2 x x x 42 gpio0[8] ctout_7 emc_a6 r r ssp0_ miso rr- table 111 p1_2 r3 x x x 43 gpio0[9] ctout_6 emc_a7 r r ssp0_ mosi rr- table 111 p1_3 p5 x x x 44 gpio0[10] ctout_8 r emc_oe usb0_ ind1 ssp1_ miso r sd_rst - table 111 p1_4 t3 x x x 47 gpio0[11] ctout_9 r emc_bls0 usb0_ ind0 ssp1_ mosi rsd_ volt1 - table 111 p1_5 r5 x x x 48 gpio1[8] ctout_10 r emc_cs0 usb0_ pwr_ fault ssp1_ ssel rsd_pow- table 111 p1_6 t4 x x x 49 gpio1[9] ctin_5 r emc_we r r r sd_cmd table 111 p1_7 t5 x x x 50 gpio1[0] u1_dsr ctout_13 emc_d0 usb0_ pwr_en rr r table 111 p1_8 r7 x x x 51 gpio1[1] u1_dtr ctout_12 emc_d1 r r r sd_ volt0 - table 111 p1_9 t7 x x x 52 gpio1[2] u1_rts ctout_11 emc_d2 r r r sd_d0 - table 111 p1_10 r8 x x x 53 gpio1[3] u1_ri ctout_14 emc_d3 r r r sd_d1 - table 111 p1_11 t9 x x x 55 gpio1[4] u1_cts ctout_15 emc_d4 r r r sd_d2 - table 111 p1_12 r9 x x x 56 gpio1[5] u1_dcd r emc_d5 t0_cap1 r r sd_d3 - table 111 p1_13 r10 x x x 60 gpio1[6] u1_txd r emc_d6 t0_cap0 r r sd_cd - table 111 p1_14 r11 x x x 61 gpio1[7] u1_rxd r emc_ d7 t0_mat2 r r r - table 111 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 188 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) p1_15 t12 x x x 62 gpio0[2] u2_txd r enet_ rxd0 t0_mat1 r r r - table 111 p1_16 m7 x x x 64 gpio0[3] u2_rxd r enet_ crs t0_mat0 r r enet_ rx_dv - table 111 p1_17 m8 x x x 66 gpio0[12] u2_uclk r enet_ mdio t0_cap3 can1_td r r - ta b l e 11 2 p1_18 n12 x x x 67 gpio0[13] u2_dir r enet_ txd0 t0_mat3 can1_rd r r - table 111 p1_19 m11 x x x 68 enet_ tx_clk (enet_r ef_clk) ssp1_sck r r clkout r i2s0_rx_ mclk i2s1_tx_ sck - table 111 p1_20 m10 x x x 70 gpio0[15] ssp1_ ssel renet_ txd1 t0_cap2rr r- table 111 p2_0 t16 x x x 75 r u0_txd emc_a13 usb0_ pwr_en gpio5[0] r t3_cap0 enet_ mdc - table 111 p2_1 n15 x x x 81 r u0_rxd emc_a12 usb0_ pwr_ fault gpio5[1] r t3_cap1 r - table 111 p2_2 m15 x x x 84 r u0_uclk emc_a11 usb0_ ind1 gpio5[2] ctout_6 t3_cap2 r - table 111 p2_3 j12 x x x 87 r i2c1_sda u3_txd ctin_1 gpio5[3] r t3_mat0 usb0_ pwr_en - ta b l e 11 2 p2_4 k11 x x x 88 r i2c1_scl u3_rxd ctin_0 gpio5[4] r t3_mat1 usb0_ pwr_ fault - ta b l e 11 2 p2_5 k14 x x x 91 r ctin_2 usb1_ vbus adctrig1 gpio5[5] r t3_mat2 usb0_ ind0 ta b l e 11 2 p2_6 k16 x x x 95 r u0_dir emc_a10 usb0_ ind0 gpio5[6] ctin_7 t3_cap3 r - table 111 p2_7 h14 x x x 96 gpio0[7] ctout_1 u3_uclk emc_a9 r r t3_mat3 r - table 111 p2_8 j16 x x x 98 boot pin ctout_0 u3_dir emc_a8 gpio5[7] r r r - table 111 table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 189 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) p2_9 h16 x x x 102 gpio1[10] ctout_3 u3_baud emc_a0 r r r r - table 111 p2_10 g16 x x x 104 gpio0[14] ctout_2 u2_txd emc_a1 r r r r - table 111 p2_11 f16 x x x 105 gpio1[11] ctout_5 u2_rxd emc_a2 r r r r - table 111 p2_12 e15 x x x 106 gpio1[12] ct out_4 r emc_a3 r r r u2_uclk - table 111 p2_13 c16 x x x 108 gpio1[13] ctin_4 r emc_a4 r r r u2_dir - table 111 p3_0 f13 x x x 112 i2s0_rx_ sck i2s0_rx_ mclk i2s0_tx_ sck i2s0_tx_ mclk ssp0_ sck rr r- table 111 p3_1 g11 x x x 114 i2s0_tx_ ws i2s0_rx_ ws can0_rd usb1_ ind1 gpio5[8] r lcd_vd15 r - table 111 p3_2 f11 x x x 116 i2s0_tx_ sda i2s0_rx_ sda can0_td usb1_ ind0 gpio5[9] r lcd_vd14 r - table 111 p3_3 b14 x x x 118 r r ssp0_sck spifi_sck cgu_ out1 r i2s0_tx_ mclk i2s1_tx_ sck - table 111 p3_4 a15 x x x 119 gpio1[14] r r spifi_ sio3 u1_txd i2s0_tx_ ws i2s1_rx_ sda lcd__vd 13 - table 111 p3_5 c12 x x x 121 gpio1[15] r r spifi_ sio2 u1_rxd i2s0_tx_ sda i2s1_rx_ ws lcd_vd1 2 - table 111 p3_6 b13 x x x 122 gpio0[6] r ssp0_ ssel spifi_ miso r ssp0_ miso rr- table 111 p3_7 c11 x x x 123 r r ssp0_ miso spifi_ mosi gpio5[10] ssp0_ mosi rr- table 111 p3_8 c10 x x x 124 r r ssp0_ mosi spifi_cs gpio5[11] ssp0_ ssel rr- table 111 p4_0 d5 x - x 1 gpio2[0] mcoa0 nmi r r lcd_ vd13 u3_uclk r - table 111 p4_1 a1 x - x 3 gpio2[1] ctout_1 lcd_vd0 r r lcd_ vd19 u3_txd enet_ col adc0_1 table 111 t able 114 p4_2 d3 x - x 8 gpio2[2] ctout_0 lcd_vd3 r r lcd_ vd12 u3_rxd r - table 111 p4_3 c2 x - x 7 gpio2[3] ctout_3 lcd_vd2 r r lcd_ vd21 u3_baud r adc0_0 table 111 t able 114 table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 190 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) p4_4 b1 x - x 9 gpio2[4] ctout_2 lcd_vd1 r r lcd_vd2 0 u3_dir r dac table 111 t able 118 p4_5 d2 x - x 10 gpio2[5] ctout_5 lcd_fp r r r r r - table 111 p4_6 c1 x - x 11 gpio2[6] ctout_4 lcd_enab /lcd_m r rrr r- table 111 p4_7 h4 x - x 14 lcd_dcl k gp_clkin r r r r i2s1_tx_s ck i2s0_tx_ sck - table 111 p4_8 e2 x - x 15 r ctin_5 lcd_vd9 r gpio5[12] lcd_ vd22 can1_td r - table 111 p4_9 l2 x - x 33 r ctin_6 lcd_vd11 r gpio5[13] lcd_ vd15 can1_rd r - table 111 p4_10 m3 x - x 35 r ctin_2 lcd_vd10 r gpio5[14] lcd_ vd14 rr- table 111 p5_0 n3 x - x 37 gpio2[9] mcob2 emcemc_ d12 r u1_dsr t1_cap0 r r - table 111 p5_1 p3 x - x 39 gpio2[10] mci2 emc_d13 r u1_dtr t1_cap1 r r - table 111 p5_2 r4 x - x 46 gpio2[11] mci1 emc_d14 r u1_rts t1_cap2 r r - table 111 p5_3 t8 x - x 54 gpio2[12] mci0 emc_d15 r u1_ri t1_cap3 r r - table 111 p5_4 p9 x - x 57 gpio2[13] mcob0 emc_d8 r u1_cts t1_mat0 r r - table 111 p5_5 p10 x - x 58 gpio2[14] mcoa1 emc_d9 r u1_dcd t1_mat1 r r - table 111 p5_6 t13 x - x 63 gpio2[15] mcob1 emc_d10 r u1_txd t1_mat2 r r table 111 p5_7 r12 x - x 65 gpio2[7] mcoa2 emc_d11 r u1_rxd t1_mat3 r r - table 111 p6_0 m12 x x x 73 r i2s0_rx_ mclk r r i2s0_rx_ sck rr r- table 111 p6_1 r15 x x x 74 gpio3[0] emc_ dycs1 u0_uclk i2s0_rx_ ws r t2_cap0 r r - table 111 p6_2 l13 x x x 78 gpio3[1] emc_ ckeout1 u0_dir i2s0_rx_ sda r t2_cap1 r r - table 111 p6_3 p15 x - x 79 gpio3[2] usb0_ pwr_en remc_ cs1 r t2_cap2 r r - table 111 p6_4 r16 x x x 80 gpio3[3] ctin_6 u0_txd emc_cas r r r r - table 111 table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 191 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) p6_5 p16 x x x 82 gpio3[4] ctout_6 u0_rxd emc_ras r r r r - table 111 p6_6 l14 x - x 83 gpio0[5] emc_ bls1 r usb0_ pwr_ fault r t2_cap3 r r - table 111 p6_7 j13 x - x 85 r emc_a15 r usb0_ ind1 gpio5[15] t2_mat0 r r - table 111 p6_8 h13 x - x 86 r emc_a14 r usb0_ ind0 gpio5[16] t2_mat1 r r - table 111 p6_9 j15 x x x 97 gpio3[5] r r emc_ dycs0 rt2_mat2r r- table 111 p6_10 h15 x - x 100 gpio3[6] mcabort r emc_ dqmout1 rrr r- table 111 p6_11 h12 x x x 101 gpio3[7] r r emc_ ckeout0 rt2_mat3r r- table 111 p6_12 g15 x - x 103 gpio2[8] ctout_7 r emc_ dqmout0 rrr r- table 111 p7_0 b16 x - x 110 gpio3[8] ctout_14 r lcd_le r r r r - table 111 p7_1 c14 x - x 113 gpio3[9] ctout_15 i2s0_tx_ ws lcd_vd19 lcd_vd7 r u2_txd r - table 111 p7_2 a16 x - x 113 gpio3[10] ctin_4 i2s0_tx_ sda lcd_vd18 lcd_vd6 r u2_rxd r - table 111 p7_3 c13 x - x 117 gpio3[11] ctin_3 r lcd_vd17 lcd_vd5 r r r - table 111 p7_4 c8 x - x 132 gpio3[12] ctout_13 r lcd_vd16 lcd_vd4 trace data[0] r r adc0_4 table 111 t able 114 p7_5 a7 x - x 133 gpio3[13] ctout_12 r lcd_vd8 lcd_ vd23 trace data[1] r r adc0_3 table 111 t able 114 p7_6 c7 x - x 134 gpio3[14] ctout_11 r lcd_lp r trace data[2] rr- table 111 p7_7 b6 x - x 140 gpio3[15] ctout_8 r lcd_pwr r trace data[3] enet_ mdc r adc1_6 table 111 t able 116 table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 192 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) p8_0 e5 x - x - gpio4[0] usb0_ pwr_ fault r mci2rrr t0_mat0- ta b l e 11 2 p8_1 h5 x - x - gpio4[1] usb0_ ind1 r mci1rrr t0_mat1- ta b l e 11 2 p8_2 k4 x - x - gpio4[2] usb0_ ind0 r mci0rrr t0_mat2- ta b l e 11 2 p8_3 j3 x - x - gpio4[3] usb1_ ulpi_d2 r lcd_vd12 lcd_ vd19 r r t0_mat3 - table 111 p8_4 j2 x - x - gpio4[4] usb1_ ulpi_d1 r lcd_vd7 lcd_ vd16 r r t0_cap0 - table 111 p8_5 j1 x - x - gpio4[5] usb1_ ulpi_d0 r lcd_vd6 lcd_vd8 r r t0_cap1 - table 111 p8_6 k3 x - x - gpio4[6] usb1_ ulpi_nxt r lcd_vd5 lcd_lp r r t0_cap2 - table 111 p8_7 k1 x - x - gpio4[7] usb1_ ulpi_stp r lcd_vd4 lcd_ pwr r r t0_cap3 - table 111 p8_8 l1 x - x - r usb1_ ulpi_clk r r rrcgu_ out0 i2s1_tx_ mclk - table 111 p9_0 t1 x - x - gpio4[12] mcabort r r r enet_ crs r ssp0_ ssel - table 111 p9_1 n6 x - x - gpio4[13] mcoa2 r r i2s0_tx_ ws enet_ rx_er r ssp0_ miso - table 111 p9_2 n8 x - x - gpio4[14] mcob2 r r i2s0_tx_ sda enet_ rxd3 r ssp0_ mosi - table 111 p9_3 m6 x - x - gpio4[15] mcoa0 usb1_ ind1 r r enet_ rxd2 r u3_txd - table 111 p9_4 n10 x - x - r mcob0 usb1_ ind0 r gpio5[17] enet_ txd2 r u3_rxd - table 111 p9_5 m9 x - x 69 r mcoa1 usb1_ vbus_en r gpio5[18] enet_ txd3 r u0_txd - table 111 table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 193 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) p9_6 l11 x - x 72 gpio4[11] mcob1 usb1_ pwr_fau lt r r enet_ col r u0_rxd - table 111 pa_0 l12 x - x - r r r r r i2s1_rx_ mclk cgu_ out1 r- table 111 pa_1j14x-x-gpio4[8]qei_idxr u2_txdrrr r- ta b l e 11 2 pa_2 k15 x - x - gpio4[9] qei_phb r u2_rxd r r r r - ta b l e 11 2 pa_3 h11 x - x - gpio4[10] qei_pha r r r r r r - ta b l e 11 2 pa_4 g13 x - x - r ctout_9 r emc_a23 gpio5[19] r r r - table 111 pb_0 b15 x - x - r ctout_10 lcd_vd23 r gpio5[20] r r r - table 111 pb_1 a14 x - x - r usb1_ ulpi_dir lcd_vd22 r gpio5[21] ctout_6 r r - table 111 pb_2 b12 x - x - r usb1_ ulpi_d7 lcd_vd21 r gpio5[22] ctout_7 r r - table 111 pb_3 a13 x - x - r usb1_ ulpi_d6 lcd_vd20 r gpio5[23] ctout_8 r r - table 111 pb_4 b11 x - x - r usb1_ ulpi_d5 lcd_vd15 r gpio5[24] ctin_5 r r - table 111 pb_5 a12 x - x - r usb1_ ulpi_d4 lcd_vd14 r gpio5[25] ctin_7 lcd_pwr r - table 111 pb_6 a6 x - x - r usb1_ ulpi_d3 lcd_vd13 r gpio5[26] ctin_6 lcd_vd19 r adc0_6 table 111 t able 114 pc_0 d4 x - x - r usb1_ ulpi_clk r enet_rx_ clk lcd_ dclk r r sd_clk adc1_1 table 111 t able 116 pc_1 e4 - - x - usb1_ ulpi_d7 r u1_ri enet_ mdc gpio6[0] r t3_cap0 sd_ volt0 - table 111 pc_2 f6 - - x - usb1_ ulpi_d6 r u1_cts enet_ txd2 gpio6[1] r r sd_rst - table 111 pc_3 f5 - - x - usb1_ ulpi_d5 r u1_rts enet_ txd3 gpio6[2] r r sd_ volt1 adc1_0 table 111 t able 116 table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 194 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) pc_4 f4 - - x - r usb1_ ulpi_d4 renet_ tx_en gpio6[3] r t3_cap1 sd_d0 - table 111 pc_5 g4 - - x - r usb1_ ulpi_d3 renet_ tx_er gpio6[4] r t3_cap2 sd_d1 - table 111 pc_6 h6 - - x - r usb1_ ulpi_d2 renet_ rxd2 gpio6[5] r t3_cap3 sd_d2 - table 111 pc_7 g5 - - - - r usb1_ ulpi_d1 renet_ rxd3 gpio6[6] r t3_mat0 sd_d3 - table 111 pc_8 n4 - - - - r usb1_ ulpi_d0 renet_ rx_dv gpio6[7] r t3_mat1 sd_cd - table 111 pc_9 k2 - - - - r usb1_ ulpi_nxt renet_ rx_er gpio6[8] r t3_mat2 sd_pow - table 111 pc_10 m5 - - - - r usb1_ ulpi_stp u1_dsr r gpio6[9] r t3_mat3 sd_cmd - table 111 pc_11 l5 - - - - r usb1_ ulpi_dir u1_dcd r gpio6[10] r r sd_d4 - table 111 pc_12 l6 - - - - r r u1_dtr r gpio6[11] r i2s0_tx_s da sd_d5 - table 111 pc_13 m1 - - - - r r u1_txd r gpio6[12] r i2s0_tx_ ws sd_d6 - table 111 pc_14 n1 - - - - r r u1_rxd r gpio6[13] r enet_ tx_er sd_d7 - table 111 pd_0 n2 - - - - r ctout_15 emc_ dqmout2 r gpio6[14]rr r- table 111 pd_1 p1 - - - - r r emc_ ckeout2 r gpio6[15] sd_pow r r - table 111 pd_2 r1 - - - - r ctout_7 emc_d16 r gpio6[16] r r r - table 111 pd_3 p4 - - - - r ctout_6 emc_d17 r gpio6[17] r r r - table 111 pd_4 t2 - - - - r ctout_8 emc_d18 r gpio6[18] r r r - table 111 pd_5 p6 - - - - r ctout_9 emc_d19 r gpio6[19] r r r - table 111 pd_6 r6 - - x - r ctout_10 emc_d20 r gpio6[20] r r r - table 111 table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 195 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) pd_7 t6 - - x - r ctin_5 emc_d21 r gpio6[21] r r r - table 111 pd_8 p8 - - x - r ctin_6 emc_d22 r gpio6[22] r r r - table 111 pd_9 t11 - - x - r ctout_13 emc_d23 r gpio6[23] r r r - table 111 pd_10 p11 - - x - r ctin_1 emc_bls3 r gpio6[24] r r r - table 111 pd_11 n9 x - x - r r emc_cs3 r gpio6[25] usb1_ ulpi_d0 ctout_14 r - table 111 pd_12 n11 x - x - r r emc_cs2 r gpio6[26] r ctout_10 r - table 111 pd_13 t14 x - - - r ctin_0 emc_bl s2 r gpio6[27] r ctout_13 r - table 111 pd_14 r13 x - x - r r emc_ dycs2 r gpio6[28] r ctout_11 r - table 111 pd_15 t15 x - x - r r emc_a17 r gpio6[29] sd_wp ctout_8 r - table 111 pd_16 r14 x - x - r r emc_a16 r gpio6[30] sd_ volt2 ctout_12 r - table 111 pe_0 p14 x - x - r r r emc_a18 gpio7[0] can1_td r r - table 111 pe_1 n14 x - x - r r r emc_a19 gpio7[1] can1_rd r r - table 111 pe_2 m14 x - x - adc trig0 can0_rd r emc_a20 gpio7[2] r r r - table 111 pe_3 k12 x - x - r can0_td adctri g1 emc_a21 gpio7[3] r r r - table 111 pe_4 k13 x - x - r nmi r emc_a22 gpio7[4] r r r - table 111 pe_5 n16 - - x - r ctout_3 u1_rts emc_d24 gpio7[5] r r r - table 111 pe_6 m16 - - x - r ctout_2 u1_ri emc_d25 gpio7[6] r r r - table 111 pe_7 f15 - - x - r ctout_5 u1_cts emc_d26 gpio7[7] r r r - table 111 pe_8 f14 - - x - r ctout_4 u1_dsr emc_d27 gpio7[8] r r r - table 111 pe_9 e16 - - x - r ctin_4 u1_dcd emc_d28 gpio7[9] r r r - table 111 pe_10 e14 - - x - r ctin_3 u1_dtr emc_d29 gpio7[10] r r r - table 111 pe_11 d16 - - - - r ctout_12 u1_txd emc_d30 gpio7[11] r r r - table 111 pe_12 d15 - - - - r ctout_11 u1_rxd emc_d31 gpio7[12] r r r - table 111 pe_13 g14 - - - - r ctout_14 i2c1_sda emc_ dqmout3 gpio7[13] r r r - table 111 table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 196 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) pe_14 c15 - - - - r r r emc_ dycs3 gpio7[14] r r r - table 111 pe_15 e13 - - - - r ctout_0 i2c1_scl emc_ ckeout3 gpio7[15] r r r - table 111 pf_0 d12 - - - - ssp0_ sck gp_clkin r r r r r i2s1_tx_ mclk - table 111 pf_1 e11 - - - - r r ssp0_ ssel r gpio7[16]rr r- table 111 pf_2 d11 - - x - r u3_txd ssp0_ miso r gpio7[17]rr r- table 111 pf_3 e10 - - x - r u3_rxd ssp0_ mosi r gpio7[18]rr r- table 111 pf_4 d10 x x x 120 ssp1_ sck gp_clkin trace clk r r r i2s0_tx_ mclk i2s0_rx_ sck - table 111 pf_5 e9 - - x - r u3_uclk ssp1_ ssel trace data[0] gpio7[19] r r r adc1_4 table 111 t able 116 pf_6 e7 - - x - r u3_dir ssp1_ miso trace data[1] gpio7[20] r r i2s1_tx_ sda adc1_3 table 111 t able 116 pf_7 b7 - - x - r u3_baud ssp1_ mosi trace data[2] gpio7[21] r r i2s1_tx_ ws adc1_7 table 111 t able 116 pf_8 e6 - - x - r u0_uclk ctin_2 trace data[3] gpio7[22] r r r adc0_2 table 111 t able 114 pf_9 d6 - - x - r u0_dir ctout_1 r gpio7[23] r r r adc1_2 table 111 t able 116 pf_10 a3 - - x - r u0_txd r r gpio7[24] r sd_wp r adc0_5 table 111 t able 114 pf_11 a2 - - x - r u0_rxd r r gpio7[25] r sd_ volt2 r adc1_5 table 111 t able 116 clock pins - table 111 table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 197 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) clk0 n5 x x x 45 emc_clk 0 clkout r r sd_ clk emc_ clk01 ssp1_sck enet_ tx_clk (enet_r ef_clk) - table 111 clk1 t10 x - - - emc_ clk1 clkout r r r cgu_ou t0 ri2s1_tx_ mclk - table 111 clk2 d14 x x x 99 emc_ clk3 clkout r r sd_clk emc_ clk23 i2s0_tx_ mclk i2s1_rx_ sck - table 111 clk3 p12 x - - - emc_ clk2 clkout r r r cgu_ out1 ri2s1_rx_ sck - table 111 table 109. pin multiplexing function level reference symbol lbga256 bga180 bga100 lqfp208 lqfp144 0 1 2 3 4 5 6 7 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 198 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4 register description table 110. register overview: system control unit (scu) (base address 0x4008 6000) name access address offset description reset value pins p0_n sfsp0_0 r/w 0x000 pin configuration register for pin p0_0 0x00 sfsp0_1 r/w 0x004 pin configuration register for pin p0_1 0x00 - - 0x008 - 0x07c reserved - pins p1_n sfsp1_0 r/w 0x080 pin configuration register for pin p1_0 0x00 sfsp1_1 r/w 0x084 pin configuration register for pin p1_1 0x00 sfsp1_2 r/w 0x088 pin configuration register for pin p1_2 0x00 sfsp1_3 r/w 0x08c pin configuration register for pin p1_3 0x00 sfsp1_4 r/w 0x090 pin configuration register for pin p1_4 0x00 sfsp1_5 r/w 0x094 pin configuration register for pin p1_5 0x00 sfsp1_6 r/w 0x098 pin configuration register for pin p1_6 0x00 sfsp1_7 r/w 0x09c pin configuration register for pin p1_7 0x00 sfsp1_8 r/w 0x0a0 pin configuration register for pin p1_8 0x00 sfsp1_9 r/w 0x0a4 pin configuration register for pin p1_9 0x00 sfsp1_10 r/w 0x0a8 pin configuration register for pin p1_10 0x00 sfsp1_11 r/w 0x0ac pin configuration register for pin p1_11 0x00 sfsp1_12 r/w 0x0b0 pin configuration register for pin p1_12 0x00 sfsp1_13 r/w 0x0b4 pin configuration register for pin p1_13 0x00 sfsp1_14 r/w 0x0b8 pin configuration register for pin p1_14 0x00 sfsp1_15 r/w 0x0bc pin configuration register for pin p1_15 0x00 sfsp1_16 r/w 0x0c0 pin configuration register for pin p1_16 0x00 sfsp1_17 r/w 0x0c4 pin configuration register for pin p1_17 0x00 sfsp1_18 r/w 0x0c8 pin configuration register for pin p1_18 0x00 sfsp1_19 r/w 0x0cc pin configuration register for pin p1_19 0x00 sfsp1_20 r/w 0x0d0 pin configuration register for pin p1_20 0x00 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 199 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) - - 0x0d4 - 0x0fc reserved - pins p2_n sfsp2_0 r/w 0x100 pin configuration register for pin p2_0 0x00 sfsp2_1 r/w 0x104 pin configuration register for pin p2_1 0x00 sfsp2_2 r/w 0x108 pin configuration register for pin p2_2 0x00 sfsp2_3 r/w 0x10c pin configuration register for pin p2_3 0x00 sfsp2_4 r/w 0x110 pin configuration register for pin p2_4 0x00 sfsp2_5 r/w 0x114 pin configuration register for pin p2_5 0x00 sfsp2_6 r/w 0x118 pin configuration register for pin p2_6 0x00 sfsp2_7 r/w 0x11c pin configuration register for pin p2_7 0x00 sfsp2_8 r/w 0x120 pin configuration register for pin p2_8 0x00 sfsp2_9 r/w 0x124 pin configuration register for pin p2_9 0x00 sfsp2_10 r/w 0x128 pin configuration register for pin p2_10 0x00 sfsp2_11 r/w 0x12c pin configuration register for pin p2_11 0x00 sfsp2_12 r/w 0x130 pin configuration register for pin p2_12 0x00 sfsp2_13 r/w 0x134 pin configuration register for pin p2_13 0x00 - - 0x138 - 0x17c reserved - pins p3_n sfsp3_0 r/w 0x180 pin configuration register for pin p3_0 0x00 sfsp3_1 r/w 0x184 pin configuration register for pin p3_1 0x00 sfsp3_2 r/w 0x188 pin configuration register for pin p3_2 0x00 sfsp3_3 r/w 0x18c pin configuration register for pin p3_3 0x00 sfsp3_4 r/w 0x190 pin configuration register for pin p3_4 0x00 sfsp3_5 r/w 0x194 pin configuration register for pin p3_5 0x00 sfsp3_6 r/w 0x198 pin configuration register for pin p3_6 0x00 sfsp3_7 r/w 0x19c pin configuration register for pin p3_7 0x00 sfsp3_8 r/w 0x1a0 pin configuration register for pin p3_8 0x00 - - 0x1a4 - 0x1fc reserved - pins p4_n sfsp4_0 r/w 0x200 pin configuration register for pin p4_0 0x00 sfsp4_1 r/w 0x204 pin configuration register for pin p4_1 0x00 sfsp4_2 r/w 0x208 pin configuration register for pin p4_2 0x00 sfsp4_3 r/w 0x20c pin configuration register for pin p4_3 0x00 sfsp4_4 r/w 0x210 pin configuration register for pin p4_4 0x00 sfsp4_5 r/w 0x214 pin configuration register for pin p4_5 0x00 sfsp4_6 r/w 0x218 pin configuration register for pin p4_6 0x00 sfsp4_7 r/w 0x21c pin configuration register for pin p4_7 0x00 table 110. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 200 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) sfsp4_8 r/w 0x220 pin configuration register for pin p4_8 0x00 sfsp4_9 r/w 0x224 pin configuration register for pin p4_9 0x00 sfsp4_10 r/w 0x228 pin configuration register for pin p4_10 0x00 - - 0x22c - 0x27c reserved - pins p5_n sfsp5_0 r/w 0x280 pin configuration register for pin p5_0 0x00 sfsp5_1 r/w 0x284 pin configuration register for pin p5_1 0x00 sfsp5_2 r/w 0x288 pin configuration register for pin p5_2 0x00 sfsp5_3 r/w 0x28c pin configuration register for pin p5_3 0x00 sfsp5_4 r/w 0x290 pin configuration register for pin p5_4 0x00 sfsp5_5 r/w 0x294 pin configuration register for pin p5_5 0x00 sfsp5_6 r/w 0x298 pin configuration register for pin p5_6 0x00 sfsp5_7 r/w 0x29c pin configuration register for pin p5_7 0x00 - - 0x2a0 - 0x2fc reserved - pins p6_n sfsp6_0 r/w 0x300 pin configuration register for pin p6_0 0x00 sfsp6_1 r/w 0x304 pin configuration register for pin p6_1 0x00 sfsp6_2 r/w 0x308 pin configuration register for pin p6_2 0x00 sfsp6_3 r/w 0x30c pin configuration register for pin p6_3 0x00 sfsp6_4 r/w 0x310 pin configuration register for pin p6_4 0x00 sfsp6_5 r/w 0x314 pin configuration register for pin p6_5 0x00 sfsp6_6 r/w 0x318 pin configuration register for pin p6_6 0x00 sfsp6_7 r/w 0x31c pin configuration register for pin p6_7 0x00 sfsp6_8 r/w 0x320 pin configuration register for pin p6_8 0x00 sfsp6_9 r/w 0x324 pin configuration register for pin p6_9 0x00 sfsp6_10 r/w 0x328 pin configuration register for pin p6_10 0x00 sfsp6_11 r/w 0x32c pin configuration register for pin p6_11 0x00 sfsp6_12 r/w 0x330 pin configuration register for pin p6_12 0x00 - - 0x334 - 0x37c reserved - pins p7_n sfsp7_0 r/w 0x380 pin configuration register for pin p7_0 0x00 sfsp7_1 r/w 0x384 pin configuration register for pin p7_1 0x00 sfsp7_2 r/w 0x388 pin configuration register for pin p7_2 0x00 sfsp7_3 r/w 0x38c pin configuration register for pin p7_3 0x00 sfsp7_4 r/w 0x390 pin configuration register for pin p7_4 0x00 sfsp7_5 r/w 0x394 pin configuration register for pin p7_5 0x00 sfsp7_6 r/w 0x398 pin configuration register for pin p7_6 0x00 table 110. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 201 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) sfsp7_7 r/w 0x39c pin configuration register for pin p7_7 0x00 - - 0x3a0 - 0x3fc reserved - pins p8_n sfsp8_0 r/w 0x400 pin configuration register for pin p8_0 0x00 sfsp8_1 r/w 0x404 pin configuration register for pin p8_1 0x00 sfsp8_2 r/w 0x408 pin configuration register for pin p8_2 0x00 sfsp8_3 r/w 0x40c pin configuration register for pin p8_3 0x00 sfsp8_4 r/w 0x410 pin configuration register for pin p8_4 0x00 sfsp8_5 r/w 0x414 pin configuration register for pin p8_5 0x00 sfsp8_6 r/w 0x418 pin configuration register for pin p8_6 0x00 sfsp8_7 r/w 0x41c pin configuration register for pin p8_7 0x00 sfsp8_8 r/w 0x420 pin configuration register for pin p8_8 0x00 - - 0x424 - 0x47c reserved - pins p9_n sfsp9_0 r/w 0x480 pin configuration register for pin p9_0 0x00 sfsp9_1 r/w 0x484 pin configuration register for pin p9_1 0x00 sfsp9_2 r/w 0x488 pin configuration register for pin p9_2 0x00 sfsp9_3 r/w 0x49c pin configuration register for pin p9_3 0x00 sfsp9_4 r/w 0x490 pin configuration register for pin p9_4 0x00 sfsp9_5 r/w 0x494 pin configuration register for pin p9_5 0x00 sfsp9_6 r/w 0x498 pin configuration register for pin p9_6 0x00 - - 0x49c - 0x4fc reserved - pins pa_n - r/w 0x500 reserved - sfspa_1 r/w 0x504 pin configuration register for pin pa_1 0x00 sfspa_2 r/w 0x508 pin configuration register for pin pa_2 0x00 sfspa_3 r/w 0x50c pin configuration register for pin pa_3 0x00 sfspa_4 r/w 0x510 pin configuration register for pin pa_4 0x00 - - 0x514 - 0x57c reserved - pins pb_n sfspb_0 r/w 0x580 pin configuration register for pin pb_0 0x00 sfspb_1 r/w 0x584 pin configuration register for pin pb_1 0x00 sfspb_2 r/w 0x588 pin configuration register for pin pb_2 0x00 sfspb_3 r/w 0x58c pin configuration register for pin pb_3 0x00 sfspb_4 r/w 0x590 pin configuration register for pin pb_4 0x00 sfspb_5 r/w 0x594 pin configuration register for pin pb_5 0x00 table 110. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 202 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) sfspb_6 r/w 0x598 pin configuration register for pin pb_6 0x00 - - 0x59c - 0x5fc reserved - pins pc_n sfspc_0 r/w 0x600 pin configuration register for pin pc_0 0x00 sfspc_1 r/w 0x604 pin configuration register for pin pc_1 0x00 sfspc_2 r/w 0x608 pin configuration register for pin pc_2 0x00 sfspc_3 r/w 0x60c pin configuration register for pin pc_3 0x00 sfspc_4 r/w 0x610 pin configuration register for pin pc_4 0x00 sfspc_5 r/w 0x614 pin configuration register for pin pc_5 0x00 sfspc_6 r/w 0x618 pin configuration register for pin pc_6 0x00 sfspc_7 r/w 0x61c pin configuration register for pin pc_7 0x00 sfspc_8 r/w 0x620 pin configuration register for pin pc_8 0x00 sfspc_9 r/w 0x624 pin configuration register for pin pc_9 0x00 sfspc_10 r/w 0x628 pin configuration register for pin pc_10 0x00 sfspc_11 r/w 0x62c pin configuration register for pin pc_11 0x00 sfspc_12 r/w 0x630 pin configuration register for pin pc_12 0x00 sfspc_13 r/w 0x634 pin configuration register for pin pc_13 0x00 sfspc_14 r/w 0x638 pin configuration register for pin pc_14 0x00 - - 0x63c - 0x67c reserved - pins pd_n sfspd_0 r/w 0x680 pin configuration register for pin pd_0 0x00 sfspd_1 r/w 0x684 pin configuration register for pin pd_1 0x00 sfspd_2 r/w 0x688 pin configuration register for pin pd_2 0x00 sfspd_3 r/w 0x68c pin configuration register for pin pd_3 0x00 sfspd_4 r/w 0x690 pin configuration register for pin pd_4 0x00 sfspd_5 r/w 0x694 pin configuration register for pin pd_5 0x00 sfspd_6 r/w 0x698 pin configuration register for pin pd_6 0x00 sfspd_7 r/w 0x69c pin configuration register for pin pd_7 0x00 sfspd_8 r/w 0x6a0 pin configuration register for pin pd_8 0x00 sfspd_9 r/w 0x6a4 pin configuration register for pin pd_9 0x00 sfspd_10 r/w 0x6a8 pin configuration register for pin pd_10 0x00 sfspd_11 r/w 0x6ac pin configuration register for pin pd_11 0x00 sfspd_12 r/w 0x6b0 pin configuration register for pin pd_12 0x00 sfspd_13 r/w 0x6b4 pin configuration register for pin pd_13 0x00 sfspd_14 r/w 0x6b8 pin configuration register for pin pd_14 0x00 sfspd_15 r/w 0x6bc pin configuration register for pin pd_15 0x00 sfspd_16 r/w 0x6c0 pin configuration register for pin pd_16 0x00 table 110. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 203 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) - - 0x6c4 - 0x6fc reserved - pins pe_n sfspe_0 r/w 0x700 pin configuration register for pin pe_0 0x00 sfspe_1 r/w 0x704 pin configuration register for pin pe_1 0x00 sfspe_2 r/w 0x708 pin configuration register for pin pe_2 0x00 sfspe_3 r/w 0x70c pin configuration register for pin pe_3 0x00 sfspe_4 r/w 0x710 pin configuration register for pin pe_4 0x00 sfspe_5 r/w 0x714 pin configuration register for pin pe_5 0x00 sfspe_6 r/w 0x718 pin configuration register for pin pe_6 0x00 sfspe_7 r/w 0x71c pin configuration register for pin pe_7 0x00 sfspe_8 r/w 0x720 pin configuration register for pin pe_8 0x00 sfspe_9 r/w 0x724 pin configuration register for pin pe_9 0x00 sfspe_10 r/w 0x728 pin configurat ion register for pin pe_10 0x00 sfspe_11 r/w 0x72c pin configuration register for pin pe_11 0x00 sfspe_12 r/w 0x730 pin configurat ion register for pin pe_12 0x00 sfspe_13 r/w 0x734 pin configurat ion register for pin pe_13 0x00 sfspe_14 r/w 0x738 pin configurat ion register for pin pe_14 0x00 sfspe_15 r/w 0x73c pin configurat ion register for pin pe_15 0x00 - - 0x740 - 0x77c reserved - pins pf_n sfspf_0 r/w 0x780 pin configuration register for pin pf_0 0x00 sfspf_1 r/w 0x784 pin configuration register for pin pf_1 0x00 sfspf_2 r/w 0x788 pin configuration register for pin pf_2 0x00 sfspf_3 r/w 0x78c pin configuration register for pin pf_3 0x00 sfspf_4 r/w 0x790 pin configuration register for pin pf_4 0x00 sfspf_5 r/w 0x794 pin configuration register for pin pf_5 0x00 sfspf_6 r/w 0x798 pin configuration register for pin pf_6 0x00 sfspf_7 r/w 0x79c pin configuration register for pin pf_7 0x00 sfspf_8 r/w 0x7a0 pin configuration register for pin pf_8 0x00 sfspf_9 r/w 0x7a4 pin configuration register for pin pf_9 0x00 sfspf_10 r/w 0x7a8 pin configurat ion register for pin pf_10 0x00 sfspf_11 r/w 0x7ac pin configuration register for pin pf_11 0x00 - - 0x7b0 - 0xbfc reserved - clkn pins sfsclk0 r/w 0xc00 pin configuration register for pin clk0 0x00 sfsclk1 r/w 0xc04 pin configuration register for pin clk1 0x00 sfsclk2 r/w 0xc08 pin configuration register for pin clk2 0x00 table 110. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 204 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.1 pin configuration regi sters for normal drive pins each digital pin and each clock pin on the lp c18xx have an associated pin configuration register which determines the pin?s function and electrical characteristics. the assigned functions for each pin are listed in ta b l e 1 0 9 . sfsclk3 r/w 0xc0c pin configuration register for pin clk3 0x00 --0xc10 - 0xc84 reserved - adc pin select registers enaio0 r/w 0xc88 adc0 functi on select register enaio1 r/w 0xc8c adc1 functi on select register enaio2 r/w 0xc90 analog func tion select register usb dp1/dpm pins and i 2 c-bus open-drain pins sfsusb r/w 0xc80 pin configuration register for 0x00 sfsi2c0 r/w 0xc84 pin configuration register for i 2 c0-bus pins 0x00 emc delay registers emcclkdelay r/w 0xd00 emc clock delay register emcctrldelay r/w 0xd04 emc control delay register emccsdelay r/w 0xd08 emc chip select delay register emcdoutdelay r/w 0xd0c emc data out delay register emcfbclkdelay r/w 0xd10 emc fbclk delay register emcaddrdelay0 r/w 0xd14 emc address line delay register 0 emcaddrdelay1 r/w 0xd18 emc address line delay register 1 emcaddrdelay2 r/w 0xd1c emc address line delay register 2 - - 0xd20 reserved emcdindelay r/w 0xd24 emc data delay register pin interrupt select registers pintsel0 r/w 0xe00 pin interrupt select register for pin interrupts 0 to 3. pintsel1 r/w 0xe04 pin interrupt select register for pin interrupts 4 to 7. table 110. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 205 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.2 pin configuration re gisters for high drive pins each digital pin and each clock pin on the lp c18xx have an associated pin configuration register which determines the pin?s function and electrical characteristics. the assigned functions for each pin are listed in ta b l e 1 0 9 . table 111. pin configuration for normal drive pins p0_n to pf_n and clk0 to clk3 registers (sfs, address 0x4008 6000 (spsp0_0) to 0x4008 6c0c (sfsclk3)) bit description bit symbol value description reset value access 2:0 mode select pin function 0 r/w 0x0 function 0 (default) 0x1 function 1 0x2 function 2 0x3 function 3 0x4 function 4 0x5 function 5 0x6 function 6 0x7 function 7 3 epd enable pull-down resistor at pad 0 r/w 0 disable pull-down. 1 enable pull-down. 4 epun disable pull-up resistor at pad. by default, the pull-up resistor is enabled at reset. 0r/w 0 enable pull-up 1 disable pull-up 5 ehs slew rate 0 r/w 0slow 1fast 6 ezi input buffer enable. the input buffer is disabled by default at reset and must be enabled for receiving. 0r/w 0 disable input buffer 1 enable input buffer 31:7 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 206 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.3 adc0 function select register for pins which have digital and analog functions, this register selects the input channel of the adc0 over any of the possible digital functi ons. this option is not available for channel adc0_7. in addition, each analog function is pinned out on a dedicated analog pin which is not affected by this register. the following pins are controlled by the enaio0 register: table 112. pin configuration for high drive pins p0_n to pf_n and clk0 to clk3 registers (sfs, address 0x4008 6000 (sfsp0_0) to 0x4008 6c0c (sfsclk3) bit description bit symbol value description reset value access 2:0 mode select pin function 0 r/w 0x0 function 0 (default) 0x1 function 1 0x2 function 2 0x3 function 3 0x4 function 4 0x5 function 5 0x6 function 6 0x7 function 7 3 epd enable pull-down resistor at pad 0 r/w 0 disable pull-down. 1 enable pull-down. 4 epun disable pull-up resistor at pad. by default, the pull-up resistor is enabled at reset. 0r/w 0 enable pull-up 1 disable pull-up 5 ehs slew rate 0 r/w 0slow 1fast 6 ezi input buffer enable. the input buffer is disabled by default at reset but must be enabled to transfer data from the i/o buffer to the pad. 0r/w 0 disable input buffer 1 enable input buffer 7- reserved - - 9:8 ehd select drive strength 0 r/w 0x0 standard drive: 4 ma drive strength 0x1 medium drive: 8 ma drive strength 0x2 high drive: 14 ma drive strength 0x3 ultra-high drive: 20 ma drive strength 31:10 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 207 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) by default, all pins are connected to their di gital function 0 and th e corresponding enaio0 register bit is set to one. in this case, only the digital pad is available. before selecting the analog pad by setting the enaio0 register bit to zero, the digital pad must be set as follows using the corresponding sfsp register: 1. tri-state the output driver by selecting an input at the pinmux e.g. gpio function in input mode. 2. disable the receiver by setting the ezi bit to zero (see ta b l e 111 or table 112 ). this is the default setting. 3. disable the pull-up resistor by setting the epun bit to one, and disable the pull-down resistor by setting the epd bit to zero. table 113. pins controlled by the enaio0 register pin adc function enaio0 register bit p4_3 adc0_0 0 p4_1 adc0_1 1 pf_8 adc0_2 2 p7_5 adc0_3 3 p7_4 adc0_4 4 pf_10 adc0_5 5 pb_6 adc0_6 6 table 114. adc0 function selec t register (enaio0, address 0x 4008 6c88) bit description bit symbol value description reset value access 0 adc0_0 select adc0_0 0 r/w 0 analog function adc0_0 selected on pin p4_3. 1 digital function selected on pin p4_3. 1 adc0_1 select adc0_1 0 r/w 0 analog function adc0_1 selected on pin p4_1. 1 digital function selected on pin p4_1. 2 adc0_2 select adc0_2 0 r/w 0 analog function adc0_2 selected on pin pf_8. 1 digital function selected on pin pf_8. 3 adc0_3 select adc0_3 0 r/w 0 analog function adc0_3 selected on pin p7_5. 1 digital function selected on pin p7_5. 4 adc0_4 select adc0_4 0 r/w 0 analog function adc0_4 selected on pin p7_4. 1 digital function selected on pin p7_4. 5 adc0_5 select adc0_5 0 r/w 0 analog function adc0_5 selected on pin pf_10. 1 digital function selected on pin pf_10. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 208 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.4 adc1 function select register for pins which have digital and analog functi ons, this register selects the adc1 function over any of the possible digital functions. in addition, each analog function is pinned out on a dedicated analog pin which is not affected by this register. the following pins are controlled by the enaio1 register: by default, all pins are connected to their di gital function 0 and th e corresponding enaio1 register bit is set to one. in this case, only the digital pad is available. before selecting the analog pad by setting the enaio1 register bit to zero, the digital pad must be set as follows using the corresponding sfsp register: 1. tri-state the output driver by selecting an input at the pinmux e.g. gpio function in input mode. 2. disable the receiver by setting the ezi bit to zero (see ta b l e 111 or table 112 ). this is the default setting. 3. disable the pull-up resistor by setting the epun bit to one, and disable the pull-down resistor by setting the epd bit to zero. 6 adc0_6 select adc0_6 0 r/w 0 analog function adc0_6 selected on pin pb_6. 1 digital function selected on pin pb_6. 31:7 reserved - - table 114. adc0 function selec t register (enaio0, address 0x 4008 6c88) bit description bit symbol value description reset value access table 115. pins controlled by the enaio1 register pin adc function enaio1 register bit pc_3 adc1_0 0 pc_0 adc1_1 1 pf_9 adc1_2 2 pf_6 adc1_3 3 pf_5 adc1_4 4 pf_11 adc1_5 5 p7_7 adc1_6 6 pf_7 adc1_7 7 table 116. adc1 function selec t register (enaio1, address 0x 4008 6c8c) bit description bit symbol value description reset value access 0 adc1_0 select adc1_0 0 r/w 0 analog function adc1_0 selected on pin pc_3. 1 digital function selected on pin pc_3. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 209 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.5 analog function select register for pins which have digital and analog function s, this register selects the analog dac and band gap function over any of the possible digital functions. in addition, the dac function is pinned out on a dedicated analog pin which is not affected by this register. the following pins are controlled by the enaio1 register: by default, all pins are connected to their di gital function 0 and th e corresponding enaio2 register bit is set to one. in this case, only the digital pad is available. before selecting the analog pad by setting the enaio2 register bit to zero, the digital pad must be set as follows using the corresponding sfsp register: 1 adc1_1 select adc1_1 0 r/w 0 analog function adc1_1 selected on pin pc_0. 1 digital function selected on pin pc_0. 2 adc1_2 select adc1_2 0 r/w 0 analog function adc1_2 selected on pin pf_9. 1 digital function selected on pin pf_9. 3 adc1_3 select adc1_3 0 r/w 0 analog function adc1_3 selected on pin pf_6. 1 digital function selected on pin pf_6. 4 adc1_4 select adc1_4 0 r/w 0 analog function adc1_4 selected on pin pf_5. 1 digital function selected on pin pf_5. 5 adc1_5 select adc1_5 0 r/w 0 analog function adc1_5 selected on pin pf_11. 1 digital function selected on pin pf_11. 6 adc1_6 select adc1_6 0 r/w 0 analog function adc1_6 selected on pin p7_7. 1 digital function selected on pin p7_7. 7 adc1_7 select adc1_7 0 r/w 0 analog function adc1_7 selected on pin pf_7. 1 digital function selected on pin pf_7. 31:8 reserved - - table 116. adc1 function selec t register (enaio1, address 0x 4008 6c8c) bit description bit symbol value description reset value access table 117. pins controlled by the enaio2 register pin adc function enaio2 register bit p4_4 dac 0 pf_7 bg (band gap output) 4 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 210 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 1. tri-state the output driver by selecting an input at the pinmux e.g. gpio function in input mode. 2. disable the receiver by setting the ezi bit to zero (see ta b l e 111 or table 112 ). this is the default setting. 3. disable the pull-up resistor by setting the epun bit to one, and disable the pull-down resistor by setting the epd bit to zero. 13.4.6 pin configuration regist er for usb1 pins dp1/dm1 remark: the usb_esea bit must be se t to one to use usb1. 13.4.7 pin configuration re gister for open-drain i 2 c-bus pins table 118. analog function select register (enaio2, address 0x4008 6c90) bit description bit symbol value description reset value access 0 dac select dac 0 r/w 0 analog function dac selected on pin p4_4. 1 digital function selected on pin p4_4. 3:1 reserved - - 4 bg select band gap output 0 r/w 0 band gap output selected for pin pf_7. 1 digital function selected on pin pf_7. 31:5 reserved - - table 119. pin configuration for pins dp1/dm 1 register (sfsusb, address 0x4008 6c80) bit description bit symbol value description reset value access 0 usb_aim differential data input aip/aim 0 = going low with full speed edge rate 1 = going high with full speed edge rate 0r/w 0 going low with full speed edge rate 1 going high with full speed edge rate 1 usb_esea control signal for differential input or single input 0 r/w 0 reserved. do not use. 1 single input aip. enables usb1. 31:2 - reserved - - table 120. pin configuration for open-drain i 2 c-bus pins register (sfsi2c0, address 0x4008 6c84) bit description bit symbol value description reset value access 0 sda_ehs configures i 2 c0-bus speed for sda0 pin 0 r/w 0 standard/fast mode (400 kbit/s) 1 high-speed mode (3.4 mbit/s) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 211 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.8 emc clock delay register this register provides a programmable delay for the emc clock outputs. the delay for each clock output is approximately 0.5 ns ? clkn_delay or 0.5 ns ? cken_delay. (clkn_delay/cken_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 13.4.9 emc control delay register this register provides a programmable delay for the emc control outputs. the delay for each control output is approximately 0.5 ns ? xxx_delay. (xxx_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 1 scl_ehs configures i 2 c0-bus speed for scl0 pin 0 r/w 0 standard/fast mode (400 kbit/s) 1 high-speed mode (3.4 mbit/s) 2 scl_ecs direction (only applies if scl_ehs = 1) 0 r/w 0 receive 1 transmit 31:3 - reserved - - table 120. pin configuration for open-drain i 2 c-bus pins register (sfsi2c0, address 0x4008 6c84) bit description ?continued bit symbol value description reset value access table 121. emc clock delay regi ster (emcclkdelay, address 0x4008 6d00) bit description bit symbol description reset value access 2:0 clk0_delay delay of the emc_clk0 clock output. 0 r/w 3 - reserved. - - 6:4 clk1_delay delay of the emc_clk0 clock output. 0 r/w 7 - reserved. - - 10:8 clk2_delay delay of the emc_clk2 clock output. 0 r/w 11 - reserved. - - 14:12 clk3_delay delay of the emc_clk3 clock output. 0 r/w 15 - reserved. - - 18:16 cke0_delay delay of the emc_ckeout0 clock enable output. 0 r/w 19 - reserved. - - 22:20 cke1_delay delay of the emc_ckeout1 clock enable output. 0 r/w 23 - reserved. - - 26:24 cke2_delay delay of the emc_ckeout2 clock enable output. 0 r/w 27 - reserved. - - 30:28 cke3_delay delay of the emc_ckeout3 clock enable output. 0 r/w 31 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 212 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.10 emc chip select delay register this register provides a programmable delay for the emc chip select outputs. the delay for each control output is approximately 0.5 ns ? xxx_delay. (xxx_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) table 122. emc control delay register (emcctrldelay, address 0x4008 6d04) bit description bit symbol description reset value access 2:0 ras_delay delay of the emc_ras output. 0 r/w 3 - reserved. - - 6:4 cas_delay delay of the emc_cas output. 0 r/w 7 - reserved. - - 10:8 oe_delay delay of the emc_oe output. 0 r/w 11 - reserved. - - 14:12 we_delay delay of the emc_we output. 0 r/w 15 - reserved. - - 18:16 bls0_delay delay of the emc_bls0 output. 0 r/w 19 - reserved. - - 22:20 bls1_delay delay of the emc_bls1 output. 0 r/w 23 - reserved. - - 26:24 bls2_delay delay of the emc_bls2 clock enable output. 0 r/w 27 - reserved. - - 30:28 bls3_delay delay of the emc_bls3 clock enable output. 0 r/w 31 - reserved. - - table 123. emc chip select delay regist er (emccsdelay, address 0x4008 6d08) bit description bit symbol description reset value access 2:0 dycs0_delay delay of t he emc_dycs0 output. 0 r/w 3 - reserved. - - 6:4 dycs1_delay delay of t he emc_dycs1 output. 0 r/w 7 - reserved. - - 10:8 dycs2_delay delay of the emc_dycs2 output. 0 r/w 11 - reserved. - - 14:12 dycs3_delay delay of the emc_dycs3 output. 0 r/w 15 - reserved. - - 18:16 cs0_delay delay of the emc_cs0 output. 0 r/w 19 - reserved. - - 22:20 cs1_delay delay of the emc_cs1 output. 0 r/w 23 - reserved. - - 26:24 cs2_delay delay of the emc_cs2 clock enable output. 0 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 213 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.11 emc data out delay register this register provides a programmable delay for the emc dqm and emc data outputs (8 data lanes per delay control). the delay for each control output is approximately 0.5 ns ? xxx_delay. (xxx_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 13.4.12 emc feedback clock delay register this register provides a programmable delay for the emc feedback clocks (8 data lanes per feedback clock). the delay for each control output is approximately 0.5 ns ? xxx_delay. (xxx_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 27 - reserved. - - 30:28 cs3_delay delay of the emc_cs3 clock enable output. 0 r/w 31 - reserved. - - table 123. emc chip select delay regist er (emccsdelay, address 0x4008 6d08) bit description ?continued bit symbol description reset value access table 124. emc data out delay register (emcdoutdelay, address 0x4008 6d0c) bit description bit symbol description reset value access 2:0 dqm0_delay delay of the emc_dqm0 output. 0 r/w 3 - reserved. - - 6:4 dqm1_delay delay of the emc_dqm1 output. 0 r/w 7 - reserved. - - 10:8 dqm2_delay delay of the emc_dqm2 output. 0 r/w 11 - reserved. - - 14:12 dqm3_delay delay of the emc_dqm3 output. 0 r/w 15 - reserved. - - 18:16 d0_delay delay of the emc_d0 to emc_d7 outputs. 0 r/w 19 - reserved. - - 22:20 d1_delay delay of the emc_d8 to emc_d15 outputs. 0 r/w 23 - reserved. - - 26:24 d2_delay delay of the emc_d16 to emc_d23 outputs. 0 r/w 27 - reserved. - - 30:28 d3_delay delay of the emc_d24 to emc_d31 outputs. 0 r/w 31 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 214 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.13 emc address delay register 0 this register provides a programmable delay for the emc address outputs. the delay for each control output is approximately 0.5 ns ? addrn_delay. (addrn_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 13.4.14 emc address delay register 1 this register provides a programmable delay for the emc address outputs. the delay for each control output is approximately 0.5 ns ? addrn_delay. (addrn_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) table 125. emc dqm delay register (emcfbclkdelay, address 0x4008 6d10) bit description bit symbol description reset value access 2:0 fbclk0_delay delay of the emc feedback clock 0 (for byte lane 0). 0 r/w 3 - reserved. - - 6:4 fbclk1_delay delay of the emc feedback clock 1 (for byte lane 1). 0 r/w 7 - reserved. - - 10:8 fbclk2_delay delay of the emc feedback clock 2 (for byte lane 2). 0 r/w 11 - reserved. - - 14:12 fbclk3_delay delay of the emc feedback clock 3 (for byte lane 3). 0 r/w 15 - reserved. - - 18:16 cclk_delay delay of the emc cclkdelay clock. 0 r/w 31:19 - reserved. - - table 126. emc address delay register 0 (emcaddrdelay0, address 0x4008 6d14) bit description bit symbol description reset value access 2:0 addr0_delay delay of the emc_a0 output. 0 r/w 3 - reserved. - - 6:4 addr1_delay delay of the emc_a1 output. 0 r/w 7 - reserved. - - 10:8 addr2_delay delay of the emc_a2 output. 0 r/w 11 - reserved. - - 14:12 addr3_delay delay of the emc_a3 output. 0 r/w 15 - reserved. - - 18:16 addr4_delay delay of the emc_a4 output. 0 r/w 19 - reserved. - - 22:20 addr5_delay delay of the emc_a5 output. 0 r/w 23 - reserved. - - 26:24 addr6_delay delay of the emc_a6 output. 0 r/w 27 - reserved. - - 30:28 addr7_delay delay of the emc_a7 output. 0 r/w 31 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 215 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.15 emc address delay register 2 this register provides a programmable delay for the emc address outputs. the delay for each control output is approximately 0.5 ns ? addrn_delay. (addrn_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) table 127. emc address delay register 1 (emcaddrdelay1, address 0x4008 6d18) bit description bit symbol description reset value access 2:0 addr8_delay delay of the emc_a8 output. 0 r/w 3 - reserved. - - 6:4 addr9_delay delay of the emc_a9 output. 0 r/w 7 - reserved. - - 10:8 addr10_delay delay of the emc_a10 output. 0 r/w 11 - reserved. - - 14:12 addr11_delay delay of the emc_a11 output. 0 r/w 15 - reserved. - - 18:16 addr12_delay delay of the emc_a12 output. 0 r/w 19 - reserved. - - 22:20 addr13_delay delay of the emc_a13 output. 0 r/w 23 - reserved. - - 26:24 addr14_delay delay of the emc_a14 output. 0 r/w 27 - reserved. - - 30:28 addr15_delay delay of the emc_a15 output. 0 r/w 31 - reserved. - - table 128. emc address delay register 2 (emcaddrdelay2, address 0x4008 6d1c) bit description bit symbol description reset value access 2:0 addr16_delay delay of the emc_a16 output. 0 r/w 3 - reserved. - - 6:4 addr17_delay delay of the emc_a17 output. 0 r/w 7 - reserved. - - 10:8 addr18_delay delay of the emc_a18 output. 0 r/w 11 - reserved. - - 14:12 addr19_delay delay of the emc_a19 output. 0 r/w 15 - reserved. - - 18:16 addr20_delay delay of the emc_a20 output. 0 r/w 19 - reserved. - - 22:20 addr21_delay delay of the emc_a21 output. 0 r/w 23 - reserved. - - 26:24 addr22_delay delay of the emc_a22 output. 0 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 216 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.16 emc data in delay register this register provides a programmable delay for the emc data inputs (8 data lanes per delay control). the delay for each co ntrol output is approximately 0.5 ns ? addrn_delay. (addrn_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 13.4.17 pin interrupt select register 0 this register selects one gpio pin from all gpio pins on all ports as the source for pin interrupts 0 to 3. as an example, for pin interrupt 1, intp in1 = 0xa selects gpio pin gpio0[10] if portsel1 = 0 or pin gpio1[10] if portsel = 1. each pin interrupt must be enabled in the nvic using interrupt slot # . to enable each pin interrupt and configure its edge or level sensitivity, use the gpio pin interrupt registers (see ). 27 - reserved. - - 30:28 addr23_delay delay of the emc_a23 output. 0 r/w 31 - reserved. - - table 128. emc address delay register 2 (emcaddrdelay2, address 0x4008 6d1c) bit description ?continued bit symbol description reset value access table 129. emc data in delay register 3 (emcdindelay, address 0x4008 6d24) bit description bit symbol description reset value access 2:0 din0_delay delay of the emc_d0 to emc_d7 inputs. 0 r/w 3 - reserved. - - 6:4 din1_delay delay of the emc_d8 to emc_d15 inputs. 0 r/w 7 - reserved. - - 10:8 din2_delay delay of the emc_d23 to emc_d16 inputs. 0 r/w 11 - reserved. - - 14:12 din3_delay delay of the emc_d31 to emc_d24 inputs. 0 r/w 15 - reserved. - - 18:16 den0_delay 0 r/w 19 - reserved. - - 22:20 den1_delay delay of the data enable lines 8 to 15. 0 r/w 23 - reserved. - - 26:24 den2_delay delay of the data enable lines 16 to 23. 0 r/w 31:27 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 217 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) table 130. pin interrupt select register 0 (pintsel0, address 0x4008 6e00) bit description bit symbol value description reset value 4:0 intpin0 pint interrupt 0: select the pin number within the gpio port selected by the portsel0 bit in this register. 0 7:5 portsel0 pin interrupt 0: select the port for the pin number to be selected in the intpin0 bits of this register. 0 0x0 gpio port 0 0x1 gpio port 1 0x2 gpio port 2 0x3 gpio port 3 0x4 gpio port 4 0x5 gpio port 5 0x6 gpio port 6 0x7 gpio port 7 12:8 intpin1 pint interrupt 1: select the pin number withi n the gpio port selected by the portsel1 bit in this register. 0 15:13 portsel1 pin interrupt 1: select the port for the pin number to be selected in the intpin1 bits of this register. 0 0x0 gpio port 0 0x1 gpio port 1 0x2 gpio port 2 0x3 gpio port 3 0x4 gpio port 4 0x5 gpio port 5 0x6 gpio port 6 0x7 gpio port 7 20:16 intpin2 pint interrup t 2: select the pin number within the gpio port selected by the portsel2 bit in this register. 0 23:21 portsel2 pin interrupt 2: select the port for the pin number to be selected in the intpin2 bits of this register. 0 0x0 gpio port 0 0x1 gpio port 1 0x2 gpio port 2 0x3 gpio port 3 0x4 gpio port 4 0x5 gpio port 5 0x6 gpio port 6 0x7 gpio port 7 28:24 intpin3 pint interrup t 3: select the pin number within the gpio port selected by the portsel3 bit in this register. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 218 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 13.4.18 pin interrupt select register 1 this register selects one gpio pin from all gpio pins on all ports as the source for pin interrupts 4 to 7. as an example, for pin interrupt 4, intp in4 = 0xa selects gpio pin gpio0[10] if portsel1 = 0 or pin gpio1[10] if portsel = 1. each pin interrupt must be enabled in the nvic using interrupt slots 32 to 39. to enable each pin interrupt and configure its edge or level sensitivity, use the gpio pin interrupt registers (see section 15.4.1 ). 31:29 portsel3 pin interrupt 3: select the port for the pin number to be selected in the intpin3 bits of this register. 0 0x0 gpio port 0 0x1 gpio port 1 0x2 gpio port 2 0x3 gpio port 3 0x4 gpio port 4 0x5 gpio port 5 0x6 gpio port 6 0x7 gpio port 7 table 130. pin interrupt select register 0 (pintsel0, address 0x4008 6e00) bit description bit symbol value description reset value table 131. pin interrupt select register 1 (pintsel1, address 0x4008 6e04) bit description bit symbol value description reset value 4:0 intpin4 pint interrupt 4: select the pin number within the gpio port selected by the portsel4 bit in this register. 0 7:5 portsel4 pin interrupt 4: select the port for the pin number to be selected in the intpin4 bits of this register. 0 0x0 gpio port 0 0x1 gpio port 1 0x2 gpio port 2 0x3 gpio port 3 0x4 gpio port 4 0x5 gpio port 5 0x6 gpio port 6 0x7 gpio port 7 12:8 intpin5 pint interrupt 5: select the pin number withi n the gpio port selected by the portsel5 bit in this register. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 219 of 1164 nxp semiconductors UM10430 chapter 13: lpc18xx system control unit (scu) 15:13 portsel5 pin interrupt 5: select the port for the pin number to be selected in the intpin5 bits of this register. 0 0x0 gpio port 0 0x1 gpio port 1 0x2 gpio port 2 0x3 gpio port 3 0x4 gpio port 4 0x5 gpio port 5 0x6 gpio port 6 0x7 gpio port 7 20:16 intpin6 pint interrup t 6: select the pin number within the gpio port selected by the portsel6 bit in this register. 0 23:21 portsel6 pin interrupt 6: select the port for the pin number to be selected in the intpin6 bits of this register. 0 0x0 gpio port 0 0x1 gpio port 1 0x2 gpio port 2 0x3 gpio port 3 0x4 gpio port 4 0x5 gpio port 5 0x6 gpio port 6 0x7 gpio port 7 28:24 intpin7 pint interrup t 7: select the pin number within the gpio port selected by the portsel7 bit in this register. 0 31:29 portsel7 pin interrupt 7: select the port for the pin number to be selected in the intpin7 bits of this register. 0 0x0 gpio port 0 0x1 gpio port 1 0x2 gpio port 2 0x3 gpio port 3 0x4 gpio port 4 0x5 gpio port 5 0x6 gpio port 6 0x7 gpio port 7 table 131. pin interrupt select register 1 (pintsel1, address 0x4008 6e04) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 220 of 1164 14.1 how to read this chapter remark: this chapter describes parts lpc1850/30/20/10 rev ?a?. remark: the vadc block is not available on the lpc1850/30/20/10 rev ?a?. 14.2 basic configuration the gima is configured as follows: ? see ta b l e 1 3 2 for clocking and power control. ? the gima is reset by the gima_rst (reset # ). ? the gima outputs are connected to the timer, sct, adc, and event router peripherals (see figure 24 and figure 25 ). 14.3 general description the global input multiplexer array (gima) prov ides an internal crosslink multiplexer array to connect and synchronize inputs from the pads or internal inputs to event driven peripherals such as the timers, the adc, or the event router. the gima has 30 outputs, each of which is conn ected to a peripheral function like a timer capture input or the adc conversion start inpu t. one register for eac h output configures the input and controls the synchronizer. UM10430 chapter 14: lpc18xx global inp ut multiplexer array (gima) rev. 00.13 ? 20 july 2011 user manual table 132. gima clocking and power control base clock branch clock maximum frequency clock to gima register interf ace base_m3_clk clk_m3_bus 150 mhz table 133. gima inputs input source possible connections to peripheral blocks 0 gpio6[28] vadc 1 gpio5[3] vadc 4:2 reserved - 5mcob2 vadc 6 pin ctin_0 t0 cap0 t1 cap0 t3 cap0 sct cap0 7 pin ctin_1 t0 cap1 t2 cap1 sct cap1 8 pin ctin_2 t0 cap2 sct cap2 9 pin ctin_3 t1 cap1 sct cap3 10 pin ctin_4 t1 cap2 sct cap4 11 pin ctin_5 t2 cap2 sct cap5 12 pin ctin_6 t3 cap1 sct cap6 13 pin ctin_7 t3 cap2 sct cap7 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 221 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14 t0 mat0 or ctout 0 vadc 15 t0 mat2 or ctout_2 event router channel 13 16 t0 mat3 or ctout 3 t1 cap3 17 t1 mat2 or ctout 6 event router channel 14 18 t1 mat3 or ctout 7 t2 cap3 19 t2 mat0 or ctout 8 vadc adc start conversion (start = 0x3) 20 t2 mat3 or ctout 11 t3 cap3 21 t3 mat2 or ctout 14 event router channel 16 22 t3 mat3 or ctout 15 t0 cap3 adc start conversion (start = 0x2) 23 u0 txd t1 cap1 sct cap3 24 u0 rxd t1 cap2 sct cap4 25 u2 txd t0 cap1 t2 cap1 sct cap1 26 u2 rxd t2 cap2 sct cap5 27 u3 txd t3 cap1 sct cap6 28 u3 rxd t3 cap2 sct cap7 29 i2s0_rx_mws t3 cap0 sct cap6 30 i2s0_tx_mws t3 cap1 sct cap6 31 sof0 t3 cap2 sct cap7 32 sof1 t3 cap3 sct cap7 36:33 reserved 37 i2s1_rx_mws t2 cap1 sct cap3 sct cap4 38 i2s1_tx_mws t2 cap2 sct cap3 sct cap4 39 pin t0_cap0 t0 cap0 40 pin t0_cap1 t0 cap1 41 pin t0_cap2 t0 cap2 42 pin t0_cap3 t0 cap3 43 pin t1_cap0 t1 cap0 44 pin t1_cap1 t1 cap1 45 pin t1_cap2 t1 cap2 46 pin t1_cap3 t1 cap3 47 pin t2_cap0 t2 cap0 48 pin t2_cap1 t2 cap1 49 pin t2_cap2 t2 cap2 50 pin t2_cap3 t2 cap3 51 pin t3_cap0 t3 cap0 52 pin t3_cap1 t3 cap1 table 133. gima inputs input source possible connections to peripheral blocks www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 222 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) each gima output control consists of five stages: 1. input selection 2. input inversion: inverts the path between source and destination. 3. asynchronous capture 4. synchronization to peripheral clock 5. pulse generation if the source generates shorter pulses than the output cl ock, the source pulses can be missed. in this case, the asynchronous capture stage can be used to capture the rising edge, the synchronizer stage synchronizes the edge to the peripheral clock and pulse generator stage can opt ionally generate a singe cycle pul se. (by default the generated pulse is two clock cycles.) remark: use the capture and the synchronizer sta ge together to avoid the creation of very short, spur ious pulses. 53 pin t3_cap2 t3 cap2 54 pin t3_cap3 t3 cap3 55 t0 mat0 vadc adc start0 conversion (adc cr register bit start = 0x2) 56 t0 mat2 event router channel 13 57 t0 mat3 t1 cap3 58 t1 mat2 event router channel 14 59 t1 mat3 t2 cap3 60 t2 mat0 vadc adc start1 conversion (adc cr register bit start = 0x3) 61 t2 mat3 t3 cap3 62 t3 mat2 event router channel 16 63 t3 mat3 t0 cap3 table 133. gima inputs input source possible connections to peripheral blocks www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 223 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) fig 23. gima input stages q q set clr d q q set clr d q q set clr d q q set clr d 1 2 3 cap sync pulse inv 0 output 4 input input input output_clk (peripheral) (peripheral clock) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 224 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.3.1 gima cross connections fig 24. cross connections between gima, sct, and timer0/1/2/3 timer0 inp0 outp0 outp1 outp2 outp3 outp4 outp5 outp6 outp7 outp8 outp9 outp10 outp11 outp12 outp13 outp14 outp15 inp1 inp2 inp3 inp4 inp5 inp6 inp7 inp0 outp0 outp1 outp2 outp3 inp1 inp2 inp3 timer1 inp0 outp0 outp1 outp2 outp3 inp1 inp2 inp3 timer2 inp0 outp0 outp1 outp2 outp3 inp1 inp2 inp3 timer3 inp0 outp0 outp1 outp2 outp3 inp1 inp2 inp3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 15 14 0 1 2 3 4 5 6 7 8 9 10 11 12 13 15 14 7 11 15 3 outp0 outp1 outp2 outp3 outp4 outp5 outp6 outp7 outp8 outp9 outp10 outp11 outp12 outp13 outp14 outp15 inp16 inp18 inp19 inp21 outp16 outp17 outp18 outp19 outp20 outp21 outp22 outp23 creg inp6..13 inp39..42 pinmux pinmux inp15 inp14 inp17 inp20 0 2 6 8 inp21 14 inp51..54 inp43..46 inp47..50 inp55 inp56 inp57 inp58 inp59 inp60 inp61 inp62 inp63 gima sct ctin_0..7 t0_cap0..3 t1_cap0..3 t2_cap0..3 t3_cap0..3 ctout_x www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 225 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4 register description fig 25. cross connections betw een gima, adc, and event router _ i2s0 rx_mws tx_mws usb0 sof_vf_indicator usb1 outp28 outp29 adc0/1 adctrig0 adctrig1 motocon outp25 outp26 outp27 inp0 outp24 vadc inp1 inp2 inp3 inp4 inp5 inp23 i2s1 rx_mws tx_mws inp24 inp25 inp26 inp27 inp28 inp29 inp30 div128 div128 inp31 inp32 inp33 inp34 inp35 inp36 div128 div128 sof_vf_indicator inp37 inp38 inp30 event router gima tbd mco2b mco2a adc start0 adc start1 adc start3 adc start4 adc start5 gpio6[28] gpio5[3] u0_txd u0_rxd u2_txd u2_rxd u3_txd u3_rxd table 134. register overview: gima (base address: 0x400c 7000) name access address offset description reset value cap0_0_in r/w 0x000 timer 0 cap0_0 capture input multiplexer (gima output 0) 0 cap0_1_in r/w 0x004 timer 0 cap0_1 capture input multiplexer (gima output 1) 0 cap0_2_in r/w 0x008 timer 0 cap0_2 capture input multiplexer (gima output 2) 0 cap0_3_in r/w 0x00c timer 0 cap0_3 capture input multiplexer (gima output 3) 0 cap1_0_in r/w 0x010 timer 1 cap1_0 capture input multiplexer (gima output 4) 0 cap1_1_in r/w 0x014 timer 1 cap1_1 capture input multiplexer (gima output 5) 0 cap1_2_in r/w 0x018 timer 1 cap1_2 capture input multiplexer (gima output 6) 0 cap1_3_in r/w 0x01c timer 1 cap1_3 capture input multiplexer (gima output 7) 0 cap2_0_in r/w 0x020 timer 2 cap2_0 capture input multiplexer (gima output 8) 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 226 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) cap2_1_in r/w 0x024 timer 2 cap2_1 capture input multiplexer (gima output 9) 0 cap2_2_in r/w 0x028 timer 2 cap2_2 capture input multiplexer (gima output 10) 0 cap2_3_in r/w 0x02c timer 2 cap2_3 capture input multiplexer (gima output 11) 0 cap3_0_in r/w 0x030 timer 3 cap3_0 capture input multiplexer (gima output 12) 0 cap3_1_in r/w 0x034 timer 3 cap3_1 capture input multiplexer (gima output 13) 0 cap3_2_in r/w 0x038 timer 3 cap3_2 capture input multiplexer (gima output 14) 0 cap3_3_in r/w 0x03c timer 3 cap3_3 capture input multiplexer (gima output 15) 0 ctin_0_in r/w 0x040 sct ctin_0 capture input multiplexer (gima output 16) 0 ctin_1_in r/w 0x044 sct ctin_1 capture input multiplexer (gima output 17) 0 ctin_2_in r/w 0x048 sct ctin_2 capture input multiplexer (gima output 18) 0 ctin_3_in r/w 0x04c sct ctin_3 capture input multiplexer (gima output 19) 0 ctin_4_in r/w 0x050 sct ctin_4 capture input multiplexer (gima output 20) 0 ctin_5_in r/w 0x054 sct ctin_5 capture input multiplexer (gima output 21) 0 ctin_6_in r/w 0x058 sct ctin_6 capture input multiplexer (gima output 22) 0 ctin_7_in r/w 0x05c sct ctin_7 capture input multiplexer (gima output 23) 0 vadc_trigger_in r/w 0x060 vadc trigger input multiplexer (gima output 24) 0 eventrouter_13_in r/w 0x064 event rout er input 13 multiplexer (gima output 25) 0 eventrouter_14_in r/w 0x068 event rout er input 14 multiplexer (gima output 26) 0 eventrouter_16_in r/w 0x06c event rout er input 16 multiplexer (gima output 27) 0 adcstart0_in r/w 0x070 adc start0 input multiplexer (gima output 28) 0 adcstart1_in r/w 0x074 adc start1 input multiplexer (gima output 29) 0 table 134. register overview: gima (base address: 0x400c 7000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 227 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.1 timer 0 cap0_0 capture input multiplexer (cap0_0_in) 14.4.2 timer 0 cap0_1 capture input multiplexer (cap0_1_in) table 135. timer 0 cap0_0 capture input mult iplexer (cap0_0_in, address 0x400c 7000) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_0 0x1 reserved 0x2 t0_cap0 31:8 - reserved table 136. timer 0 cap0_1 capture input mult iplexer (cap0_1_in, address 0x400c 7004) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_1 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 228 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.3 timer 0 cap0_2 capture input multiplexer (cap0_2_in) 14.4.4 timer 0 cap0_3 capture input multiplexer (cap0_3_in) 0x1 u2_txd 0x2 t0_cap1 31:8 - reserved table 136. timer 0 cap0_1 capture input mult iplexer (cap0_1_in, address 0x400c 7004) bit description bit symbol value description reset value table 137. timer 0 cap0_2 capture input mult iplexer (cap0_2_in, address 0x400c 7008) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_2 0x1 reserved 0x2 t0_cap2 31:8 - reserved table 138. timer 0 cap0_3 capture input multip lexer (cap0_3_in, address 0x400c 700c) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 229 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.5 timer 1 cap1_0 capture input multiplexer (cap1_0_in) 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctout_15 or t3_mat3 0x1 t0_cap3 0x2 t3_mat3 31:8 - reserved table 138. timer 0 cap0_3 capture input multip lexer (cap0_3_in, address 0x400c 700c) bit description bit symbol value description reset value table 139. timer 1 cap1_0 capture input mult iplexer (cap1_0_in, address 0x400c 7010) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_0 0x1 reserved 0x2 t1_cap0 31:8 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 230 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.6 timer 1 cap1_1 capture input multiplexer (cap1_1_in) 14.4.7 timer 1 cap1_2 capture input multiplexer (cap1_2_in) table 140. timer 1 cap1_1 capture input mult iplexer (cap1_1_in, address 0x400c 7014) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_3 0x1 u0_txd 0x2 t1_cap1 31:8 - reserved table 141. timer 1 cap1_2 capture input mult iplexer (cap1_2_in, address 0x400c 7018) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_4 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 231 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.8 timer 1 cap1_3 capture input multiplexer (cap1_3_in) 14.4.9 timer 2 cap2_0 capture input multiplexer (cap2_0_in) 0x1 u0_rxd 0x2 t1_cap2 31:8 - reserved table 141. timer 1 cap1_2 capture input mult iplexer (cap1_2_in, address 0x400c 7018) bit description bit symbol value description reset value table 142. timer 1 cap1_3 capture input multip lexer (cap1_3_in, address 0x400c 701c) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctout_3 or t0_mat3 0x1 t1_cap3 0x2 t0_mat3 31:8 - reserved table 143. timer 2 cap2_0 capture input mult iplexer (cap2_0_in, address 0x400c 7020) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 232 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.10 timer 2 cap2_1 capture input multiplexer (cap2_1_in) 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x4 to 0xf are reserved. 0x0 ctin_0 0x1 reserved 0x2 t2_cap0 31:8 - reserved table 143. timer 2 cap2_0 capture input mult iplexer (cap2_0_in, address 0x400c 7020) bit description bit symbol value description reset value table 144. timer 2 cap2_1 capture input mult iplexer (cap2_1_in, address 0x400c 7024) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x4 to 0xf are reserved. 0x0 ctin_1 0x1 u2_txd 0x2 - i2s1_rx_mws 0x3 t2_cap1 31:8 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 233 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.11 timer 2 cap2_2 capture input multiplexer (cap2_2_in) 14.4.12 timer 2 cap2_3 capture input multiplexer (cap2_3_in) table 145. timer 2 cap2_2 capture input mult iplexer (cap2_2_in, address 0x400c 7028) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x4 to 0xf are reserved. 0x0 ctin_5 0x1 u2_rxd 0x2 - i2s1_tx_mws 0x3 t2_cap2 31:8 - reserved table 146. timer 2 cap2_3 capture input multip lexer (cap2_3_in, address 0x400c 702c) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 234 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.13 timer 3 cap3_0 capture input multiplexer (cap3_0_in) 14.4.14 timer 3 cap3_1 capture input multiplexer (cap3_1_in) 0x0 ctout_7 or t1_mat3 0x1 t2_cap3 0x2 t1_mat3 31:8 - reserved table 146. timer 2 cap2_3 capture input multip lexer (cap2_3_in, address 0x400c 702c) bit description bit symbol value description reset value table 147. timer 3 cap3_0 capture input mult iplexer (cap3_0_in, address 0x400c 7030) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_0 0x1 i2s0_rx_mws 0x2 t3_cap0 31:8 - reserved table 148. timer 3 cap3_1 capture input mult iplexer (cap3_1_in, address 0x400c 7034) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 235 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.15 timer 3 cap3_2 capture input multiplexer (cap3_2_in) 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x4 to 0xf are reserved. 0x0 ctin_6 0x1 u3_txd 0x2 tbd - i2s0_tx_mws 0x3 t3_cap1 31:8 - reserved table 148. timer 3 cap3_1 capture input mult iplexer (cap3_1_in, address 0x400c 7034) bit description bit symbol value description reset value table 149. timer 3 cap3_2 capture input mult iplexer (cap3_2_in, address 0x400c 7038) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x4 to 0xf are reserved. 0x0 ctin_7 0x1 u3_rxd 0x2 sof0 (start-of-frame usb0) 0x3 t3_cap2 31:8 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 236 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.16 timer 3 cap3_3 capture input multiplexer (cap3_3_in) 14.4.17 sct ctin_0 capture i nput multiplexer (ctin_0_in) table 150. timer 3 cap3_3 capture input multip lexer (cap3_3_in, address 0x400c 703c) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x4 to 0xf are reserved. 0x0 ctout11 or t2_mat3 0x1 sof1 0x2 t3_cap3 0x3 t2_mat3 31:8 - reserved table 151. sct ctin_0 capture input multiplexer (ctin_0_in, address 0x400c 7040) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 237 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.18 sct ctin_1 capture i nput multiplexer (ctin_1_in) 14.4.19 sct ctin_2 capture i nput multiplexer (ctin_2_in) 0x1 reserved 0x2 reserved 31:8 - reserved table 151. sct ctin_0 capture input multiplexer (ctin_0_in, address 0x400c 7040) bit description bit symbol value description reset value table 152. sct ctin_1 capture input multiplexer (ctin_1_in, address 0x400c 7044) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_1 0x1 u2_txd 0x2 reserved 31:8 - reserved table 153. sct ctin_2 capture input multiplexer (ctin_2_in, address 0x400c 7048) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 238 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.20 sct ctin_3 capture i nput multiplexer (ctin_3_in) 14.4.21 sct ctin_4 capture i nput multiplexer (ctin_4_in) 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_2 0x1 reserved 0x2 reserved 31:8 - reserved table 153. sct ctin_2 capture input multiplexer (ctin_2_in, address 0x400c 7048) bit description bit symbol value description reset value table 154. sct ctin_3 capture input multiplexer (ctin_3_in, address 0x400c 704c) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x4 to 0xf are reserved. 0x0 ctin_3 0x1 u0_txd 0x2 reserved 0x3 reserved 31:8 - reserved table 155. sct ctin_4 capture input multiplexer (ctin_4_in, address 0x400c 7050) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 239 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.22 sct ctin_5 capture i nput multiplexer (ctin_5_in) 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x4 to 0xf are reserved. 0x0 ctin_4 0x1 u0_rxd 0x2 tbd - i2s1_rx_mws1 0x3 tbd - i2s1_tx_mws1 31:8 - reserved table 155. sct ctin_4 capture input multiplexer (ctin_4_in, address 0x400c 7050) bit description bit symbol value description reset value table 156. sct ctin_5 capture input multiplexer (ctin_5_in, address 0x400c 7054) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctin_5 0x1 u2_rxd 0x2 reserved 31:8 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 240 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.23 sct ctin_6 capture i nput multiplexer (ctin_6_in) 14.4.24 sct ctin_7 capture i nput multiplexer (ctin_7_in) table 157. sct ctin_6 capture input multiplexer (ctin_6_in, address 0x400c 7058) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x4 to 0xf are reserved. 0x0 ctin_6 0x1 u3_txd 0x2 tbd - i2s0_rx_mws 0x3 tbd - i2s0_tx_mws 31:8 - reserved table 158. sct ctin_7 capture input multiplexer (ctin_7_in, address 0x400c 705c) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x4 to 0xf are reserved. 0x0 ctin_7 0x1 u3_rxd www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 241 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.25 vadc trigger input mu ltiplexer (vadc_trigger_in) 14.4.26 event router input 13 multiplexer (eventrouter_13_in) 0x2 sof0 (start-of-frame usb0) 0x3 sof1 (start-of-frame usb1) 31:8 - reserved table 158. sct ctin_7 capture input multiplexer (ctin_7_in, address 0x400c 705c) bit description bit symbol value description reset value table 159. adc trigger input multiplexer (v adc_trigger_in, address 0x400c 7060) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0xa to 0xf are reserved. 0x0 gpio6[28] 0x1 gpio5[3] 0x2 reserved 0x3 reserved 0x4 reserved 0x5 mcob2 0x6 ctout_0 or t0_mat0 0x7 ctout_8 or t2_mat0 0x8 t0_mat0 0x9 t2_mat0 31:8 - reserved table 160. event router input 13 multiplexe r (eventrouter_13_in, address 0x400c 7064) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 242 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.27 event router input 14 multiplexer (eventrouter_14_in) 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctout_2 or t0_mat2 0x1 reserved 0x2 t0_mat2 31:8 - reserved table 160. event router input 13 multiplexe r (eventrouter_13_in, address 0x400c 7064) bit description bit symbol value description reset value table 161. event router input 14 multiplexe r (eventrouter_14_in, address 0x400c 7068) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x3 to 0xf are reserved. 0x0 ctout_6 or t1_mat2 0x1 reserved 0x2 t1_mat2 31:8 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 243 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.28 event router input 16 multiplexer (eventrouter_16_in) 14.4.29 adc start0 input multiplexer (adcstart0_in) table 162. event router inpu t 16multiplexer (eventrouter_16 _in, address 0x400c 706c) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x2 to 0xf are reserved. 0x0 ctout_14 or t3_mat2 0x1 t3_mat2 31:8 - reserved table 163. adc start0 input multiplexer (adc start0_in, address 0x400c 7070) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x2 to 0xf are reserved. 0x0 ctout_15 or t3_mat3 0x1 t0_mat0 31:8 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 244 of 1164 nxp semiconductors UM10430 chapter 14: lpc18xx global input multiplexer array (gima) 14.4.30 adc start1 input multiplexer (adcstart1_in) table 164. adc start1 input multiplexer (adc start1_in, address 0x400c 7074) bit description bit symbol value description reset value 0 inv invert input 0 not inverted. 1 input inverted. 1 edge enable rising edge detection 0 no edge detection. 1 rising edge detection enabled. 2 synch enable synchronization 0 disable synchronization. 1 enable synchronization. 3 pulse enable single pulse generation. 0 disable single pulse generation. 1 enable single pulse generation. 7:4 select select input. values 0x2 to 0xf are reserved. 0x0 ctout_8 or t2_mat0 0x1 t2_mat0 31:8 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 245 of 1164 15.1 how to read this chapter remark: this chapter describ es the gpio of the lpc18xx rev ?a? parts. for the gpio block of the lpc18xx rev ?-? parts, see section 42.8 . all gpio register bit descriptions refer to up to 31 pins on each gpio port. depending on the package type, not all pins are available, and the corresponding bits in the gpio registers are reserved (see ta b l e 1 6 5 ). 15.2 basic configuration the gpio blocks share a common clock and reset connection and are configured as follows: ? see ta b l e 1 6 6 for clocking and power control. ? the gpio is reset by a gpio_rst (reset #28). ? all gpio pins are set to input by default. ? for the pin interrupts, select up to 8 external interrupt pins from all gpio port pins in the scu (see table 130 and table 131 ). the pin interrupts must be enabled in the nvic (see ta b l e 1 3 ). ? the gpio group interrupts must be enabled in the nvic (see ta b l e 1 3 ). UM10430 chapter 15: lpc18xx gpio rev. 00.13 ? 20 july 2011 user manual table 165. gpio pins available lbga256 tfbga180 tfbga100 lqfp208 lqfp144 lqfp100 gpio port 0 gpio0[15:0] gpio0[15:0] gpio0[4:0]; gpio0[15:6] gpio0[15:0] gpio0[15:0] gpio0[4:0]; gpio0[15:6] gpio port 1 gpio1[15:0] gpio1[15:0] gpio1 [15:0] gpio1[15:0] gpio 1[15:0] gpio1[15:0] gpio port 2 gpio2[15:0] gpio2[15:0] - gpio2[15:0] gpio2[15:0] - gpio port 3 gpio3[15:0] gpio3[15:0] gpio3[1:0]; gpio3[5:3]; gpio3[7] gpio3[15:0] gpio3[15:0] gpio3[1:0]; gpio3[5:3]; gpio3[7] gpio port 4 gpio4[15:0] gpio4[15:0] - gpio4[15:0] gpio4[11] - gpio port 5 gpio5[26:0] gpio5[26:0] gpio5[11:0] gpio5[26:0] gpio5[16:0]; gpio5[18] gpio5[11:0] gpio port 6 gpio6[30:0] gpio6[30:25] - gpio6[30:0] - - gpio port 7 gpio7[25:0] gpio7[4:0] - gpio7[25:0] - - table 166. gpio clocking and power control base clock branch clock maximum frequency gpio, gpio pin interrupt, gpio group0 interrupt, gpio group1 interrupt base_m3_clk clk_m3_gpio 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 246 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 15.3 features 15.3.1 gpio pin interrupt features ? up to 8 pins can be selected from all gpio pins as edge- or level-sensitive interrupt requests. each request creates a separate interrupt in the nvic. ? edge-sensitive interrupt pi ns can interrupt on rising or falling edges or both. ? level-sensitive interrupt pins can be high- or low-active. 15.3.2 gpio group interrupt features ? the inputs from any number of gpio pins can be enabled to contribute to a combined group interrupt. ? the polarity of each input enabled for the group interrupt can be configured high or low. ? enabled interrupts can be logically combined through an or or and operation. ? two group interrupts are supported to reflect two distinct interrupt patterns. ? the gpio group interrupts can wake up the part from sleep, deep-sleep or power-down modes. 15.3.3 gpio port features ? gpio pins can be configured as input or output by software. ? all gpio pins default to inputs with interrupt disabled at reset. ? pin registers allow pins to be sensed and set individually. 15.4 introduction the gpio pins can be used in several ways to set pins as inputs or outputs and use the inputs as combinations of leve l and edge sensitive interrupts. 15.4.1 gpio pin interrupts from all available gpio pins, up to eight pins can be selected in the system control block to serve as external interrupt pins (see ). the external interrupt pins are connected to eight individual interrupts in the nvic and are created ba sed on rising or falling edges or on the input level on the pin. 15.4.2 gpio group interrupt for each port/pin connected to one of the two the gpio grouped interrupt blocks (group0 and group1), the gpio grouped interrupt registers determine which pins are enabled to generate interrupts and what the acti ve polarities of each of those inputs are. the gpio grouped in terrupt registers also se lect whether the interrup t output will be level or edge triggered and whether it will be based on the or or th e and of all of the enabled inputs. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 247 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio when the designated pattern is detected on the selected input pins, the gpio grouped interrupt block will genera te an interrupt. if the part is in a power-savings mode it will first asynchronously wake the part up prior to asserting the interrupt request. the interrupt request line can be cleared by writing a one to the interrupt status bit in the control register. 15.4.3 gpio port the gpio port registers can be used to configure each gpio pin as input or output and read the state of each pin if the pin is configured as input or set the state of each pin if the pin is configured as output. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 248 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 15.5 register description the gpio consists of the following blocks: ? the gpio pin interrupts block at address 0x4008 7000. registers in this block enable the up to 8 pin interrupts selected in (see ) and configure the level and edge sensitivity for each selected pin interrupt. the gpio interrupt registers are listed in and ? the gpio group0 interrupt block at addr ess 0x4008 8000. registers in this block allow to configure any pin on port 0 and 1 to contribute to a combined interrupt. the gpio group0 registers are listed in table 168 and section 15.5.2 . ? the gpio group1 interrupt block at addr ess 0x4008 9000. registers in this block allow to configure any pin on port 0 and 1 to contribute to a combined interrupt. the gpio group1 registers are listed in table 169 and section 15.5.2 . ? the gpio port block at address 0x400f 4000. registers in this block allow to read and write to port pins and configure port pins as inputs or outputs.the gpio port registers are listed in table 170 and section 15.5.3 . note: in all gpio registers, bits that are not shown are reserved . table 167. register overview: gpio pin interrupts (base address: 0x4008 7000) name access address offset description reset value isel r/w 0x000 pin interrupt mode register 0 ienr r/w 0x004 pin interrupt enable (rising) register 0 sienr wo 0x008 set pin interrupt enable (rising) register na cienr wo 0x00c clear pin interrupt enable (rising) register na ienf r/w 0x010 pin interrupt enable falling edge / active level register 0 sienf wo 0x014 set pin interru pt enable falling edge / active level register na cienf wo 0x018 clear pin interrupt enable falling edge / active level address na rise r/w 0x01c pin interrupt rising edge register 0 fall r/w 0x020 pin interrupt falling edge register 0 ist r/w 0x024 pin interrupt status register 0 table 168. register overview: gpio group0 interrupt (base address 0x4008 8000) name access address offset description reset value ctrl r/w 0x000 gpio grouped in terrupt control register 0 port_pol0 r/w 0x020 gpio grouped interrupt port 0 polarity register 0xffff ffff port_pol1 r/w 0x024 gpio grouped interrupt port 1 polarity register 0xffff ffff port_pol2 r/w 0x028 gpio grouped interrupt port 2 polarity register 0xffff ffff www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 249 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio port_pol3 r/w 0x02c gpio grouped interrupt port 3 polarity register 0xffff ffff port_pol4 r/w 0x030 gpio grouped interrupt port 4 polarity register 0xffff ffff port_pol5 r/w 0x034 gpio grouped interrupt port 5 polarity register 0xffff ffff port_pol6 r/w 0x038 gpio grouped interrupt port 6 polarity register 0xffff ffff port_pol7 r/w 0x03c gpio grouped interrupt port 7 polarity register 0xffff ffff port_ena0 r/w 0x040 gpio grouped interrupt port 0 enable register 0 port_ena1 r/w 0x044 gpio grouped interrupt port 1 enable register 0 port_ena2 r/w 0x048 gpio grouped interrupt port 2 enable register 0 port_ena3 r/w 0x04c gpio grouped interrupt port 3 enable register 0 port_ena4 r/w 0x050 gpio grouped interrupt port 4 enable register 0 port_ena5 r/w 0x054 gpio grouped interrupt port 5 enable register 0 port_ena6 r/w 0x058 gpio grouped interrupt port 5 enable register 0 port_ena7 r/w 0x05c gpio grouped interrupt port 5 enable register 0 table 169. register overview: gpio group1 interrupt (base address 0x4008 9000) name access address offset description reset value ctrl r/w 0x000 gpio grouped in terrupt control register 0 port_pol0 r/w 0x020 gpio grouped interrupt port 0 polarity register 0xffff ffff port_pol1 r/w 0x024 gpio grouped interrupt port 1 polarity register 0xffff ffff port_pol2 r/w 0x028 gpio grouped interrupt port 2 polarity register 0xffff ffff port_pol3 r/w 0x02c gpio grouped interrupt port 3 polarity register 0xffff ffff port_pol4 r/w 0x030 gpio grouped interrupt port 4 polarity register 0xffff ffff port_pol5 r/w 0x034 gpio grouped interrupt port 5 polarity register 0xffff ffff port_pol6 r/w 0x038 gpio grouped interrupt port 6 polarity register 0xffff ffff port_pol7 r/w 0x03c gpio grouped interrupt port 7 polarity register 0xffff ffff port_ena0 r/w 0x040 gpio grouped interrupt port 0 enable register 0 port_ena1 r/w 0x044 gpio grouped interrupt port 1 enable register 0 port_ena2 r/w 0x048 gpio grouped interrupt port 2 enable register 0 port_ena3 r/w 0x04c gpio grouped interrupt port 3 enable register 0 port_ena4 r/w 0x050 gpio grouped interrupt port 4 enable register 0 table 168. register overview: gpio group0 interrupt (base address 0x4008 8000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 250 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio gpio port addresses can be read and wri tten as bytes, halfwords, or words. port_ena5 r/w 0x054 gpio grouped interrupt port 5 enable register 0 port_ena6 r/w 0x058 gpio grouped interrupt port 5 enable register 0 port_ena7 r/w 0x05c gpio grouped interrupt port 5 enable register 0 table 169. register overview: gpio group1 interrupt (base address 0x4008 9000) name access address offset description reset value table 170. register overview: gpio port (base address 0x400f 4000) name access address offset description reset value width b0 to b31 r/w 0x0000 to x001f byte pin registers port 0; pins pio0_0 to pio0_31 ext [1] byte (8 bit) b32 to bx r/w 0x0020 to 0x003f byte pin registers port 1 ext [1] byte (8 bit) b64 to bx r/w 0x0040 to 0x005f byte pin registers port 2 ext [1] byte (8 bit) b96 to bx r/w 0x0060 to 0x007f byte pin registers port 3 ext [1] byte (8 bit) b128 to bx r/w 0x0080 to 0x009f byte pin registers port 4 ext [1] byte (8 bit) b160 to bx r/w 0x00a0 to 0x00bf byte pin registers port 5 ext [1] byte (8 bit) b192 to bx r/w 0x00c0 to0x00df byte pin registers port 6 ext [1] byte (8 bit) b224 to bx r/w 0x00e0 to 0x00fc byte pin registers port 7 ext [1] byte (8 bit) w0 to wx r/w 0x1000 to 0x107c word pin registers port 0 ext [1] word (32 bit) w32 to wx r/w 0x1080 to 0x10fc word pin registers port 1 ext [1] word (32 bit) w64 to wx r/w 0x1100 to 0x11fc word pin registers port 2 ext [1] word (32 bit) w96 to wx r/w 0x1180 to 0x11fc word pin registers port 3 ext [1] word (32 bit) w128 to wx r/w 0x1200 to 0x12fc word pin registers port 4 ext [1] word (32 bit) w160 to wx r/w 0x1280 to 0x12fc word pin registers port 5 ext [1] word (32 bit) w192 to wx r/w 0x1300 to 0x137c word pin registers port 6 ext [1] word (32 bit) w224 to wx r/w 0x1380 to 0x13fc word pin registers port 7 ext [1] word (32 bit) dir0 r/w 0x2000 direction registers port 0 0 word (32 bit) dir1 r/w 0x2004 direction registers port 1 0 word (32 bit) dir2 r/w 0x2008 direction registers port 2 0 word (32 bit) dir3 r/w 0x200c direction registers port 3 0 word (32 bit) dir4 r/w 0x2010 direction registers port 4 0 word (32 bit) dir5 r/w 0x2014 direction registers port 5 0 word (32 bit) dir6 r/w 0x2018 direction registers port 6 0 word (32 bit) dir7 r/w 0x201c direction registers port 7 0 word (32 bit) mask0 r/w 0x2080 mask register port 0 0 word (32 bit) mask1 r/w 0x2084 mask register port 1 0 word (32 bit) mask2 r/w 0x2088 mask register port 2 0 word (32 bit) mask3 r/w 0x208c mask register port 3 0 word (32 bit) mask4 r/w 0x2090 mask register port 4 0 word (32 bit) mask5 r/w 0x2094 mask register port 5 0 word (32 bit) mask6 r/w 0x2098 mask register port 6 0 word (32 bit) mask7 r/w 0x209c mask register port 7 0 word (32 bit) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 251 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio pin0 r/w 0x2100 port pin register port 0 ext [1] word (32 bit) pin1 r/w 0x2104 port pin register port 1 ext [1] word (32 bit) pin2 r/w 0x2108 port pin register port 2 ext [1] word (32 bit) pin3 r/w 0x210c port pin register port 3 ext [1] word (32 bit) pin4 r/w 0x2110 port pin register port 4 ext [1] word (32 bit) pin5 r/w 0x2114 port pin register port 5 ext [1] word (32 bit) pin6 r/w 0x2118 port pin register port 6 ext [1] word (32 bit) pin7 r/w 0x211c port pin register port 7 ext [1] word (32 bit) mpin0 r/w 0x2180 masked port register port 0 ext [1] word (32 bit) mpin1 r/w 0x2184 masked port register port 1 ext [1] word (32 bit) mpin2 r/w 0x2188 masked port register port 2 ext [1] word (32 bit) mpin3 r/w 0x218c masked port register port 3 ext [1] word (32 bit) mpin4 r/w 0x2190 masked port register port 4 ext [1] word (32 bit) mpin5 r/w 0x2194 masked port register port 5 ext [1] word (32 bit) mpin6 r/w 0x2198 masked port register port 6 ext [1] word (32 bit) mpin7 r/w 0x219c masked port register port 7 ext [1] word (32 bit) set0 r/w 0x2200 write: set register for port 0 read: output bits for port 0 0 word (32 bit) set1 r/w 0x2204 write: set register for port 1 read: output bits for port 1 0 word (32 bit) set2 r/w 0x2208 write: set register for port 2 read: output bits for port 2 0 word (32 bit) set3 r/w 0x220c write: set register for port 3 read: output bits for port 3 0 word (32 bit) set4 r/w 0x2210 write: set register for port 4 read: output bits for port 4 0 word (32 bit) set5 r/w 0x2214 write: set register for port 5 read: output bits for port 5 0 word (32 bit) set6 r/w 0x2218 write: set register for port 6 read: output bits for port 6 0 word (32 bit) set7 r/w 0x221c write: set register for port 7 read: output bits for port 7 0 word (32 bit) clr0 wo 0x2280 clear port 0 na word (32 bit) clr1 wo 0x2284 clear port 1 na word (32 bit) clr2 wo 0x2288 clear port 2 na word (32 bit) clr3 wo 0x228c clear port 3 na word (32 bit) clr4 wo 0x2290 clear port 4 na word (32 bit) clr5 wo 0x2294 clear port 5 na word (32 bit) clr6 wo 0x2298 clear port 6 na word (32 bit) clr7 wo 0x229c clear port 7 na word (32 bit) not0 wo 0x2300 toggle port 0 na word (32 bit) not1 wo 0x2304 toggle port 1 na word (32 bit) table 170. register overview: gpio port (base address 0x400f 4000) name access address offset description reset value width www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 252 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio [1] ?ext? in this table and subsequent tables indicates that th e data read after reset depends on the state of the pin, which in turn may depend on an external source. 15.5.1 gpio pin interrupt s register description 15.5.1.1 pin interrupt mode register for each of the 8 pin interrupts selected in table 130 and table 131 , one bit in the isel register determines whether the interrupt is edge or level sensitive. 15.5.1.2 pin interrupt level (rising edge interrupt) enable register for each of the 8 pin interrupts selected in the pintsel registers (see table 130 and table 131 ), one bit in the ienr register enabl es the interrupt depending on the pin interrupt mode configured in the isel register: ? if the pin interrupt mode is edge sensitive (pmode = 0), the rising edge interrupt is enabled. ? if the pin interrupt mode is level sensitive (p mode = 1), the level in terrupt is enabled. the pinten_f register confi gures the active level (high or low) for th is interrupt. not2 wo 0x2308 toggle port 2 na word (32 bit) not3 wo 0x230c toggle port 3 na word (32 bit) not4 wo 0x2310 toggle port 4 na word (32 bit) not5 wo 0x2314 toggle port 5 na word (32 bit) not6 wo 0x2318 toggle port 6 na word (32 bit) not7 wo 0x231c toggle port 7 na word (32 bit) table 170. register overview: gpio port (base address 0x400f 4000) name access address offset description reset value width table 171. pin interrupt mode register (isel, address 0x4008 7000) bit description bit symbol description reset value access 7:0 pmode selects the interrupt mode for each pin interrupt. bit n configures the pin interr upt selected in pintseln. 0 = edge sensitive 1 = level sensitive 0r/w 31:8 - reserved. - - table 172. pin interrupt level (rising edge inte rrupt enable) register (ienr, address 0x4008 7004) bit description bit symbol description reset value access 7:0 enrl enables the rising edge or level interrupt for each pin interrupt. bit n configures the pin interrupt selected in pintseln. 0 = disable rising edge or level interrupt. 1 = enable rising edge or level interrupt. 0r/w 31:8 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 253 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 15.5.1.3 pin interrupt level (rising edge interrupt) set register for each of the 8 pin interrupts selected in the pintsel registers (see table 130 and table 131 ), one bit in the sienr register sets the corresponding bit in the ienr register depending on the pin interrupt mode configured in the pintmode register: ? if the pin interrupt mode is edge sensitive (pmode = 0), the rising edge interrupt is set. ? if the pin interrupt mode is level sensitive (pmode = 1), the level inte rrupt is set. 15.5.1.4 pin interrupt level (rising edge interrupt) clear register for each of the 8 pin interrupts selected in the pintsel registers (see table 130 and table 131 ), one bit in the cienr register clears the corresponding bit in the ienr register depending on the pin interrupt mode configured in the isel register: ? if the pin interrupt mode is edge sensitive (pmode = 0), the rising edge interrupt is cleared. ? if the pin interrupt mode is le vel sensitive (pmode = 1), t he level interrupt is cleared. 15.5.1.5 pin interrupt active level (falling edge interrupt enable) register for each of the 8 pin interrupts selected in the pintsel registers (see table 130 and table 131 ), one bit in the pintsen_f register enable s the falling edge interrupt or the configures the level sensitivity depending on the pin interrupt mode configured in the isel register: ? if the pin interrupt mode is edge sensitive (pmode = 0), the falling edge interrupt is enabled. ? if the pin interrupt mode is le vel sensitive (pmode = 1), the active level of the level interrupt (high or low) is configured. table 173. pin interrupt level (rising edge interrupt) set register (sienr, address 0x4008 7008) bit description bit symbol description reset value access 7:0 setenrl ones written to this address set bits in the pinten_r, thus enabling interrupts. bit n sets bit n in the pinten_r register. 0 = no operation. 1 = enable rising edge or level interrupt. na wo 31:8 - reserved. - - table 174. pin interrupt level (rising edge in terrupt) clear register (pcienr, address 0x4008 700c) bit description bit symbol description reset value access 7:0 cenrl ones written to this addr ess clear bits in the ienr, thus disabling the interrupts. bit n clears bit n in the ienr register. 0 = no operation. 1 = disable rising edge or level interrupt. na wo 31:8 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 254 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 15.5.1.6 pin interrupt active level (falling edge interrupt) set register for each of the 8 pin interrupts selected in the pintsel registers (see table 130 and table 131 ), one bit in the sienf register sets th e corresponding bit in the ienf register depending on the pin interrupt mode configured in the isel register: ? if the pin interrupt mode is edge sensitive (pmode = 0), the falling edge interrupt is set. ? if the pin interrupt mode is level sensitive (pmode = 1), the high-active interrupt is selected. 15.5.1.7 pin interrupt active level (falling edge interrupt) clear register for each of the 8 pin interrupts selected in the pintsel registers (see table 130 and table 131 ), one bit in the cienf register sets th e corresponding bit in the ienf register depending on the pin interrupt mode configured in the isel register: ? if the pin interrupt mode is edge sensitive (pmode = 0), the falling edge interrupt is cleared. ? if the pin interrupt mode is level sensitive (pmode = 1), the low-active interrupt is selected. table 175. pin interrupt active level (falling edge interrupt enable) register (ienf, address 0x4008 7010) bit description bit symbol description reset value access 7:0 enaf enables the falling edge or conf igures the active level interrupt for each pin interrupt. bit n confi gures the pin interrupt selected in pintseln. 0 = disable falling edge interrupt or set active interrupt level low. 1 = enable falling edge interrupt enabled or set active interrupt level high. 0r/w 31:8 - reserved. - - table 176. pin interrupt active level (falling edge interrupt) set regi ster (sienf, address 0x4008 7014) bit description bit symbol description reset value access 7:0 setenaf ones written to this address set bits in the ienf, thus enabling interrupts. bit n sets bit n in the ienf register. 0 = no operation. 1 = select high-active interrupt or enable falling edge interrupt. na wo 31:8 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 255 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 15.5.1.8 pin interrupt rising edge register this register contains ones for pin interrup ts selected in the pintsel registers (see table 130 and table 131 ) on which a rising edge has been detected. writing ones to this register clears rising edge dete ction. ones in this register assert an interrupt request for pins that are enabled for rising-edge interrupts. all edges are detected for all pins selected by the pintsel registers, regardless of whether they are interrupt-enabled. 15.5.1.9 pin interrupt falling edge register this register contains ones for pin interrup ts selected in the pintsel registers (see table 130 and table 131 ) on which a falling edge has been detected. writing ones to this register clears falling edge detec tion. ones in this register assert an in terrupt request for pins that are enabled for falling-edge interrupts. all edges are detected for all pins selected by the pintsel registers, regard less of whether they are interrupt-enabled. table 177. pin interrupt active level (falling edge interrupt) clear register (cienf, address 0x4008 7018) bit description bit symbol description reset value access 7:0 cenaf ones written to this address clears bits in the ienf, thus disabling interrupts. bit n clears bit n in the ienf register. 0 = no operation. 1 = low-active interrupt selected or falling edge interrupt disabled. na wo 31:8 - reserved. - - table 178. pin interrupt rising edge register (rise, address 0x4008 701c) bit description bit symbol description reset value access 7:0 rdet rising edge detect. bit n detec ts the rising edge of the pin selected in pintseln. read 0: no rising edge has been detected on this pin since reset or the last time a one was written to this bit. write 0: no operation. read 1: a rising edge has been detected since reset or the last time a one was written to this bit. write 1: clear rising edge detection for this pin. 0r/w 31:8 - reserved. - - table 179. pin interrupt falling edge register (fall, address 0x4008 7020) bit description bit symbol description reset value access 7:0 fdet falling edge detect. bit n detects the falling edge of the pin selected in pintseln. read 0: no falling edge has been detected on this pin since reset or the last time a one was written to this bit. write 0: no operation. read 1: a falling edge has bee n detected since reset or the last time a one was written to this bit. write 1: clear falling edge detection for this pin. 0r/w 31:8 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 256 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 15.5.1.10 pin interrupt status register reading this register returns ones for pin interrupts that are currently requesting an interrupt. for pins identified as edge-sensitive in the interrupt select register, writing ones to this register clears both rising- and falli ng-edge detection for the pin. for level-sensitive pins, writing ones inverts the corresponding bit in the active level r egister, thus switching the active level on the pin. 15.5.2 gpio group0/group1 inte rrupt register description 15.5.2.1 grouped interrupt control register 15.5.2.2 gpio grouped interrupt port polarity registers the grouped interrupt port polarity registers determine how the polarity of each enabled pin contributes to the grouped interrupt. each po rt n (n = 0 to 7) is associated with its own port polarity register, and the values of all registers together determine the grouped interrupt. table 180. pin interrupt status register (ist address 0x4008 7024) bit description bit symbol description reset value access 7:0 pstat pin interrupt status. bit n returns the status, clears the edge interrupt, or inverts the active level of the pin selected in pintseln. read 0: interrupt is not being r equested for this interrupt pin. write 0: no operation. read 1: interrupt is being requested for this interrupt pin. write 1 (edge-sensitive): clear rising- and falling-edge detection for this pin. write 1 (level-sensitive): switch the active level for this pin (in the pintent_f register). 0r/w 31:8 - reserved. - - table 181. gpio grouped interrupt control register (ctrl, addresses 0x4008 8000 (group0 int) and 0x4008 9000 (group1 int)) bit description bit symbol value description reset value 0 int group interrupt status. this bit is cleared by writing a one to it. writing zero has no effect. 0 0 no interrupt request is pending. 1 interrupt request is active. 1 comb combine enabled inputs for group interrupt 0 0 or functionality: a grouped interrupt is generated when any one of the enabled inputs is active (based on its programmed polarity). 1 and functionality: an inte rrupt is generated when all enabled bits are active (based on their programmed polarity). 2 trig group interrupt trigger 0 0 edge-triggered 1 level-triggered 31:3 - - reserved 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 257 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 15.5.2.3 gpio grouped interrupt port enable registers the grouped interrupt port enable registers enable the pins which contribute to the grouped interrupt. each port n (n = 0 to 7) is associated with its own port enable register, and the values of all registers together de termine which pins contribute to the grouped interrupt. 15.5.3 gpio port register description 15.5.3.1 gpio port byte pin registers each gpio pin gpion[m] has a byte register in this address range. the byte pin registers of gpio port 0 correspond to registers b0 to b31, the byte pin registers of gpio port 1 correspond to registers b32 to b63, etc.. by te addresses are reserved for unused gpio port pins (see table 165 ). software typically reads and writes bytes to access individual pins but also can read or write halfwords to sense or set the state of tw o pins, and read or write words to sense or set the state of four pins. table 182. gpio grouped interrupt port polarity registers (port_pol, addresses 0x4008 8020 (port_pol0) to 0x4008 803c (port_pol7) (group0 int) and 0x4008 9020 (port_pol0) to 0x4008 903c (port_pol7) (group1 int)) bit description bit symbol description reset value access 31:0 pol configure pin polarity of port n pins for group interrupt. bit m corresponds to pin gpion[m] of port n. 0 = the pin is active low. if the level on this pin is low, the pin contributes to the group interrupt. 1 = the pin is active high. if the level on this pin is high, the pin contributes to the group interrupt. 1- table 183. gpio grouped interrupt port n enable registers (port_ena, addresses 0x4008 8040 (port_ena0) to 0x4008 805c (port_ena7) (group0 int) and 0x4008 9040 (port_ena0) to 0x4008 905c (port_ena7) (group1 int)) bit description bit symbol description reset value access 31:0 ena enable port n pin for group interrupt. bit m corresponds to pin gpiopn[m] of port n. 0 = the port n pin is disabled and does not contribute to the grouped interrupt. 1 = the port n pin is enabled and contributes to the grouped interrupt. 0- table 184. gpio port byte pin registers (b, ad dresses 0x400f 4000 (b0) to 0x400f 00fc (b255)) bit description bit symbol description reset value access 0 pbyte read: state of the pin gpio n[m], regardless of direction, masking, or alternate function . pins configured as analog i/o always read as 0. write: loads the pin?s output bit. ext r/w 7:1 reserved (0 on read, ignored on write) 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 258 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 15.5.3.2 gpio port word pin registers each gpio pin gpion[m] has a word register in this address range. the word pin registers of gpio port 0 correspond to regist ers w0 to w31, the word pin registers of gpio port 1 correspond to registers w32 to w63, etc.. word addresses are reserved for unused gpio port pins (see table 165 ). any byte, halfword, or word read in this range will be all ze ros if the pin is low or all ones if the pin is high, regardless of direction, maskin g, or alternate functi on, except that pins configured as analog i/o always read as zeros. any write will cl ear the pin?s output bit if the value written is all zeros, el se it will set the pin?s output bit. 15.5.3.3 gpio port direction registers each gpio port n (n = 0 to 7) has one direction register for configuring the port pins as inputs or outputs. 15.5.3.4 gpio port mask registers each gpio port has one mask register. the ma sk registers affect writing and reading the mport registers. zeroes in these register s enable reading and writing; ones disable writing and result in zeros in co rresponding positions when reading. table 185. gpio port word pin registers (w, addresses 0x400f 5000 (w0) to 0x400f 13fc (w255)) bit description bit symbol description reset value access 31:0 pword read 0: pin gpion[m] is low. write 0: clear output bit. read 0xffff ffff: pin is high. write any value 0x0000 0001 to 0xffff ffff: set output bit. remark: only 0 or 0xffff ffff can be read. writing any value other than 0 will set the output bit. ext r/w table 186. gpio port direction register (dir, addresses 0x400f 6000 (dir0) to 0x400f 601c (dir7)) bit description bit symbol description reset value access 31:0 dir selects pin direction for pin gpion[m] (bit 0 = gpion[0], bit 1 = gpion[1], ..., bit 31 = gpion[31]). 0 = input. 1 = output. 0r/w table 187. gpio port mask register (mask, addresses 0x400f 6080 (mask0) to 0x400f 609c (mask7)) bit description bit symbol description reset value access 31:0 mask controls which bits corresponding to gpion[m] are active in the mport register (bit 0 = gpio n[0], bit 1 = gpion[1], ..., bit 31 = gpion[31]). 0 = read mport: pin state; write mport: load output bit. 1 = read mport: 0; write mport: output bit not affected. 0r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 259 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 15.5.3.5 gpio port pin registers each gpio port has one port pin register. reading these registers returns the current state of the pins read, regardles s of direction, masking, or al ternate functions, except that pins configured as analog i/o always read as 0s. writing these registers loads the output bits of the pins written to, regardless of the mask register. 15.5.3.6 gpio masked port pin registers each gpio port has one masked port pin register. these registers are similar to the port registers, except that the value re ad is masked by anding with the inverted contents of the corres ponding mask register, and writing to one of these registers only affects output register bits that are enabled by zeros in the corresponding mask register. 15.5.3.7 gpio port set registers each gpio port has one port set register. output bits can be set by writing ones to these registers, regardle ss of mask registers. r eading from these regist er returns the port?s output bits, regardless of pin directions. table 188. gpio port pin register (pin, addresses 0x400f 6100 (pin0) to 0x400f 611c (pin7)) bit description bit symbol description reset value access 31:0 port reads pin states or loads output bits (bit 0 = gpion[0], bit 1 = gpion[1], ..., bit 31 = gpion[31]). 0 = read: pin is low; write: clear output bit. 1 = read: pin is high; write: set output bit. ext r/w table 189. gpio masked port pin register (mpin, addresses 0x400f 6180 (mpin0) to 0x400f 619c (mpin7)) bit description bit symbol description reset value access 31:0 mport masked port register (bit 0 = gpion[0], bit 1 = gpion[1], ..., bit 31 = gpion[31]). 0 = read: pin is low and/or the corresponding bit in the mask register is 1; write: clear output bit if the corresponding bit in the mask register is 0. 1 = read: pin is high and the corresponding bit in the mask register is 0; writ e: set output bit if the corresponding bit in the mask register is 0. ext r/w table 190. gpio port set register (set, ad dresses 0x400f 6200 (set0) to 0x400f 621c (set7)) bit description bit symbol description reset value access 31:0 set read or set output bits (bit 0 = gpion[0], bit 1 = gpion[1], ..., bit 31 = gpion[31]). 0 = read: output bit: write: no operation. 1 = read: output bit; write: set output bit. 0r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 260 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 15.5.3.8 gpio port clear registers each gpio port has one output clear register. output bits can be cleared by writing ones to these write-only registers, regardless of mask registers. 15.5.3.9 gpio port toggle registers each gpio port has one output toggle register. output bits can be toggled/inverted/complemented by writing ones to these write-only registers, regardless of mask registers. 15.6 functional description 15.6.1 reading pin state software can read the state of all gpio pins except those selected for analog input or output in the ?i/o configuration? logic. a pin does not have to be selected for gpio in ?i/o configuration? in order to read its state. there are four ways to read pin state: ? the state of a single pin can be read with 7 high-order zeros from a byte pin register. ? the state of a single pin can be read in all bits of a byte, halfword, or word from a word pin register. ? the state of multiple pins in a port can be read as a byte, halfword, or word from a port register. ? the state of a selected subset of the pins in a port can be read from a masked port (mport) register. pins having a 1 in the por t?s mask register will read as 0 from its mport register. 15.6.2 gpio output each gpio pin has an output bit in the gpio block. these output bits are the targets of write operations ?to the pins?. two conditions must be met in order for a pin?s output bit to be driven onto the pin: 1. the pin must be selected for gpio operat ion in the ?i/o configuration? block, and table 191. gpio port clear register (clr, addresses 0x400f 6280 (clr0) to 0x400f 629c (clr7)) bit description bit symbol description reset value access 31:0 clr clear output bits (bit 0 = gpion[0], bit 1 = gpion[1], ..., bit 31 = gpion[31]): 0 = no operation. 1 = clear output bit. na wo table 192. gpio port toggle register (not, addresses 0x400f 6300 (not0) to 0x400f 632c (not7)) bit description bit symbol description reset value access 31:0 notp0 toggle output bits (bit 0 = gp ion[0], bit 1 = gpion[1], ..., bit 31 = gpion[31]): 0 = no operation. 1 = toggle output bit. na wo www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 261 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio 2. the pin must be selected for output by a 1 in its port?s dir register. if either or both of these conditions is (are ) not met, ?writing to the pin? has no effect. there are seven ways to change gpio output bits: ? writing to a byte pin register loads the output bit from the least significant bit. ? writing to a word pin register loads the output bit with the or of all of the bits written. (this feature follows the definition of ?tru th? of a multi-bit value in programming languages.) ? writing to a port?s port register loads the output bits of all the pins written to. ? writing to a port?s mport register loads the output bits of pins identified by zeros in corresponding positions of the port?s mask register. ? writing ones to a port?s set register sets output bits. ? writing ones to a port?s clr register clears output bits. ? writing ones to a port?s not register toggles/complements/inverts output bits. the state of a port?s output bits can be read from its set register. reading any of the registers described in 15.6.1 returns the state of pins, regardless of their direction or alternate functions. 15.6.3 masked i/o a port?s mask register defines which of its pins should be acce ssible in its mport register. zeroes in mask enable the corresponding pins to be read from and written to mport. ones in mask force a pin to read as 0 and its output bit to be unaffected by writes to mport. when a port ?s mask register contains a ll zeros, its port and mport registers operate identically for reading and writing. users of previous nxp devices with simila r gpio blocks should be aware of an incompatibility: on the lpc11a1x, writing to the set, clr, and not registers is not affected by the mask register . on previous devices thes e registers were masked. applications in which interrupts can result in masked gpio op eration, or in task switching among tasks that do masked gpio operation, must treat code that uses the mask register as a protected/restricted region. this can be done by interrupt disabling or by using a semaphore. the simpler way to protect a block of code that uses a mask register is to disable interrupts before setting the mask register, a nd re-enable them after the last operation that uses the mport or mask register. more efficiently, software can dedicate a semaphore to the mask registers, and set/capture the semaphore cont rolling exclusive use of the mask registers before setting the mask registers, and release the semaphor e after the last operation that uses the mport or mask registers. 15.6.4 gpio interrupts two separate gpio interrupt fac ilities are provided. with pin in terrupts, up to eight gpio pins can each have separately-vectored, edge- or level-sensitive interrupts. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 262 of 1164 nxp semiconductors UM10430 chapter 15: lpc18xx gpio with group interrupts, any subset of the pins in each port can be selected to contribute to a common interrupt. any of the pin and port interrupts can be enabled to wake the part from deep-sleep mode or power-down mode. 15.6.4.1 pin interrupts in this interrupt facility, up to 8 pins are identified as in terrupt sources by the pin interrupt select registers (pintsel0-7). all of the other pin interrupt registers contain 8 bits, corresponding to the pins called out by the pintsel0-7 registers. the pintmode register defines whether each interrupt pin is edge- or level-sensitive. the pintrise and pintfall registers detect edges on each interr upt pin, and can be written to clear (and set) edge detection. the pintst register indi cates whether each interrupt pin is currently requesting an interrupt, and pintst can be written to clear interrupts. the other pin interrupt registers play differen t roles for edge-sensitive and level-sensitive pins, as described in ta b l e 1 9 3 . 15.6.4.2 group interrupts in this interrupt facility, an in terrupt can be requested for ea ch port, based on any selected subset of pins within each port. the pins that contribute to each port interrupt are selected by 1s in the port?s enable register, and an interrupt polarity can be selected for each pin in the port?s polarity register. the level on each pin is exclusive-ored with its polarity bit and the result is anded with its enable bit, and these results are then inclusive-ored among all the pins in the port, to create the port?s raw interrupt request. the raw interrupt request from each of the two group interrupts is sent to the nvic, which can be programmed to treat it as level- or edge-sensitive (see section 6.8 ). 15.6.5 recommended practices the following lists some recommended uses for using the gpio port registers: ? for initial setup after reset or re-ini tialization, write the port registers. ? to change the state of one pin, write a byte pin or word pin register. ? to change the state of multiple pins at a time, write the set and/or clr registers. ? to change the state of multiple pins in a tightly controlled environment like a software state machine, consider using the not register. this can require less write operations than set and clr. ? to read the state of one pin, read a byte pin or word pin register. ? to make a decision based on multiple pins, read and mask a port register. table 193. pin interrupt registers for edge- and level-sensitive pins name edge-sensiti ve function level-sensitive function pinten_r enables rising-edge interrupts. enables interrupts. pintsen_r write to enable rising-edge interrupts. write to enable interrupts. pintcen_r write to disable rising-edge interrupts. write to disable interrupts. pinten_f enables falling-edge interrupts. selects active level. pintsen_f write to enable falling-edge inte rrupts. write to select high-active. pintcen_f write to disable falling-edge interrupts. write to select low-active. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 263 of 1164 16.1 how to read this chapter the gpdma is available on all lpc18xx parts. see ta b l e 9 2 1 for the dma-to-peripheral connections for parts lpc1850/30/20/10 rev ?-?. 16.2 basic configuration the gpdma is configured as follows: ? see ta b l e 1 9 4 for clocking and power control. ? the gpdma is reset by the dma_rst (reset # 19). ? the dmamux register in the creg block (see ta b l e 3 5 ) selects between up to three peripherals for each gpdma-to-peripheral line. 16.3 features ? eight dma channels. each channel can support an unidirectional transfer. ? 16 dma request lines. ? single dma and burst dma request signals. each peripheral connected to the dma controller can assert either a burst dma request or a single dma request. the dma burst size is set by programming the dma controller. ? memory-to-memory, memory-to-peripheral, peripheral-to-memory, and peripheral-to-peripheral transfers are supported. ? scatter or gather dma is supported through the use of linked lists. this means that the source and destination areas do not hav e to occupy contiguous areas of memory. ? hardware dma ch annel priority. ? ahb slave dma programming interface. the dma controller is programmed by writing to the dma control regist ers over the ahb slave interface. ? two ahb bus masters for transferring data. these interfaces transfer data when a dma request goes active. master 1 can access memories and peripherals, master 0 can access memories only. ? 32-bit ahb master bus width. ? incrementing or non-incrementing addressing for source and destination. ? programmable dma burst size. the dma burst size can be programmed to more efficiently transfer data. ? internal four-word fifo per channel. UM10430 chapter 16: lpc18xx genera l purpose dma (gpdma) controller rev. 00.13 ? 20 july 2011 user manual table 194. gpdma clocking and power control base clock branch clock maximum frequency gpdma base_m3_clk clk_m3_dma 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 264 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller ? supports 8, 16, and 32-bit wide transactions. ? big-endian and little-endian support. the dma controller defaults to little-endian mode on reset. ? an interrupt to the processor can be generated on a dma completion or when a dma error has occurred. ? raw interrupt status. the dma error and dma count raw interrupt status can be read prior to masking. 16.4 general description the dma controller allows peripheral-to memory, memory-to-peripheral, peripheral-to-peripheral, and memory-to-memory transactions. each dma stream provides unidirectional serial dma transfer s for a single source and destination. for example, a bi-directional port requires one stream for transmit and one for receives. the source and destination areas can each be either a memory region or a peripheral for master 1, but only memory for master 0. 16.5 dma system connections the connection of the dma controller to s upported peripheral devices is shown in table 195 . the lpc18xx supports up to three different muxing options for each channel to connect peripherals to the dma. the dmamux register in the creg block controls which option is used (see ta b l e 3 5 ). table 195. peripheral connections to the dma controller and matching flow control signals peripheral number dma muxing option (see table 35 ) sreq breq 0 0x0 spifi spifi 0x1 sct match 2 0x2 reserved reserved 0x3 timer 3 match 1 1 0x0 n.c. timer 0 match 0 0x1 n.c. usart0 transmit 0x2 reserved reserved 0x3 n.c. aes input 2 0x0 n.c. timer 0 match 1 0x1 n.c. usart0 receive 0x2 reserved reserved 0x3 n.c. aes output 3 0x0 n.c. timer 1 match 0 0x1 n.c. uart1 transmit 0x2 n.c. i2s1 channel 0 0x3 ssp1 transmit ssp1 transmit www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 265 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 4 0x0 n.c. timer 1 match 1 0x1 n.c. uart 1 receive 0x2 n.c. i2s1 channel 1 0x3 ssp1 receive ssp1 receive 5 0x0 n.c. timer 2 match 0 0x1 n.c. usart 2 transmit 0x2 ssp1 transmit ssp1 transmit 0x3 reserved reserved 6 0x0 n.c. timer 2 match 1 0x1 n.c. usart 2 receive 0x2 ssp1 receive ssp1 receive 0x3 reserved reserved 7 0x0 n.c. timer 3 match 0 0x1 n.c. usart3 transmit 0x2 n.c. sct dma request 0 0x3 reserved reserved 8 0x0 n.c. timer 3 match 1 0x1 n.c. usart3 receive 0x2 n.c. sct dma request 1 0x3 reserved reserved 9 0x0 ssp0 receive ssp0 receive 0x1 n.c. i2s channel 0 0x2 n.c. sct dma request 1 0x3 n.c. n.c. 10 0x0 ssp0 transmit ssp0 transmit 0x1 n.c. i2s channel 1 0x2 n.c. sct dma request 0 0x3 n.c. n.c. 11 0x0 ssp1 receive ssp1 receive 0x1 reserved reserved 0x2 n.c. usart0 transmit 0x3 n.c. n.c. 12 0x0 ssp1 transmit ssp1 transmit 0x1 reserved reserved 0x2 n.c. usart0 receive 0x3 n.c. n.c. table 195. peripheral connections to the dma controller and matching flow control signals peripheral number dma muxing option (see table 35 ) sreq breq www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 266 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller in addition to the peripherals listed in table 195 , the gpios, the wwdt, and the timers can be accessed by the gpdma as a memory-t o-memory transaction with no flow control. 16.5.1 dma request signals the dma request signals are used by periph erals to request a data transfer. the dma request signals indicate whether a single or bu rst transfer of data is required and whether the transfer is the last in the data packet. the dma available request signals are: breq[15:0] ? burst request signals. these cause a programmed burst number of data to be transferred. sreq[15:0] ? single transfer request signals. these cause a single data to be transferred. the dma controller transfers a single transfer to or from the peripheral. lbreq[15:0] ? last burst request signals. lsreq[15:0] ? last single transfer request signals. note that most peripherals do not support all request types. 16.5.2 dma response signals the dma response signals indicate whether the transfer initiated by the dma request signal has completed. the response signals can also be used to indicate whether a complete packet has been transferred. the dma response signals from the dma controller are: clr[15:0] ? dma clear or acknowledge signals. the clr signal is used by the dma controller to acknowledge a dma request from the peripheral. tc[15:0] ? dma terminal count signals. the tc signal can be used by the dma controller to indicate to the peripheral that the dma transfer is complete. 13 0x0 n.c. adc0 0x1 n.c. aes input 0x2 ssp1 receive ssp1 receive 0x3 n.c. usart3 receive 14 0x0 n.c. adc1 0x1 n.c. aes output 0x2 ssp1 transmit ssp1 transmit 0x3 n.c. usart3 transmit 15 0x0 n.c. dac 0x1 sct match 3 0x2 reserved reserved 0x3 n.c. timer3 match 0 table 195. peripheral connections to the dma controller and matching flow control signals peripheral number dma muxing option (see table 35 ) sreq breq www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 267 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.6 register description the dma controller supports 8 channels. each channel has registers specific to the operation of that channel. other registers controls aspects of how source peripherals relate to the dma controller. there are also global dma control and status registers. table 196. register overview: gpdma (base address 0x4000 2000) name access address offset description reset value general registers intstat ro 0x000 dma interrupt status register 0x0000 0000 inttcstat ro 0x004 dma interrupt terminal count request status register 0x0000 0000 inttcclear wo 0x008 dma interrupt terminal count request clear register - interrstat ro 0x00c dma interrupt error status register 0x0000 0000 interrclr wo 0x010 dma interrupt error clear register - rawinttcstat ro 0x014 dma raw interrupt terminal count status register 0x0000 0000 rawinterrstat ro 0x018 dma raw error interrupt status register 0x0000 0000 enbldchns ro 0x01c dma enabled channel register 0x0000 0000 softbreq r/w 0x020 dma software burst request register 0x0000 0000 softsreq r/w 0x024 dma software single request register 0x0000 0000 softlbreq r/w 0x028 dma software last burst request register 0x0000 0000 softlsreq r/w 0x02c dma software last single request register 0x0000 0000 config r/w 0x030 dma configuration register 0x0000 0000 sync r/w 0x034 dma synchronization register 0x0000 0000 channel 0 registers c0srcaddr r/w 0x100 dma channel 0 source address register 0x0000 0000 c0destaddr r/w 0x104 dma channel 0 destination address register 0x0000 0000 c0lli r/w 0x108 dma channel 0 linked list item register 0x0000 0000 c0control r/w 0x10c dma channel 0 control register 0x0000 0000 c0config r/w 0x110 dma channel 0 configuration register 0x0000 0000 [1] channel 1 registers c1srcaddr r/w 0x120 dma channel 1 source address register 0x0000 0000 c1destaddr r/w 0x124 dma channel 1 destination address register 0x0000 0000 c1lli r/w 0x128 dma channel 1 linked list item register 0x0000 0000 c1control r/w 0x12c dma channel 1 control register 0x0000 0000 c1config r/w 0x130 dma channel 1 configuration register 0x0000 0000 [1] channel 2 registers c2srcaddr r/w 0x140 dma channel 2 source address register 0x0000 0000 c2destaddr r/w 0x144 dma channel 2 destination address register 0x0000 0000 c2lli r/w 0x148 dma channel 2 linked list item register 0x0000 0000 c2control r/w 0x14c dma channel 2 control register 0x0000 0000 c2config r/w 0x150 dma channel 2 configuration register 0x0000 0000 [1] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 268 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller [1] bit 17 of this register is a read-only status flag. 16.6.1 dma interrupt status register the intstat register is read-only and shows t he status of the interrupts after masking. a high bit indicates that a specific dma chan nel interrupt request is active. the request can be generated from either the error or terminal count interrupt requests. channel 3 registers c3srcaddr r/w 0x160 dma channel 3 source address register 0x0000 0000 c3destaddr r/w 0x164 dma channel 3 destination address register 0x0000 0000 c3lli r/w 0x168 dma channel 3 linked list item register 0x0000 0000 c3control r/w 0x16c dma channel 3 control register 0x0000 0000 c3config r/w 0x170 dma channel 3 configuration register 0x0000 0000 [1] channel 4 registers c4srcaddr r/w 0x180 dma channel 4 source address register 0x0000 0000 c4destaddr r/w 0x184 dma channel 4 destination address register 0x0000 0000 c4lli r/w 0x188 dma channel 4 linked list item register 0x0000 0000 c4control r/w 0x18c dma channel 4 control register 0x0000 0000 c4config r/w 0x190 dma channel 4 configuration register 0x0000 0000 [1] channel 5 registers c5srcaddr r/w 0x1a0 dma channel 5 source address register 0x0000 0000 c5destaddr r/w 0x1a4 dma channel 5 destination address register 0x0000 0000 c5lli r/w 0x1a8 dma channel 5 linked list item register 0x0000 0000 c5control r/w 0x1ac dma channel 5 control register 0x0000 0000 c5config r/w 0x1b0 dma channel 5 configuration register 0x0000 0000 [1] channel 6 registers c6srcaddr r/w 0x1c0 dma channel 6 source address register 0x0000 0000 c6destaddr r/w 0x1c4 dma channel 6 destination address register 0x0000 0000 c6lli r/w 0x1c8 dma channel 6 linked list item register 0x0000 0000 c6control r/w 01cc dma channel 6 control register 0x0000 0000 c6config r/w 0x1d0 dma channel 6 configuration register 0x0000 0000 [1] channel 7 registers c7srcaddr r/w 0x1e0 dma channel 7 source address register 0x0000 0000 c7destaddr r/w 0x1e4 dma channel 7 destination address register 0x0000 0000 c7lli r/w 0x1e8 dma channel 7 linked list item register 0x0000 0000 c7control r/w 0x1ec dma channel 7 control register 0x0000 0000 c7config r/w 0x1f0 dma channel 7 configuration register 0x0000 0000 [1] table 196. register overview: gpdma (base address 0x4000 2000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 269 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.6.2 dma interrupt terminal count request status register the inttcstat register is read-only and indicates the status of the terminal count after masking. 16.6.3 dma interrupt terminal count request clear register the inttcclear register is write-only and cl ears one or more terminal count interrupt requests. when writing to this register, ea ch data bit that is set high causes the corresponding bit in the status register (inttcstat) to be cleared. data bits that are low have no effect. 16.6.4 dma interrupt error status register the interrstat register is read-only and indicates the status of the error request after masking. table 197. dma interrupt status register (intstat, address 0x4000 2000) bit description bit symbol description reset value access 7:0 intstat status of dma channel interrupts after masking. each bit represents one channel: 0 - the corresponding channel has no active interrupt request. 1 - the corresponding channel does have an active interrupt request. 0x00 ro 31:8 - reserved. read undefined. - - table 198. dma interrupt terminal count re quest status register (inttcstat, address 0x4000 2004) bit description bit symbol description reset value access 7:0 inttcstat terminal count interrupt request status for dma channels. each bit represents one channel: 0 - the corresponding channel has no active terminal count interrupt request. 1 - the corresponding channel does have an active terminal count interrupt request. 0x00 ro 31:8 - reserved. read undefined. - - table 199. dma interrupt terminal count requ est clear register (inttcclear, address 0x4000 2008) bit description bit symbol description reset value access 7:0 inttcclear allows clearing the terminal count interrupt request (inttcstat) for dma channels. each bit represents one channel: 0 - writing 0 has no effect. 1 - clears the corresponding channel terminal count interrupt. 0x00 wo 31:8 - reserved. read undefin ed. write reserved bits as zero. -- www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 270 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.6.5 dma interrupt error clear register the interrclr register is writ e-only and clears the erro r interrupt requests. when writing to this register, each data bit that is high causes the co rresponding bit in the status register to be cleared. data bits th at are low have no effect on the corresponding bit in the register. 16.6.6 dma raw interrupt termin al count status register the rawinttcstat register is read-onl y and indicates which dma channel is requesting a transfer complete (terminal c ount interrupt) prior to masking. (note: the inttcstat register contains the same info rmation after masking.) a high bit indicates that the terminal count interrupt request is ac tive prior to masking. table 200. dma interrupt error status register (interrstat, address 0x4000 200c) bit description bit symbol description reset value access 7:0 interrstat interrupt error stat us for dma channels. each bit represents one channel: 0 - the corresponding channel has no active error interrupt request. 1 - the corresponding channel does have an active error interrupt request. 0x00 ro 31:8 - reserved. read undefined. - - table 201. dma interrupt error clear regi ster (interrclr, address 0x4000 2010) bit description bit symbol description reset value access 7:0 interrclr writing a 1 clears the error interrupt request (interrstat) for dma channels. each bit represents one channel: 0 - writing 0 has no effect. 1 - clears the corresponding channel error interrupt. 0x00 wo 31:8 - reserved. read undefined. write reserved bits as zero. - - table 202. dma raw interrupt terminal count status register (rawinttcstat, address 0x4000 2014) bit description bit symbol description reset value access 7:0 rawinttcstat status of the terminal count interrupt for dma channels prior to masking. each bit represents one channel: 0 - the corresponding channel has no active terminal count interrupt request. 1 - the corresponding channel does have an active terminal count interrupt request. 0x00 ro 31:8 - reserved. read undefined. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 271 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.6.7 dma raw error inte rrupt status register the rawinterrstat register is read-only and indicates which dma channel is requesting an error interrupt prior to masking. (note: the interrstat register contains the same information after masking.) a high bit in dicates that the error interrupt request is active prior to masking. 16.6.8 dma enabled channel register the enbldchns register is read-only and in dicates which dma channels are enabled, as indicated by the enable bit in the cconfig register. a high bit indicates that a dma channel is enabled. a bit is cleared on completion of the dma transfer. 16.6.9 dma software burst request register the softbreq register is read/write and enables dma burst requests to be generated by software. a dma request can be generated for each source by writing a 1 to the corresponding register bit. a register bit is cleared when the transaction has completed. reading the register indicates which sources are requesting dma burst transfers. a request can be generated from either a peripheral or the software request register. each bit is cleared when the related transaction has completed. table 203. dma raw error interrupt status register (rawinterrstat, address 0x4000 2018) bit description bit symbol description reset value access 7:0 rawinterrstat status of the erro r interrupt for dma channels prior to masking. each bit represents one channel: 0 - the corresponding channel has no active error interrupt request. 1 - the corresponding channel does have an active error interrupt request. 0x00 ro 31:8 - reserved. read undefined. - - table 204. dma enabled channel register (enbldchns, address 0x4000 201c) bit description bit symbol description reset value access 7:0 enabledchannels enable status for dma channels. each bit represents one channel: 0 - dma channel is disabled. 1 - dma channel is enabled. 0x00 ro 31:8 - reserved. read undefined. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 272 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller note: it is recommended that software and hardware peripheral requests are not used at the same time. 16.6.10 dma software si ngle request register the softsreq register is read/write and enables dma single transfer requests to be generated by software. a dma request can be generated for each source by writing a 1 to the corresponding register bit. a register bit is cleared when the transaction has completed. reading the register indicates which sources are requesting single dma transfers. a request can be generated from ei ther a peripheral or the software request register. 16.6.11 dma software last burst request register the softlbreq register is read/write and enables dma last burst requests to be generated by software. a dma request can be generated for each source by writing a 1 to the corresponding register bit. a register bit is cleared when the transaction has completed. reading the register indicates which sources are requesting last burst dma transfers. a request can be generated from ei ther a peripheral or the software request register. table 205. dma software burst request regi ster (softbreq, address 0x4000 2020) bit description bit symbol description reset value access 15:0 softbreq software burst request flags for each of 16 possible sources. each bit represents one dma request line or peripheral function (refer to table 195 for peripheral hardware connections to the dma controller): 0 - writing 0 has no effect. 1 - writing 1 generates a dma burst request for the corresponding request line. 0x00 r/w 31:16 - reserved. read undefined. write reserved bits as zero. - - table 206. dma software single request re gister (softsreq, address 0x4000 2024) bit description bit symbol description reset value access 15:0 softsreq software single transfer request flags for each of 16 possible sources. each bit represents one dma request line or peripheral function: 0 - writing 0 has no effect. 1 - writing 1 generates a dma single transfer request for the corresponding request line. 0x00 r/w 31:16 - reserved. read undefined. write reserved bits as zero. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 273 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.6.12 dma software last single request register the softlsreq register is read/write and enables dma last single requests to be generated by software. a dma request can be generated for each source by writing a 1 to the corresponding register bit. a register bit is cleared when the transaction has completed. reading the register indicates which sources are requesting last single dma transfers. a request can be generated from ei ther a peripheral or the software request register. 16.6.13 dma config uration register the config register is read/write and config ures the operation of the dma controller. the endianness of the ahb master interface can be altered by writing to the m bit of this register. the ahb master interface is set to little-endian mode on reset. table 207. dma software last burst request register (softlbreq, address 0x4000 2028) bit description bit symbol description reset value access 15:0 softlbreq software last burst request flags for each of 16 possible sources. each bit represents one dma request line or peripheral function: 0 - writing 0 has no effect. 1 - writing 1 generates a dma last burst request for the corresponding request line. 0x00 r/w 31:16 - reserved. read undefined. write reserved bits as zero. -- table 208. dma software last single reques t register (softlsreq, address 0x4000 202c) bit description bit symbol description reset value access 15:0 softlsreq software last single transfer request flags for each of 16 possible sources. each bit represents one dma request line or peripheral function: 0 - writing 0 has no effect. 1 - writing 1 generates a dma last single transfer request for the corresponding request line. 0x00 r/w 31:16 - reserved. read undefined. write reserved bits as zero. -- table 209. dma configuration register (con fig, address 0x4000 2030) bit description bit symbol value description reset value access 0 e dma controller enable: 0x00 r/w 0 disabled (default). disabling the dma controller reduces power consumption. 1 enabled 1 m0 ahb master 0 endianness configuration: 0x00 r/w 0 little-endian mode (default). 1 big-endian mode. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 274 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.6.14 dma synchronization register the sync register is read/write and enable s or disables synchronization logic for the dma request signals. the dma request signal s consist of the breq[15:0], sreq[15:0], lbreq[15:0], and lsreq[15:0]. a bit set to 0 enables the synchronization logic for a particular group of dma requests. a bit set to 1 disables the synchronization logic for a particular group of dma requests. this regi ster is reset to 0, synchronization logic enabled. 16.6.15 dma channel registers the channel registers are used to progra m the eight dma channels. these registers consist of: ? eight csrcaddr registers. ? eight cdestaddr registers. ? eight clli registers. ? eight ccontrol registers. ? eight cconfig registers. when performing scatter/gather dma, the firs t four of these are automatically updated. 16.6.16 dma channel s ource address registers the eight read/write csrcaddr registers (c0srcaddr to c7srcaddr) contain the current source address (byte-aligned) of the data to be transferred. each register is programmed directly by software before the appropriate channel is enabled. when the dma channel is enabled this register is updated: 2 m1 ahb master 1 endianness configuration: 0x00 r/w 0 little-endian mode (default). 1 big-endian mode. 31:3 - reserved. read undefined. write reserved bits as zero. table 209. dma configuration register (con fig, address 0x4000 2030) bit description bit symbol value description reset value access table 210. dma synchronization register (syn c, address 0x4000 2034) bit description bit symbol description reset value access 15:0 dmacsync controls the synchronization logic for dma request signals. each bit represents one set of dma request lines as described in the preceding text: 0 - synchronization logic for the corresponding dma request signals are disabled. 1 - synchronization logic for the corresponding request line signals are enabled. 0x00 r/w 31:16 - reserved. read undefined. write reserved bits as zero. -- www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 275 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller ? as the source address is incremented. ? by following the linked list when a comple te packet of data has been transferred. reading the register when the channel is active does not provide useful information. this is because by the time software has processed the value read, the address may have progressed. it is intended to be read only when the channel has stopped, in which case it shows the source address of the last item read. note: the source and destination addresses must be aligned to the source and destination widths. 16.6.17 dma channel destin ation address registers the eight read/write cdest addr registers (c0destaddr to c7destaddr) contain the current destination address (byte-aligned) of the data to be transferred. each register is programmed directly by software before the channel is enabled. when the dma channel is enabled the register is updated as the destination address is incremented and by following the linked list when a complete packet of data has been transferred. reading the register when the channel is active does not provide useful information. this is because by the time that software has proc essed the value read, the address may have progressed. it is intended to be read only when a channel has stopped, in which case it shows the destination address of the last item read. 16.6.18 dma channel linked list item registers the eight read/write clli registers (c0lli to c7lli) contain a word-aligned address of the next linked list item (lli). if the lli is 0, then the current lli is the last in the chain, and the dma channel is disabled when all dma transfers associated with it are completed. programming this register when the dma channel is enabled may have unpredictable side effects. table 211. dma channel source address registers (csrcaddr, 0x4000 2100 (c0srcaddr) to 0x4000 21e0 (c 7srcaddr)) bit description bit symbol description reset value access 31:0 srcaddr dma source address. reading this register will return the current source address. 0x0000 0000 r/w table 212. dma channel destination address registers (cdestaddr, 0x4000 2104 (c0destaddr) to 0x4000 21e4 (c7destaddr)) bit description bit symbol description reset value access 31:0 destaddr dma destinatio n address. reading this register will return the current destination address. 0x0000 0000 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 276 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.6.19 dma channel control registers the eight read/write ccontrol register s (c0control to c7control) contain dma channel control information such as the transfer size, burst size, and transfer width. each register is programmed directly by software before the dma channel is enabled. when the channel is enabled the register is updated by following the linked list when a complete packet of data has been transferred. reading the register while the channel is active does not give useful information. th is is because by the time software has processed the value read, the channel may have advanced. it is intended to be read only when a channel has stopped. table 213. dma channel linked list item registers (clli, 0x4000 2108 (c0lli) to 0x4000 21e8 (c7lli)) bit description bit symbol value description reset value access 0 lm ahb master select for loading the next lli: 0 r/w 0ahb master 0. 1ahb master 1. 1 r reserved, and must be written as 0, masked on read. 0r/w 31:2 lli linked list item. bits [ 31:2] of the ad dress for the next lli. address bits [1:0] are 0. 0x0000 0000 r/w table 214. dma channel control registers (ccontrol, 0x4000 210c (c0control) to 0x4000 21ec (c7control)) bit description bit symbol value description reset value access 11:0 transfersize transfer size in number of transfers. a write to this field sets the size of the transfer when the dma controller is the flow controller. the transfer size value must be set before the channel is enabled. transfer size is updated as data transfers are completed. a read from this field indicates the number of transfers completed on the destination bus. reading the register when the channel is active does not give useful information because by the time that the software has processed the value read, the channel might have progressed. it is intended to be used only when a channel is enabled and then disabled. the transfer size value is not us ed if the dma controller is not the flow controller. 0x0 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 277 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 14:12 sbsize source burst size. indicates the number of transfers that make up a source burst. this value must be set to the burst size of the source peripheral, or if the source is memory, to the memory boundary size (see figure 5 ). the burst size is the amount of data that is transferred when the breq signal goes active in the source peripheral. 0x0 r/w 0x0 source burst size = 1 0x1 source burst size = 4 0x2 source burst size = 8 0x3 source burst size = 16 0x4 source burst size = 32 0x4 source burst size = 64 0x6 source burst size = 128 0x7 source burst size = 256 17:15 dbsize destination burst size. indi cates the number of transfers that make up a destination burst transf er request. this value must be set to the burst size of the destination peripheral or, if the destination is memory, to the memory boundary size. the burst size is the amount of data t hat is transferred when the breq signal goes active in the destination peripheral. 0x0 r/w 0x0 destination burst size = 1 0x1 destination burst size = 4 0x2 destination burst size = 8 0x3 destination burst size = 16 0x4 destination burst size = 32 0x4 destination burst size = 64 0x6 destination burst size = 128 0x7 destination burst size = 256 20:18 swidth source transfer width. transfers wider than the ahb master bus width are illegal. the source and destination widths can be different from each other. the hardware autom atically packs and unpacks the data as requ ired. 0x3 to 0x7 - reserved. 0x0 r/w 0x0 byte (8-bit) 0x1 halfword (16-bit) 0x2 word (32-bit) 23:21 dwidth destination transfer width. tr ansfers wider than the ahb master bus width are not supported. the source and destination widths can be different from each other. the hardware automatically packs and unpacks the data as requ ired. 0x3 to 0x7 - reserved. 0x0 r/w 0x0 byte (8-bit) 0x1 halfword (16-bit) 0x2 word (32-bit) table 214. dma channel control registers (ccontrol, 0x4000 210c (c0control) to 0x4000 21ec (c7control)) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 278 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.6.19.1 protection and access information ahb access information is provided to the source and destination peripherals when a transfer occurs. the transfer information is provided by programming the dma channel (the prot bits of the ccontrol register, and the lock bit of the cconfig register). these bits are programmed by software. pe ripherals can use this information if necessary. 16.6.20 channel configuration registers the eight cconfig registers (c0config to c7config) are read/write with the exception of bit[17] which is read-only. used these to configure the dma channel. the registers are not updated when a new lli is requested. 24 s source ahb master select: 0 r/w 0 ahb master 0 selected for source transfer. 1 ahb master 1 selected for source transfer. 25 d destination ahb master select: remark: only master1 can access a peripheral. master0 can only access memory. 0r/w 0 ahb master 0 selected for destination transfer. 1 ahb master 1 selected for destination transfer. 26 si source increment: 0 r/w 0 the source address is not incremented after each transfer. 1 the source address is incremented after each transfer. 27 di destination increment: 0 r/w 0 the destination address is not incremented after each transfer. 1 the destination address is incremented after each transfer. 28 prot1 indicates that the access is in user mode or privileged mode: 0 r/w 0 access is in user mode 1 access is in privileged mode. 29 prot2 indicates that the access is bufferable or not bufferable: 0 r/w 0 access is not bufferable. 1 access is bufferable. 30 prot3 indicates that the access is cacheable or not cacheable: 0 r/w 0 access is not cacheable. 1 access is cacheable. 31 i terminal count interrupt enable bit. 0 r/w 0 the terminal count interrupt is disabled. 1 the terminal count interrupt is enabled. table 214. dma channel control registers (ccontrol, 0x4000 210c (c0control) to 0x4000 21ec (c7control)) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 279 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller table 215. dma channel configuration registers (cconf ig, 0x4000 2110 (c0config) to 0x4000 21f0 (c7config)) bit description bit symbol value description reset value access 0 e channel enable. reading this bit indicates whether a channel is currently enabled or disabled: the channel enable bit status can also be found by reading the enbldchns register. a channel can be disabled by clearing the enable bit. this causes the current ahb transfer (if one is in progress) to complete and the channel is then disabled. any data in the fifo of the relevant channel is lost. restarting the channel by setting the channel enable bit has unpredictable effects, the channel must be fully re-initialized. the channel is also disabled, and channel enable bit cleared, when the last lli is reached, the dma transfer is completed, or if a channel error is encountered. if a channel must be disabled without losing data in the fifo, the halt bit must be set so that further dma requests are ignored. the active bit must then be polled until it reaches 0, indicating that there is no data left in the fifo. finally, the channel enable bit can be cleared. 0r/w 0 channel disabled. 1 channel enabled. 5:1 srcperipheral source peripheral. this value selects the dma source request peripheral. this field is ignored if the source of the transfer is from memory. see table 195 for details. r/w 0x0 source = spifi 0x1 source = timer 0 match 0/uart0 transmit 0x2 source = timer 0 match 1/uart0 receive 0x3 source = timer 1 match 0/uart1 transmit 0x4 source = timer 1 match 1/uart 1 receive 0x5 source = timer 2 match 0/uart 2 transmit 0x6 source = timer 2 match 1/uart 2 receive 0x7 source = timer 3 match 0/uart 3 transmit/sct dma request 0 0x8 source = timer 3 match 1/uart3 receive/sct dma request 1 0x9 source = ssp0 receive/i2s channel 0 0xa source = ssp0 transmit/i2s channel 1 0xb source = ssp1 receive 0xc source = ssp1 transmit 0xd source = adc0 0xe source = adc1 0xf source = dac www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 280 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 10:6 destperipheral destination peripheral. this value selects the dma destination request peripheral. this field is ignored if the destination of the transfer is to memory. see ta b l e 1 9 5 for details. r/w 0x0 destination = spifi 0x1 destination = timer 0 match 0/uart0 transmit 0x2 destination = timer 0 match 1/uart0 receive 0x3 destination = timer 1 match 0/uart1 transmit 0x4 destination = timer 1 match 1/uart 1 receive 0x5 destination = timer 2 match 0/uart 2 transmit 0x6 destination = timer 2 match 1/uart 2 receive 0x7 destination = timer 3 match 0/uart3 transmit/sct dma request 0 0x8 destination = timer 3 matc h 1/uart3 receive/sct dma request 1 0x9 destination = ssp0 receive/i2s channel 0 0xa destination = ssp0 transmit/i2s channel 1 0xb destination = ssp1 receive 0xc destination = ssp1 transmit 0xd destination = adc0 0xe destination = adc1 0xf destination = dac 13:11 flowcntrl flow control and transfer type. this value indicates the flow controller and transfer type. the flow controller can be the dma controller, the source peripheral, or the destination peripheral. the transfer type can be memory-to-memory, memory-to-peripheral, pe ripheral-to-memory, or peripheral-to-peripheral. refer to table 216 for the encoding of this field. r/w 0x0 memory to memory (dma control) 0x1 memory to peripheral (dma control) 0x2 peripheral to memory (dma control) 0x3 source peripheral to destina tion peripheral (dma control) 0x4 source peripheral to destination peripheral (destination control) 0x5 memory to peripheral (peripheral control) 0x6 peripheral to memory (peripheral control) 0x7 source peripheral to destina tion peripheral (source control) 14 ie interrupt erro r mask. when cleared, this bit masks out the error interrupt of the relevant channel. r/w 15 itc terminal count interrupt mask. when cleared, this bit masks out the terminal count interrupt of the relevant channel. r/w 16 l lock. when set, this bi t enables locked transfers. r/w table 215. dma channel configuration registers (cconf ig, 0x4000 2110 (c0config) to 0x4000 21f0 (c7config)) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 281 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.6.20.1 lock control the lock control may set the lock bit by writin g a 1 to bit 16 of the cconfig register. when a burst occurs, the ahb arbiter will not de -grant the master durin g the burst until the lock is deasserted. the dma controller can be locked for a a single burst such as a long source fetch burst or a long destination drai n burst. the dma controller does not usually assert the lock continuously for a source fetch burst followed by a destination drain burst. there are situations when the dma contro ller asserts the lock for source transfers followed by destination transfers. this is po ssible when internal co nditions in the dma controller permit it to perform a source fetch followed by a destination drain back-to-back. 16.6.20.2 flow control and transfer type table 216 lists the bit values of the three flow cont rol and transfer type bits identified in ta b l e table 215 . 17 a active: 0 = there is no data in the fifo of the channel. 1 = the channel fifo has data. this value can be used with the halt and channel enable bits to cleanly disable a dma channel. this is a read-only bit. ro 18 h halt: 0 = enable dma requests. 1 = ignore further source dma requests. the contents of the channel fifo are drained. this value can be used with the active and channel enable bits to cleanly disable a dma channel. r/w 0 enable dma requests. 1 ignore further source dma requests. 31:19 - reserved, do not modify, masked on read. - table 215. dma channel configuration registers (cconf ig, 0x4000 2110 (c0config) to 0x4000 21f0 (c7config)) bit description ?continued bit symbol value description reset value access table 216. flow control and transfer type bits bit value transfer type controller 000 memory to memory dma 001 memory to peripheral dma 010 peripheral to memory dma 011 source peripheral to destination peripheral dma 100 source peripheral to destination peripheral destination peripheral 101 memory to peripheral peripheral 110 peripheral to memory peripheral 111 source peripheral to destination peripheral source peripheral www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 282 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.7 functional description 16.7.1 dma controller functional description the dma controller enables peripheral-to-memory, memory-to-peripheral, peripheral-to-peripheral, and memory-to-memory transactions. each dma stream provides unidirectional serial dma transfer s for a single source and destination. for example, a bidirectional port requires one st ream for transmit and one for receive. the source and destination areas can each be either a memory region or a peripheral, and can be accessed through the ahb master. figure 26 shows a block diagram of the dma controller. the functions of the dma controller ar e described in the following sections. 16.7.1.1 ahb slave interface all transactions to dma contro ller registers on the ahb slave interface are 32 bits wide. eight bit and 16-bit accesses are not su pported and will result in an exception. 16.7.1.2 control logic and register bank the register block stores data written or to be read across the ahb interface. 16.7.1.3 dma request and response interface see dma interface description for information on the dma request and response interface. 16.7.1.4 channel logic and channel register bank the channel logic and channel register bank c ontains registers and logic required for each dma channel. 16.7.1.5 interrupt request the interrupt request generates the interrupt to the arm processor. fig 26. dma controller block diagram ahb slave interface control logic and registers dma request and response interface channel logic and registers interrupt request ahb master interface m1 dma requests dma responses dma interrupt ahb matrix ahb master interface m0 ahb matrix ahb matrix www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 283 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.7.1.6 ahb master interface the dma controller contains two ahb master in terfaces. each ahb master is capable of dealing with all types of ah b transactions, including: ? split, retry, and error responses from slaves. if a peripheral performs a split or retry, the dma controller stalls and waits until the transaction can complete. ? locked transfers for source and destination of each stream. ? setting of protection bits for transfers on each stream. 16.7.1.6.1 bus and transfer widths the physical width of the ahb bus is 32 bits. source and destination transfers can be of differing widths and can be the same width or narrower than the physical bus width. the dma controller packs or unpacks data as appropriate. 16.7.1.6.2 endian behavior the dma controller can cope with both little-end ian and big-endian addressing. software can set the endianness of each ahb master individually. internally the dma contro ller treats all data as a stream of bytes instead of 16-bit or 32-bit quantities. this means that when performing mixed-endian activity, where the endianness of the source and destination are different, byte swapping of the data within the 32-bit data bus is observed. note: if byte swapping is not required, then use of different endianness between the source and destination addresses must be avoided. table 217 shows endian behavior for different source and destination combinations. table 217. endian behavior source endian destination endian source width destination width source transfer no/byte lane source data destination transfer no/byte lane destination data little little 8 8 1/[7:0] 2/[15:8] 3/[23:16] 4/[31:24] 21 43 65 87 1/[7:0] 2/[15:8] 3/[23:16] 4/[31:24] 21212121 43434343 65656565 87878787 little little 8 16 1/[7:0] 2/[15:8] 3/[23:16] 4/[31:24] 21 43 65 87 1/[15:0] 2/[31:16] 43214321 87658765 little little 8 32 1/[7:0] 2/[15:8] 3/[23:16] 4/[31:24] 21 43 65 87 1/[31:0] 87654321 little little 16 8 1/[7:0] 1/[15:8] 2/[23:16] 2/[31:24] 21 43 65 87 1/[7:0] 2/[15:8] 3/[23:16] 4/[31:24] 21212121 43434343 65656565 87878787 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 284 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller little little 16 16 1/[7:0] 1/[15:8] 2/[23:16] 2/[31:24] 21 43 65 87 1/[15:0] 2/[31:16] 43214321 87658765 little little 16 32 1/[7:0] 1/[15:8] 2/[23:16] 2/[31:24] 21 43 65 87 1/[31:0] 87654321 little little 32 8 1/[7:0] 1/[15:8] 1/[23:16] 1/[31:24] 21 43 65 87 1/[7:0] 2/[15:8] 3/[23:16] 4/[31:24] 21212121 43434343 65656565 87878787 little little 32 16 1/[7:0] 1/[15:8] 1/[23:16] 1/[31:24] 21 43 65 87 1/[15:0] 2/[31:16] 43214321 87658765 little little 32 32 1/[7:0] 1/[15:8] 1/[23:16] 1/[31:24] 21 43 65 87 1/[31:0] 87654321 big big 8 8 1/[31:24] 2/[23:16] 3/[15:8] 4/[7:0] 12 34 56 78 1/[31:24] 2/[23:16] 3/[15:8] 4/[7:0] 12121212 34343434 56565656 78787878 big big 8 16 1/[31:24] 2/[23:16] 3/[15:8] 4/[7:0] 12 34 56 78 1/[15:0] 2/[31:16] 12341234 56785678 big big 8 32 1/[31:24] 2/[23:16] 3/[15:8] 4/[7:0] 12 34 56 78 1/[31:0] 12345678 big big 16 8 1/[31:24] 1/[23:16] 2/[15:8] 2/[7:0] 12 34 56 78 1/[31:24] 2/[23:16] 3/[15:8] 4/[7:0] 12121212 34343434 56565656 78787878 big big 16 16 1/[31:24] 1/[23:16] 2/[15:8] 2/[7:0] 12 34 56 78 1/[15:0] 2/[31:16] 12341234 56785678 table 217. endian behavior ?continued source endian destination endian source width destination width source transfer no/byte lane source data destination transfer no/byte lane destination data www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 285 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.7.1.6.3 error conditions an error during a dma transfer is flagged directly by the peripheral by asserting an error response on the ahb bus during the transfer. the dma controller automatically disables the dma stream after the current transfer has completed, and can optionally generate an error interrupt to the cpu. this error interrupt can be masked. 16.7.1.7 channel hardware each stream is supported by a dedicated hardware channel, including source and destination controllers , as well as a fifo. this enables better latency than a dma controller with only a single hardware channel shared between several dma streams and simplifies the control logic. 16.7.1.8 dma request priority dma channel priority is fixed. dma channel 0 has the highest priority and dma channel 7 has the lowest priority. if the dma controller is transferring data for the lower priority channel and then the higher priority channel goes active, it completes the number of transfers delegated to the master interface by the lower priority channel before s witching over to transfer data for the higher priority channel. in the worst case this is as large as a one quadword. it is recommended that memory-to-memory tr ansactions use the lowest priority channel. otherwise other ahb bus masters are prevented from accessing the bus during dma controller memory-to-memory transfer. 16.7.1.9 interrupt generation a combined interrupt output is generated as an or function of the individual interrupt requests of the dma controller and is connected to the interrupt controller. big big 16 32 1/[31:24] 1/[23:16] 2/[15:8] 2/[7:0] 12 34 56 78 1/[31:0] 12345678 big big 32 8 1/[31:24] 1/[23:16] 1/[15:8] 1/[7:0] 12 34 56 78 1/[31:24] 2/[23:16] 3/[15:8] 4/[7:0] 12121212 34343434 56565656 78787878 big big 32 16 1/[31:24] 1/[23:16] 1/[15:8] 1/[7:0] 12 34 56 78 1/[15:0] 2/[31:16] 12341234 56785678 big big 32 32 1/[31:24] 1/[23:16] 1/[15:8] 1/[7:0] 12 34 56 78 1/[31:0] 12345678 table 217. endian behavior ?continued source endian destination endian source width destination width source transfer no/byte lane source data destination transfer no/byte lane destination data www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 286 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.8 using the dma controller 16.8.1 programming the dma controller all accesses to the dma controller internal register must be word (32-bit) reads and writes. 16.8.1.1 enabling the dma controller to enable the dma controller set the enable bit in the config register. 16.8.1.2 disabling the dma controller to disable the dma controller: ? read the enbldchns register and ensure that all the dma channels have been disabled. if any channels are active, see disabling a dma channel. ? disable the dma controller by wr iting 0 to the dma enable bi t in the config register. 16.8.1.3 enabling a dma channel to enable the dma channel set the channel enable bit in the relevant dma channel configuration register. note that the channel mu st be fully initialized before it is enabled. 16.8.1.4 disabling a dma channel a dma channel can be disabled in three ways: ? by writing directly to the channel enable bit. any outstanding data in the fifo?s is lost if this method is used. ? by using the active and halt bits in conjunction with the channel enable bit. ? by waiting until the transfer completes. this automa tically clears the channel. disabling a dma channel and losing data in the fifo clear the relevant channel enable bit in the relevant channel configuration register. the current ahb transfer (if one is in progress) completes and the channel is disabled. any data in the fifo is lost. disabling the dma channel without losing data in the fifo ? set the halt bit in the relevant channel conf iguration register. this causes any future dma request to be ignored. ? poll the active bit in the relevant channel conf iguration register until it reaches 0. this bit indicates whether there is any data in the channel that has to be transferred. ? clear the channel enable bit in the relevant channel configuration register 16.8.1.5 setting up a new dma transfer to set up a new dma transfer: if the channel is not set as ide for the dma transaction: 1. read the enbldchns controller register a nd find out which channels are inactive. 2. choose an inactive channel that has the required priority. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 287 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 3. program the dma controller 16.8.1.6 halting a dma channel set the halt bit in the relevant dma channel configuration register. the current source request is serviced. any further source dma re quest is ignored until the halt bit is cleared. 16.8.1.7 programming a dma channel 1. choose a free dma channel with the priority needed. dma channel 0 has the highest priority and dma channel 7 the lowest priority. 2. clear any pending interrupts on the channel to be used by writing to the inttcclear and interrclear register. the previous chan nel operation might have left interrupt active. 3. write the source address into the csrcaddr register. 4. write the destination address into the cdestaddr register. 5. write the address of the next lli into the clli register. if the transfer comprises of a single packet of data then 0 must be written into this register. 6. write the control information into the ccontrol register. 7. write the channel configuration information into the cconfig register. if the enable bit is set then the dma chan nel is automatically enabled. 16.8.2 flow control the peripheral that controls the length of t he packet is known as the flow controller. the flow controller is usually the dma controller where the packet length is programmed by software before the dma channel is enabled. if the packet length is unknown when the dma channel is enabled, either the source or destination peripherals can be used as the flow controller. for simple or low-performance peripherals that know the packet length (that is, when the peripheral is the flow controller), a simple wa y to indicate that a transaction has completed is for the peripheral to generate an interrupt and enable the processor to reprogram the dma channel. the transfer size value (in the ccontrol regist er) is ignored if a peripheral is configured as the flow controller. when the dma transfer is completed: 1. the dma controller issues an acknowledge to the peripheral in order to indicate that the transfer has finished. 2. a tc interrupt is generated, if enabled. 3. the dma controller moves on to the next lli. the following sections describe the dma controller data flow sequences for the four allowed transfer types: ? memory-to-peripheral (master 1 only). ? peripheral-to-memory (master 1 only). ? memory-to-memory. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 288 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller ? peripheral-to-peripheral (master 1 only). each transfer type can have either the peri pheral or the dma controller as the flow controller so there are eight possible control scenarios. table 218 indicates the request signals used for each type of transfer. 16.8.2.1 peripheral-to-memory or memory-to-peripheral dma flow for a peripheral-to-memory or memory-to-pe ripheral dma flow, the following sequence occurs: 1. program and enable the dma channel. 2. wait for a dma request. 3. the dma controller starts transferring data when: ? the dma request goes active. ? the dma stream has the highest pending priority. ? the dma controller is the bus master of the ahb bus. 4. if an error occurs while transferring the data, an error interrupt is generated and disables the dma stream, and the flow sequence ends. 5. decrement the transfe r count if the dma controller is performing the flow control. 6. if the transfer has completed (indicated by the transfer count reaching 0, if the dma controller is performing flow control, or by the peripheral sending a dma request, if the peripheral is performing flow control): ? the dma controller responds with a dma acknowledge. ? the terminal count interrupt is generated (this interrupt can be masked). ? if the clli register is not 0, then reload the csrcaddr, cdestaddr, clli, and ccontrol registers and go to back to st ep 2. however, if clli is 0, the dma stream is disabled and the flow sequence ends. 16.8.2.2 peripheral-to-peripheral dma flow for a peripheral-to-peripheral dma flow, the following sequence occurs: 1. program and enable the dma channel. 2. wait for a source dma request. 3. the dma controller starts transferring data when: table 218. dma request signal usage transfer direction request generator flow controller memory-to-peripheral peripheral dma controller memory-to-peripheral peripheral peripheral peripheral-to-memory peri pheral dma controller peripheral-to-memory pe ripheral peripheral memory-to-memory dma c ontroller dma controller source peripheral to destination peripheral source peri pheral and destination peripheral source peripheral source peripheral to destination peripheral source peri pheral and destination peripheral destination peripheral source peripheral to destination peripheral source pe ripheral and destination peripheral dma controller www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 289 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller ? the dma request goes active. ? the dma stream has the highest pending priority. ? the dma controller is the bus master of the ahb bus. 4. if an error occurs while transferring the da ta an error interrupt is generated, the dma stream is disabled, and the flow sequence ends. 5. decrement the transfe r count if the dma controller is performing the flow control. 6. if the transfer has completed (indicated by the transfer count reaching 0 if the dma controller is performing flow control, or by the peripheral sending a dma request if the peripheral is performing flow control): ? the dma controller responds with a dma acknowledge to the source peripheral. ? further source dma requests are ignored. 7. when the destination dma request goes active and there is data in the dma controller fifo, transfer data into the destination peripheral. 8. if an error occurs while transferring the da ta, an error interrupt is generated, the dma stream is disabled, and the flow sequence ends. 9. if the transfer has completed it is indicated by the transfer count reaching 0 if the dma controller is performing flow control, or by the sending a dma request if the peripheral is performing flow control. the following happens: ? the dma controller responds with a dma acknowledge to the destination peripheral. ? the terminal count interrupt is generated (this interrupt can be masked). ? if the clli register is not 0, then reload the csrcaddr, cdestaddr, clli, and ccontrol registers and go to back to step 2. however, if clli is 0, the dma stream is disabled and the flow sequence ends. 16.8.2.3 memory-to-memory dma flow for a memory-to-memory dma flow the following sequence occurs: 1. program and enable the dma channel. 2. transfer data whenever the dma channel has the highest pending priority and the dma controller gains mastership of the ahb bus. 3. if an error occurs while transferring the data, generate an error interrupt and disable the dma stream. 4. decrement the transfer count. 5. if the count has reached zero: ? generate a terminal count interrup t (the interrupt can be masked). ? if the clli register is not 0, then reload the csrcaddr, cdestaddr, clli, and ccontrol registers and go to back to step 2. however, if clli is 0, the dma stream is disabled and the flow sequence ends. note: memory-to-memory transfers should be programmed with a low channel priority, otherwise other dma channels cannot acce ss the bus until the memory-to-memory transfer has finished, or other ahb masters cannot perform any transaction. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 290 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 16.8.3 interrupt requests interrupt requests can be generated when an ahb error is encountered or at the end of a transfer (terminal count), after all the data corresponding to the current lli has been transferred to the destination. the interrupts can be masked by programming bits in the relevant ccontrol and cconfig channel registers. interrupt status registers are provided which group the interrupt requests from all the dma channels prior to interrupt masking (rawinttcstat and rawinterrstat), and after interrupt masking (inttcstat and interrstat). the intstat register combines both the inttcstat and interrstat requests into a single register to enable the source of an interrupt to be quickly found. writing to the inttcclear or the interrclr registers with a bit set high enables selective cl earing of interrupts. 16.8.3.1 hardware interrupt sequence flow when a dma interrupt request occurs, the interrupt service routine needs to: 1. read the inttcstat register to determi ne whether the interrupt was generated due to the end of the transfer (terminal count). a high bit indicates that the transfer completed. if more than one request is ac tive, it is recommended that the highest priority channels be checked first. 2. read the interrstat register to determi ne whether the interrupt was generated due to an error occurring. a high bit indicates that an error occurred. 3. service the interrupt request. 4. for a terminal count interrup t, write a 1 to the relevant bit of the inttcclr register. for an error interrupt write a 1 to the releva nt bit of the interrclr register to clear the interrupt request. 16.8.4 address generation address generation can be either incrementing or non-incrementing (address wrapping is not supported). some devices, especially memories, disallo w burst accesses ac ross certain address boundaries. the dma controller assumes that this is the case with any source or destination area, which is co nfigured for incrementing addressing. this boundary is assumed to be aligned with the specified burst size. for example, if the channel is set for 16-transfer burst to a 32-bit wide device then the boundary is 64-bytes aligned (that is address bits [5:0] equal 0). if a dma burst is to cross one of these boundaries, then, instead of a burst, that transfer is sp lit into separate ahb transactions. note: when transferring data to or from the sdram, the sdram ac cess must always be programmed to 32 bit accesses. the sdram memory controller does not support ahb-incr4 or incr8 bursts using halfword or byte transfer-size. start address in sdram should always be aligned to a burst boundary address. 16.8.4.1 word-aligned transfers across a boundary the channel is configured fo r 16-transfer bursts, each tr ansfer 32-bits wide, to a destination for which address incrementing is enabled. the start address for the current burst is 0x0c000024, the next boundary (cal culated from the burst size and transfer width) is 0x0c000040. the transfer will be split in to two ahb transactions: www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 291 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller ? a 7-transfer burst starting at address 0x0c000024 ? a 9-transfer burst starting at address 0x0c000040. 16.8.5 scatter/gather scatter/gather is supported through the use of linked lists. this means that the source and destination areas do not have to occupy contiguous areas in memory. where scatter/gather is not required, the clli register must be set to 0. the source and destination data areas are defined by a series of linked lists. each linked list item (lli) controls the tran sfer of one block of data, and then optionally loads another lli to continue the dma operation, or stop s the dma stream. the first lli is programmed into the dma controller. the data to be transferred described by a lli (referred to as the packet of data) usually requires one or more dma bursts (to each of the source and destination). 16.8.5.1 linked list items a linked list item (lli) consists of four wo rds. these words are organized in the following order: 1. csrcaddr 2. cdestaddr 3. clli 4. ccontrol note: the cconfig dma channel configuration re gister is not part of the linked list item. 16.8.5.1.1 programming the dma controller for scatter/gather dma to program the dma contro ller for scatter/gather dma: 1. write the llis for the complete dma transfer to memory. each linked list item contains four words: ? source address. ? destination address. ? pointer to next lli. ? control word. the last lli has its linked list word pointer set to 0. 2. choose a free dma channel with the priority required. dma channel 0 has the highest priority and dma channel 7 the lowest priority. 3. write the first linked list item, previously wr itten to memory, to th e relevant channel in the dma controller. 4. write the channel configuration information to the channel configuration register and set the channel enable bit. the dma cont roller then transfers the first and then subsequent packets of data as each linked list item is loaded. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 292 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller 5. an interrupt can be generated at the end of each lli depending on the terminal count bit in the ccontrol regist er. if this bit is set an interrupt is generated at the end of the relevant lli. the interrupt requ est must then be serviced and the relevant bit in the inttcclear register must be set to clear the interrupt. 16.8.5.1.2 example of scatter/gather dma see figure 27 for an example of an lli. a section of memory is to be transferred to a peripheral. the addresses of each lli entry ar e given, in hexadecimal, at the left-hand side of the figure. the right side of the figure shows the memory containing the data to be transferred. the first lli, stored at 0x2002 0000, defines th e first block of data to be transferred, which is the data stored from address 0x2002 a200 to 0x2002 adff: ? source start address 0x2002 a200. ? destination address set to the destination peripheral address. ? transfer width, word (32-bit). ? transfer size, 3072 bytes (0xc00). ? source and destination burst sizes, 16 transfers. ? next lli address, 0x2002 0010. the second lli, stored at 0x2002 0010, desc ribes the next block of data to be transferred: ? source start address 0x2002 b200. ? destination address set to the destination peripheral address. fig 27. lli example lli1 0x2002 0000 source address = 0x 2002 a200 destination address = peripheral next lli address = 0x2002 0010 control information = length 3072 source address = 0x 2002 b200 destination address = peripheral next lli address = 0x2002 0020 control information = length 3072 source address = 0x 2002 c200 destination address = peripheral next lli address = 0x2002 0030 control information = length 3072 source address = 0x 2003 1200 destination address = peripheral next lli address = 0 (end of list) control information = length 3072 lli2 0x2002 0010 lli3 0x2002 0020 lli8 0x2002 0070 linked list array 3072 bytes of data 0x2002 a200 0x2002 adff 3072 bytes of data 0x2002 b200 0x2002 bdff 3072 bytes of data 0x2002 c200 0x2002 cdff 3072 bytes of data 0x2003 1200 0x2003 1dff www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 293 of 1164 nxp semiconductors UM10430 chapter 16: lpc18xx general purpose dma (gpdma) controller ? transfer width, word (32-bit). ? transfer size, 3072 bytes (0xc00). ? source and destination burst sizes, 16 transfers. ? next lli address, 0x2002 0020. a chain of descriptors is built up, each one pointing to the next in the series. to initialize the dma stream, the first lli, 0x2002 0000, is programmed into the dma controller. when the first packet of data has been transferred the next lli is automatically loaded. the final lli is stored at 0x2002 0070 and contains: ? source start address 0x2003 1200. ? destination address set to the destination peripheral address. ? transfer width, word (32-bit). ? transfer size, 3072 bytes (0xc00). ? source and destination burst sizes, 16 transfers. ? next lli address, 0x0. because the next lli address is set to zero , this is the last descriptor, and the dma channel is disabled after transferring the last item of data. the channel is probably set to generate an interrupt at this point to indicate to the arm processor that the channel can be reprogrammed. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 294 of 1164 17.1 how to read this chapter the spifi is available on all lpc18xx parts. 17.2 basic configuration the spifi is configured as follows: ? see ta b l e 2 1 9 for clocking and power control. ? the spifi is reset by the spifi_rst (reset # 53). 17.3 features ? interfaces to serial flash me mory in the main memory map. ? supports 1-, 2-, and 4-bit bidirectional serial protocols. ? half-duplex protocol compatible with various vendors and devices. ? data rates of up to 66 mb per second. 17.4 general description the spi flash interface (spifi) allows low-cost serial flash memories to be connected to the cortex-m3 processor with little performa nce penalty compared to parallel flash devices with higher pin count. a driver api included in on-chip rom handles setup, programming and erasure. after an initialize call to the spifi driv er, the flash content is accessible as normal memory using byte, halfword, and word accesses by the processor and/or dma channels. many serial flash devices use a half-duplex command-driven spi protocol for device setup and initialization. quad devices then use a half-duplex, command-driven 4-bit protocol for normal operation. different serial flash vendo rs and devices accept or require different commands and command fo rmats. spifi provides sufficient flexibility to be compatible with common flash devices, and includes extensions to he lp insure compatibility with future devices. serial flash devices respond to commands sent by software or automatically sent by the spifi when software reads either of the two read-only serial flash regions in the memory map (see ta b l e 2 2 0 ). UM10430 chapter 17: lpc18xx spi flash interface (spifi) rev. 00.13 ? 20 july 2011 user manual table 219. spifi clocking and power control base clock branch clock maximum frequency spifi ahb register clock (hclk) base_m3_clk clk_m3_spifi 150 mhz spifi serial clock input (sck i) base_spifi_clk spifi_clk 132 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 295 of 1164 nxp semiconductors UM10430 chapter 17: lpc18xx spi flash interface (spifi) commands are divided into fields called opcode, address, intermediate, and data. the address, intermediate, and data fields are optional depending on the opcode. some devices include a mode in which the opcode can be implied in read commands for higher performance. data fields are further divided in to input and output data fields depending on the opcode. remark: flashless parts (lpc1850/30/20/10) can use the spifi for booting. see section 3.3.4.3 . 17.5 pin description 17.6 spifi api calls the spifi interface is controlled through a set of simple api calls located in the lpc18xx rom. table 220. spifi flash memory map memory address spifi data 0x1400 0000 to 0x17ff ffff 0x8000 0000 to 0x87ff ffff remark: these are the spaces allocated to the spifi in the lpc18xx. the same data appears in the first area and the first half of the second area. these areas allow maxima of 64 and 128 mb of spi flash (respectively) to be mapped into the cortex-m3 memory space. in practice, the usable space is limited to the size of the connected device table 221. spifi pin description pin direction description spifi_sck o serial clock for the flash memory, switched only during active bits on the mosi/io0, miso/io1, and io3:2 lines. spifi_cs o chip select for the flash memory, driven low while a command is in progress, and high between commands. in the typical case of one serial slave, this signal can be connected directly to the device. if more than one serial slave is connected, software and off-chip hardware should use general-purpose i/o signals in combination with this signal to generate the chip selects for the various slaves. spifi_mosi or io0 i/o this is an output except in quad/dual input data fields. after a quad/dual input data field, it becomes an output again one serial clock period after cs goes high. spifi_miso or io1 i/o this is an output in quad/dual opcode, address, intermediate, and output data fields, and an input in spi mode and in quad/dual input data fields. after an input data field in quad/dual mode, it becomes an output again one serial clock period after cs goes high. spifi_sio[3:2] i/o these are outputs in quad opcode, address, intermediate, and output data fields, and inputs in quad input data fields. if the flash memory does not have quad capability, these pins can be assigned to gpio or other functions. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 296 of 1164 18.1 how to read this chapter the sd/mmc card interface is available on lpc18xx rev ?a?. 18.2 basic configuration the sdio is reset by the sd_rst (reset # 20). 18.3 features the sd/mmc card interface supports the following modes: ? secure digital memo ry (sd version 3.0) ? secure digital i/o (sdio version 2.0) ? consumer electronics advanced transport architecture (ce-ata version 1.1) ? multimedia cards (mmc version 4.4) 18.4 general description UM10430 chapter 18: lpc18xx sd/mmc interface rev. 00.13 ? 20 july 2011 user manual table 222. sdio clocking and power control base clock branch clock maximum frequency sdio register interface base_m3_clk clk_m3_sdio 150 mhz sdio bit rate clock base_sdio_clk clk_sdio www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 297 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.5 pin description fig 28. sd/mmc block diagram registers fifo control dma interface control biu fifo ram**** clock control clk interrupts , status apb/ahb slave ram interface *** synchronizer output hold register cards socket regulators power switches cclk ccmd cdata write protect card detect cclk_in_drv cclk_in_sample cclk_in host interface unit sdio interrupt control ciu power, pullup, card detect, & debounce control interrupt control input sample register note: the card_detect and write-protect signals are from the sd/mmc card socket and not from the sd/mmc card. internal dma controller interface ahb master interface *** optional ram interface mux/ de-mux unit command control path data path control fifo ram can be chosen as either internal or external ram **** table 223. sdio pin description pin name direction description sd_clk o sd/sdio/mmc clock sd_cd o sdio card detect for single slot sd_wp o sdio card write protect sd_led o led on signal. this signal cautions the user not to remove the sd card while it is accessed. sd_cmd i/o command input/output sd_d[7:0] i/o data input/output for data lines dat[7:0] sd_pow sd_volt[2:0] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 298 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6 register description table 224. register overview: sdmmc (base address: 0x4000 4000) name access address offset description reset value ctrl r/w 0x000 control register pwren r/w 0x004 power enable register clkdiv r/w 0x008 clock divider register clksrc r/w 0x00c sd cl ock source register clkena r/w 0x010 clo ck enable register tmout r/w 0x014 time-out register ctype r/w 0x018 card type register blksiz r/w 0x01c block size register bytcnt r/w 0x020 byte count register intmask r/w 0x024 inte rrupt mask register cmdarg r/w 0x028 command argument register 0x00000000 cmd r/w 0x02c command register 0x00000000 resp0 r 0x030 response register 0 0x00000000 resp1 r 0x034 response register 1 0x00000000 resp2 r 0x038 response register 2 0 resp3 r 0x03c response register 3 0 mintsts r 0x040 masked interrupt status register reset value rintsts r/w 0x044 raw interrupt status register 0 status r 0x048 status register fifoth r/w 0x04c fifo threshold watermark register cdetect r 0x050 card detect register wrtprt r 0x054 write protect register gpio r/w 0x058 general purpose input/output register tcbcnt r 0x05c transferred ciu card byte count register 0x00000000 tbbcnt r 0x060 transferred host to biu-fifo byte count register 0 debnce r/w 0x064 debounce count register usrid r/w 0x068 user id register verid r 0x06c version id register 0x5342230a uhs_reg r/w 0x074 uhs-1 register 0x00000000 rst_n r/w 0x078 hardware reset bmod r/w 0x080 bus mode register 0x00000000 pldmnd w 0x084 poll demand register 0x00000000 dbaddr r/w 0x088 descriptor list base address register 0x00000000 idsts r/w 0x08c internal dmac status register 0x00000000 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 299 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.1 control register (ctrl) idinten r/w 0x090 internal dmac interrupt enable register 0x00000000 dscaddr r 0x094 current host descriptor address register 0x00000000 bufaddr r 0x098 current buffer descriptor address register 0x00000000 table 224. register overview: sdmmc (base address: 0x4000 4000) name access address offset description reset value table 225. control register (ctrl, address 0x4000 4000) bit description bit symbol value description reset value 0 controller_reset controller reset. to reset cont roller, firmware should set bit to 1. this bit is auto-cleared after two ahb and two cclk_in clock cycles. this resets: - biu/ciu interface - ciu and state machines - abort_read_data, send_irq_response, and read_wait bits of control register - start_cmd bit of command register does not affect any registers or dma interface, or fifo or host interrupts 0 0 no change 1 reset dwc_mobile_storage controller 1 fifo_reset fifo reset. to rese t fifo, firmware should set bit to 1. this bit is auto-cleared after completion of reset operation. auto-cleared after two ahb clocks. 0 0 no change 1 reset to data fifo to reset fifo pointers 2 dma_reset dma_reset. to reset dma interface, firmware should set bit to 1. this bit is auto-cleared after two ahb clocks. 0 0 no change 1 reset internal dma interface control logic 3- reserved - 4 int_enable global interrupt enable/disable bit. the int port is 1 only when this bit is 1 and one or more unmasked interrupts are set. 0 0 disable interrupts 1 enable interrupts 5 dma_enable dma enable. valid only if dwc_mobile_storage configured for external dma interface. even when dma mode is enabled, host can still push/pop data into or from fifo; this should not happen during the normal operation. if there is simultaneous fifo access from host/dma, the data coherency is lo st. also, there is no arbitration inside dwc_mobile_storage to prioritize simultaneous host/dma access. 0 0 disable dma transfer mode 1 enable dma transfer mode www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 300 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 6 read_wait read_wait. for sending read-wait to sdio cards. 0 0 clear read wait 1 assert read wait 7 send_irq_respons e send irq response. bit automatically clears once response is sent. to wait for mmc card interrupts, host issues cmd40, and dwc_mobile_storage waits for interrupt response from mmc card(s). in meantime, if host wants dwc_mobile_storage to exit waiting for interrupt state, it can set this bit, at which time dwc_mobile_storage command state-machine sends cmd40 response on bus and returns to idle state. 0 0 no change 1 send auto irq response 8 abort_read_data abort read data. used in sdio card suspend sequence. 0 0 no change 1 after suspend command is issued during read-transfer, software polls card to find when suspend happened. once suspend occurs, software sets bit to reset data state-machine, which is waiting for next block of data. bit automatically clears once data state machine resets to idle. 9 send_ccsd send ccsd. when set, dwc_mobile_storage sends ccsd to ce-ata device. software sets this bit only if current command is expecting ccs (that is, rw_blk) and interrupts are enabled in ce-ata device. once the ccsd pattern is sent to device, dwc_mobile_storage automatically clears send_ccsd bit. it also sets command done (cd) bit in rintsts register and generates interrupt to host if command done interrupt is not masked. note: once send_ccsd bit is set, it takes two card clock cycles to drive the ccsd on the cmd line. due to this, during the boundary conditions it may happen that ccsd is sent to the ce-ata device, even if the device signalled ccs. 0 0 clear bit if dwc_mobile_storage does not reset the bit. 1 send command completion signal disable (ccsd) to ce-ata device 10 send_auto_stop_c csd send auto stop ccsd. note: always set send_auto_stop_ccsd and send_ccsd bits together; send_aut o_stop_ccsd should not be set independent of send_ccsd. when set, dwc_mobile_storage automatically sends internallygenerated stop command (cmd12) to ce-ata device. after sending internally-generated stop command, auto command done (acd) bit in rintsts is set and generates interrupt to host if auto command done interrupt is not masked. after sending the ccsd, dwc_mobile_storage automatically clears send_auto_stop_ccsd bit. 0 0 clear bit if dwc_mobile_storage does not reset the bit. 1 send internally generated stop after sending ccsd to ce-ata device. table 225. control register (ctrl, address 0x4000 4000) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 301 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.2 power enable register (pwren) 11 ceata_device_inte rrupt _status ceata device interrupt status. software should appropriately write to this bit after power-on reset or any other reset to ce-ata device. after reset, usually ce-ata device interrupt is disabled (nien = 1). if the host enables ce-ata device interrupt, then software should set this bit. 0 0 interrupts not enabled in ce-ata device (nien = 1 in ata control register) 1 interrupts are enabled in ce-ata device (nien = 0 in ata control register) 15:12 - reserved 19:16 card_voltage_a card regulator-a voltage setting; output to card_volt_a port. optional feature; ports can be used as general-purpose outputs. 0 23:20 card_voltage_b card regulator-b voltage setting; output to card_volt_b port. optional feature; ports can be used as general-purpose outputs. 0 24 enable_od_pullup external open-drain pull up. inverted value of this bit is output to ccmd_od_pullup_en_n port. when bit is set, command output always driven in open-drive mode; that is, dwc_mobile_storage drives either 0 or high impedance, and does not drive hard 1. 1 0 disable 1 enable 25 use_internal_dma c present only for the internal dmac configuration; else, it is reserved. 0 0 the host performs data transfers through the slave interface 1 internal dmac used for data transfer 31:26 - reserved table 225. control register (ctrl, address 0x4000 4000) bit description bit symbol value description reset value table 226. power enable register (pwr en, address 0x4000 4004) bit description bit symbol description reset value 29:0 power_enable power on/off switch for up to 16 cards; for example, bit[0] controls card 0. once power is turned on, firmware should wait for regulator/switch ramp-up time before trying to initialize card. 0 - power off 1 - power on only num_cards number of bits are implemented. bit values output to card_power_en port. optional feature; ports can be used as general-purpose outputs. 0 31:30 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 302 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.3 clock divider register (clkdiv) 18.6.4 sd clock source register (clksrc) table 227. clock divider register (clkdiv, address 0x4000 4008) bit description bit symbol description reset value 7:0 clk_divider0 clock divider-0 value. clock division is 2*n. for example, value of 0 means divide by 2*0 = 0 (no division, bypass), value of 1 means divide by 2*1 = 2, value of ff means divide by 2*255 = 510, and so on. 0 15:8 clk_divider1 clock divider-1 value. clock division is 2*n. for example, value of 0 means divide by 2*0 = 0 (no division, bypass), value of 1 means divide by 2*1 = 2, value of ff means divide by 2*255 = 510, and so on. in mmc-ver3.3-only mode, bits not implemented because only one clock divider is supported. 0 23:16 clk_divider2 clock divider-2 value. clock division is 2*n. for example, value of 0 means divide by 2*0 = 0 (no division, bypass), value of 1 means divide by 2*1 = 2, value of ff means divide by 2*255 = 510, and so on. in mmc-ver3.3-only mode, bits not implemented because only one clock divider is supported. 0 31:24 clk_divider3 clock divider-3 value. clock division is 2*n. for example, value of 0 means divide by 2*0 = 0 (no division, bypass), a value of 1 means divide by 2*1 = 2, a value of ff means divide by 2*255 = 510, and so on. in mmc-ver3.3-only mode, bits not implemented because only one clock divider is supported. divide by 2*0 = 0 (no division, bypass), value of 1 means divide by 2*1 = 2, value of ff means divide by 2*255 = 510, and so on. in mmc-ver3.3-only mode, bits not implemented because only one clock divider is supported. 0 table 228. sd clock source register (clksrc, address 0x4000 400c) bit description bit symbol description reset value 31:0 clk_source clock divider source for up to 16 sd cards supported. each card has two bits assigned to it. for example, bits[1:0] assigned for card-0, which maps and internally routes clock divider[3:0] outputs to cclk_out[15:0] pins, depending on bit value. 00 - clock divider 0 01 - clock divider 1 10 - clock divider 2 11 - clock divider 3 in mmc-ver3.3-only controller, only one clock divider supported. the cclk_out is always from clock divider 0, and this register is not implemented. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 303 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.5 clock enable register (clkena) 18.6.6 time-out register (tmout) table 229. clock enable register (clke na, address 0x4000 4010) bit description bit symbol description reset value 15:0 cclk_enable low-power control fo r up to 16 sd card clocks and one mmc card clock supported. 0 - non-low-power mode 1 - low-power mode; stop clock when card in idle (should be normally set to only mmc and sd memory cards; for sdio cards, if interrupts mu st be detected , clock should not be stopped). in mmc-ver3.3-only mode, since there is only one cclk_out, only cclk_low_power[0] is used. supported. 0 - clock disabled 1 - clock enabled in mmc-ver3.3-only mode, since there is only one cclk_out, only cclk_enable[0] is used. 0 31:16 cclk_low_po wer clock-enable control for up to 16 sd card clocks and one mmc card clock supported. 0 - clock disabled 1 - clock enabled in mmc-ver3.3-only mode, since there is only one cclk_out, only cclk_enable[0 ] is used. supported. 0 - non-low-power mode 1 - low-power mode; stop clock when card in idle (should be normally set to only mmc and sd memory cards; for sdio cards, if inte rrupts must be detected, clock should not be stopped). in mmc-ver3.3-only mode, since there is only one cclk_out, only cclk_lo w_power[0] is used. 0 table 230. time-out register (tmout, address 0x4000 4014) bit description bit symbol description reset value 7:0 response_tim eout response time-out value. value is in number of card output clocks - cclk_out. 0x40 31:8 data_timeout value for card data read time-out; same value also used for data starvation by host time-out. value is in number of card output clocks - cclk_out of selected card. starvation by host time-out. value is in number of card output clocks - cclk_out of selected card. 0xffffff www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 304 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.7 card type register (ctype) 18.6.8 block size register (blksiz) 18.6.9 byte count register (bytcnt) 18.6.10 interrupt mask register (intmask) table 231. card type register (ctype, address 0x4000 4018) bit description bit symbol description reset value 15:0 card_width one bit per card indicates if card is 1-bit or 4-bit: 0 - 1-bit mode 1 - 4-bit mode bit[15] corresponds to card[15], bit[0] corresponds to card[0]. only num_cards*2 number of bits are implemented. 0 31:16 card_width one bit per card indicates if card is 8-bit: 0 - non 8-bit mode 1 - 8-bit mode bit[31] corresponds to card[15]; bit[16] corresponds to card[0]. 0 table 232. block size register (blksiz, address 0x4000 401c) bit description bit symbol description reset value 15:0 block_size block size 0x200 31:16 - reserved table 233. byte count register (bytcnt, address 0x4000 4020) bit description bit symbol description reset value 31:0 byte_count number of bytes to be transferred; should be integer multiple of block size for block transfers. for undefined number of byte transfers, byte count should be set to 0. when byte count is set to 0, it is responsibility of host to explicitly send stop/abort command to terminate data transfer. 0x200 table 234. interrupt mask register (intmask, address 0x4000 4024) bit description bit symbol description reset value 0 cd card detect. bits used to mask unwanted interrupts. value of 0 masks interrupt; value of 1 enables interrupt. 0 1 re response error. bits used to mask unwanted interrupts. value of 0 masks interrupt; va lue of 1 enables interrupt. 0 2 cd command done. bits used to mask unwanted interrupts. value of 0 masks interrupt; va lue of 1 enables interrupt. 0 3 dto data transfer over. bits used to mask unwanted interrupts. value of 0 masks interrupt; va lue of 1 enables interrupt. 0 4 txdr transmit fifo data request. bits used to mask unwanted interrupts. value of 0 masks interrupt; value of 1 enables interrupt. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 305 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.11 command argument register (cmdarg) 5 rxdr receive fifo data request. bits used to mask unwanted interrupts. value of 0 masks interrupt; value of 1 enables interrupt. 0 6 rcrc response crc error. bits used to mask unwanted interrupts. value of 0 masks interrupt; value of 1 enables interrupt. 0 7 dcrc data crc error. bits used to mask unwanted interrupts. value of 0 masks interrupt; va lue of 1 enables interrupt. 0 8 rto response time-out. bits used to mask unwanted interrupts. value of 0 masks interrupt; value of 1 enables interrupt. 0 9 drto data read time-out. bits used to mask unwanted interrupts. value of 0 masks interrupt; va lue of 1 enables interrupt. 0 10 hto data starvation-by-host time-out (hto) /volt_switch_int. bits used to mask unwanted interrupts. value of 0 masks interrupt; value of 1 enables interrupt. 0 11 frun fifo underrun/overrun error. bits used to mask unwanted interrupts. value of 0 masks interrupt; value of 1 enables interrupt. 0 12 hle hardware locked write error. bits used to mask unwanted interrupts. value of 0 masks interrupt; value of 1 enables interrupt. 0 13 sbe start-bit error. bits used to mask unwanted interrupts. value of 0 masks interrupt; va lue of 1 enables interrupt. 0 14 acd auto command done. bits used to mask unwanted interrupts. value of 0 masks interrupt; value of 1 enables interrupt. 0 15 ebe end-bit error (read)/write no crc. bits used to mask unwanted interrupts. value of 0 masks interrupt; value of 1 enables interrupt. 0 31:16 sdio_int_mask mask sdio interrupts one bit for each card. bit[31] corresponds to card[15], and bit[16] corresponds to card[0]. when masked, sdio interrupt detection for that card is disabled. a 0 masks an interrupt, and 1 enables an interrupt. in mmc-ver3.3-only mode, these bits are always 0. 0 table 234. interrupt mask register (intmask, address 0x4000 4024) bit description bit symbol description reset value table 235. command argument register (c mdarg, address 0x4000 4028) bit description bit symbol description reset value 31:0 cmd_arg value indicates command argument to be passed to card. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 306 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.12 command register (cmd) table 236. command register (cmd, address 0x4000 402c) bit description bit symbol value description reset value 5:0 cmd_index command index 0 6 response_expect response expect 0 0 no response expected from card 1 response expected from card 7 response_ length response length 0 0 short response expected from card 1 long response expected from card 8 check_response_c rc check response crc some of command responses do not return valid crc bits. software should disabl e crc checks for those commands in order to disable crc checking by controller. 0 0 do not check response crc 1 check response crc 9 data_expected data expected 0 0 no data transfer expected (read/write) 1 data transfer expected (read/write) 10 read_write read/write. don't care if no data expected from card. 0 0 read from card 1 data transfer expected (read/write) 11 transfer_mode transfer mode. don't care if no data expected. 0 0 block data transfer command 1 stream data transfer command 12 send_auto_stop send auto stop. when set, dwc_mobile_storage sends stop command to sd_mmc_ceata cards at end of data transfer. refer to to determine: - when send_auto_stop bit should be set, since some data transfers do not need explicit stop commands - open-ended transfers that software should explicitly send to stop command additionally, when resume is sent to resume - suspended memory access of sd-combo card - bit should be set correctly if suspended data transfer needs send_auto_stop. don't care if no data expected from card. 0 0 no stop command sent at end of data transfer 1 send stop command at end of data transfer 13 wait_prvdata_com plete wait prvdata complete. the wait_prvdata_complete = 0 option typically used to query status of card during data transfer or to stop current data transfer; card_number should be same as in previous command. 0 0 send command at once, even if previous data transfer has not completed. 1 wait for previous data transfer completion before sending command. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 307 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 14 stop_abort_cmd stop abort cmd. when open-ended or predefined data transfer is in progress, and host issues stop or abort command to stop data transfer, bit should be set so that command/data state-machines of ciu can return correctly to idle state. this is also applicable for boot mode transfers. to abort boot mode, this bit should be set along with cmd[26] = disable_boot. 0 0 neither stop nor abort command to stop current data transfer in progress. if abort is sent to func tion-number currently selected or not in data-transfer mode, then bit should be set to 0. 1 stop or abort command intended to stop current data transfer in progress. 15 send_initialization send initia lization. after power on, 80 clo cks must be sent to card for initialization before sending any commands to card. bit should be set while sending first command to card so that controller will initialize clocks before sending comm and to card. this bit should not be set for either of the boot modes (alternate or mandatory). 0 0 do not send initialization sequence (80 clocks of 1) before sending this command. 1 send initialization sequence before sending this command. 20:16 card_number card number. card number in use. represents physical slot number of card being accessed. in mmc-ver3.3-only mode, up to 30 cards are supported; in sd-only mode, up to 16 cards are supported. registered version of this is reflected on dw_dma_card_num and ge_dma_card_num ports, which can be used to create separate dma requests, if needed. in addition, in sd mode this is used to mux or demux signals from selected card be cause each card is interfaced to dwc_mobile_storage by separate bus. 0 21 update_cloc_regi sters_only update clock registers only. following register values transferred into card clock domain: clkdiv, clrsrc, clkena. changes card clocks (change frequency, truncate off or on, and set low-frequency mode); provided in order to change clock frequency or stop clock without having to send command to cards. during normal command sequence, when update_clock_registers_only = 0, following control registers are transferred from bi u to ciu: cmd, cmdarg, tmout, ctype, blksiz, bytcnt. ciu uses new register values for new command sequence to card(s). when bit is set, there are no command done interrupts because no command is sent to sd_mmc_ceata cards. registers_only. 0 0 normal command sequence 1 do not send commands, just update clock register value into card clock domain table 236. command register (cmd, address 0x4000 402c) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 308 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 22 read_ceata_device read ceata device. software should set this bit to indicate that ce-ata device is being accessed for read transfer. this bit is used to disable read data time-out indication while performing ce-ata read transfers. maximum value of i/o transmission delay can be no less than 10 seconds. dwc_mobile_storage should not indicate read data time-out while waiting for data from ce-ata device. 0 0 host is not performing read access (rw_reg or rw_blk) towards ce-ata device. 1 host is performing read access (rw_reg or rw_blk) towards ce-ata device. 23 ccs_expected ccs expected. if the command expects command completion signal (ccs) from the ce-ata device, the software should set this control bit. dwc_mobile_storage sets data transfer over (dto) bit in rintsts register and generates interrupt to host if data transfer over interrupt is not masked. 0 0 interrupts are not enabled in ce-ata device (nien = 1 in ata control register), or command does not expect ccs from device. 1 interrupts are enabled in ce-ata device (nien = 0), and rw_blk command expects command completion signal from ce-ata device. 24 enable_boot enable boot - this bit should be set only for mandatory boot mode. when software sets this bit along with start_cmd, ciu starts the boot sequence for the corresponding card by asserting the cmd line low. do not set disable_boot and enable_boot together. 0 25 expect_boot_ack expect boot acknowledge. when software sets this bit along with enable_boot, ciu expects a boot acknowledge start pattern of 0-1-0 from the selected card. 0 26 disable_boot disable boot. when software se ts this bit along with start_cmd, ciu terminates the boot operation. do not set disable_boot and enable_boot together. 0 27 boot_mode boot mode 0 0 mandatory boot operation 1 alternate boot operation 28 volt_switch voltage switch bit 0 0 no voltage switching 1 voltage switching enabled; must be set for cmd11 only 30:29 - reserved 31 start_cmd start command. once command is taken by ciu, bit is cleared. when bit is set, host should not attempt to write to any command registers. if write is attempted, hardware lock error is set in raw interrupt register. once command is sent and response is received from sd_mmc_ceata cards, command done bit is set in raw interrupt register. table 236. command register (cmd, address 0x4000 402c) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 309 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.13 response re gister 0 (resp0) 18.6.14 response re gister 1 (resp1) 18.6.15 response re gister 2 (resp2) 18.6.16 response re gister 3 (resp3) 18.6.17 masked interrupt st atus register (mintsts) table 237. response regist er 0 (resp0, address 0x4000 4030) bit description bit symbol description reset value 31:0 response0 bit[31 :0] of response 0 table 238. response regist er 1 (resp1, address 0x4000 4034) bit description bit symbol description reset value 31:0 response1 register represents bit[ 63:32] of long response. when ciu sends auto-stop command, then response is saved in register. response for previous command sent by host is still preserved in response 0 register. additional auto-stop issued only for data transfer commands, and response type is always short for them. for information on when ciu sends auto-stop commands, refer to auto-stop . 0 table 239. response regist er 2 (resp2, address 0x4000 4038) bit description bit symbol description reset value 31:0 response2 bit[95:64] of long response 0 table 240. response regist er 3 (resp3, address 0x4000 403c) bit description bit symbol description reset value 31:0 response3 bit[127:96] of long response 0 table 241. masked interrupt status register (mintsts, address 0x4000 4040) bit description bit symbol description reset value 0 cd card detect. interrupt enabled only if corresponding bit in interrupt mask register is set. 1 re response error. interrupt enabled only if corresponding bit in interrupt mask register is set. 2 cd command done. interrupt enabled only if corresponding bit in interrupt mask register is set. 3 dto data transfer over. interrupt enabled only if corresponding bit in interrupt mask register is set. 4 txdr transmit fifo data request. interrupt enabled only if corresponding bit in interrupt mask register is set. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 310 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.18 raw interrupt stat us register (rintsts) 5 rxdr receive fifo data request. interrupt enabled only if corresponding bit in interrupt mask register is set. 6 rcrc response crc error. interrupt enabled only if corresponding bit in interrupt mask register is set. 7 dcrc data crc error. interrupt enabled only if corresponding bit in interrupt mask register is set. 8 rto response time-out. interrupt enabled only if corresponding bit in interrupt mask register is set. 9 drto data read time-out. interrupt enabled only if corresponding bit in interrupt mask register is set. 10 hto data starvation-by-host time-out (hto). interrupt enabled only if corresponding bit in interrupt mask register is set. 11 frun fifo underrun/overrun error. interrupt enabled only if corresponding bit in interrupt mask register is set. 12 hle hardware locked write error. interrupt enabled only if corresponding bit in interrupt mask register is set. 13 sbe start-bit error. interrupt enabled only if corresponding bit in interrupt mask register is set. 14 acd auto command done. interrupt enabled only if corresponding bit in interrupt mask register is set. 15 ebe end-bit error (read)/write no crc. interrupt enabled only if corresponding bit in interrupt mask register is set. 31:16 sdio_interr upt interrupt from sdio card; one bit for each card. bit[31] corresponds to card[15], and bit[16] is for card[0]. sdio interrupt for card enabled only if corresponding sdio_int_mask bit is set in interrupt mask register (mask bit 1 enables interrupt; 0 masks interrupt). 0 - no sdio interrupt from card 1 - sdio interrupt from card in mmc-ver3.3-only mode, bits always 0. table 241. masked interrupt status register (mintsts, address 0x4000 4040) bit description bit symbol description reset value table 242. raw interrupt status register (r intsts, address 0x4000 4044) bit description bit symbol description reset value 0 cd card detect. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 1 re response error. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 2 cd command done. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 3 dto data transfer over. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 311 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 4 txdr transmit fifo data request. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 5 rxdr receive fifo data request. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 6 rcrc response crc error. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 7 dcrc data crc error. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 8 rto_bar response time-out (rto )/boot ack received (bar). writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 9 drto_bds data read time-out (drto)/boot data start (bds). writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 10 hto data starvation-by-host time-out (hto). writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status./volt_switch_int 0 11 frun fifo underrun/overrun error. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 12 hle hardware locked write error. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 13 sbe start-bit error. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 14 acd auto command done. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 15 ebe end-bit error (read)/write no crc. writes to bits clear status bit. value of 1 clears status bit, and value of 0 leaves bit intact. bits are logged regardless of interrupt mask status. 0 31:16 sdio_interrupt interrupt from sdio card; one bit for each card. bit[31] corresponds to card[15], and bit[16] is for card[0]. writes to these bits clear them. value of 1 clears bit and 0 leaves bit intact. 0 - no sdio interrupt from card 1 - sdio interrupt from card in mmc-ver3.3-only mode, bits always 0. bits are logged regardless of interrupt-mask status. 0 table 242. raw interrupt status register (r intsts, address 0x4000 4044) bit description bit symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 312 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.19 status register (status) table 243. status register (status, address 0x4000 4048) bit description bit symbol description reset value 0fifo_rx_waterm ark fifo reached receive watermark level; not qualified with data 0 1fifo_tx_waterm ark fifo reached transmit watermark level; not qualified with data transfer. 1 2 fifo_empty fifo is empty status 1 3 fifo_full fifo is full status 0 7:4 cmdfsmstates command fsm states: 0 - idle 1 - send init sequence 2 - tx cmd start bit 3 - tx cmd tx bit 4 - tx cmd index + arg 5 - tx cmd crc7 6 - tx cmd end bit 7 - rx resp start bit 8 - rx resp irq response 9 - rx resp tx bit 10 - rx resp cmd idx 11 - rx resp data 12 - rx resp crc7 13 - rx resp end bit 14 - cmd path wait ncc 15 - wait; cmd-to-response turnaround note: the command fsm state is represented using 19 bits. the status register(7:4) has 4 bits to represent the command fsm states. using these 4 bits, only 16 states can be represented. thus three states cannot be represented in the status(7:4) register. the three states that are not represented in the status register(7:4) are: - bit 16 - wait for ccs - bit 17 - send ccsd - bit 18 - boot mode due to this, while command fsm is in wait for ccs state or send ccsd or boot mode?, the status register indicates status as 0 for the bit field 7:4. 0 8 data_3_status raw selected card_data[ 3]; checks whether card is present 0 - card not present 1 - card present 9 data_busy inverted version of raw selected card_data[0] 0 - card data not busy 1 - card data busy 10 data_state_mc_ busy data transmit or receiv e state-machine is busy 1 16:11 response_index index of previous response, including any auto-stop sent by core. 0 29:17 fifo_count fifo count - number of filled locations in fifo 0 30 dma_ack dma acknowledge signal state; either dw_dma_ack or ge_dma_ack, depending on dw-dma or generic-dma selection. 0 31 dma_req dma request signal state; either dw_dma_req or ge_dma_req, depending on dw-dma or generic-dma selection. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 313 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.20 fifo threshold watermark register (fifoth) table 244. fifo threshold watermark register (fifoth, address 0x4000 404c) bit description bit symbol value description reset value 11:0 tx_wmark fifo threshold watermark level when transmitting data to card. when fifo data count is less than or equal to this number, dma/fifo request is raised. if interrupt is enabled, then interrupt occurs. during end of packet, request or interrupt is generated, regardless of threshold programming. in non-dma mode, when transmit fifo threshold (txdr) interrupt is enabled, then interrupt is generated instead of dma request. during end of packet, on last interrupt, host is responsible for filling fifo with only required remaining bytes (not before fifo is full or after ciu completes data transfers, because fifo may not be empty). in dma mode, at end of packet, if last transfer is less than burst size, dma controller does single cycles until required bytes are transferred. 12 bits - 1 bit less than fifo-count of status register, which is 13 bits. limitation: tx_wmark >= 1; recommended: fifo_depth/2; (means less than or equal to fifo_depth/2). 15:12 - reserved. 27:16 rx_wmark fifo threshold watermark level when receiving data to card. when fifo data count reaches greater than this number, dma/fifo request is raised. during end of packet, request is generated regardless of threshold programming in order to complete any remaining data. in non-dma mode, when receiver fifo threshold (rxdr) interrupt is enabled, then interrupt is generated instead of dma request. during end of packet, interrupt is not generated if threshold programming is larger than any remaining data. it is responsibility of host to read remaining bytes on seeing data transfer done interrupt. in dma mode, at end of packet, even if remaining bytes are less than threshold, dma request does single transfers to flush out any remaining bytes before data transfer done interrupt is set. 12 bits - 1 bit less than fifo-count of status register, which is 13 bits. limitation: rx_wmark less than fifo_depth-2 recommended: (fifo_depth/2) - 1; (means greater than (fifo_depth/2) - 1) note: in dma mode during ccs time-out, the dma does not generate the request at the end of packet, even if remaining bytes are less than threshold. in this case, there will be some data left in the fifo. it is the responsibility of the application to reset the fifo after the ccs time-out. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 314 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 30:28 dw_dma_mutip le_ transaction_ size burst size of multiple transaction; should be programmed same as dw-dma controller multiple-transaction-size src/dest_msize.the units for transfers is the h_data_width parameter. a single transfer (dw_dma_single assertion in case of non dw dma interface) would be signalled based on this value. value should be sub-multiple of (rx_wmark + 1)* (f_data_width/h_data_width) and (fifo_depth - tx_wmark)* (f _data_width/ h_data_width) for example, if fifo_depth = 16, fdata_width == h_data_width allowed combinations for msize and tx_wmark are: msize = 1, tx_wmark = 1-15 msize = 4, tx_wmark = 8 msize = 4, tx_wmark = 4 msize = 4, tx_wmark = 12 msize = 8, tx_wmark = 8 msize = 8, tx_wmark = 4. allowed combinations for msize and rx_wmark are: msize = 1, rx_wmark = 0-14 msize = 4, rx_wmark = 3 msize = 4, rx_wmark = 7 msize = 4, rx_wmark = 11 msize = 8, rx_wmark = 7 msize = 8, rx_wmark = 11 recommended: msize = 8, tx_wmark = 8, rx_wmark = 7 0 0x0 1 transfer 0x1 4 transfers 0x2 8 transfers 0x3 16 transfers 0x4 32 transfers 0x5 64 transfers 0x6 128 transfers 0x7 256 transfers 31 - reserved table 244. fifo threshold watermark register (fifoth, address 0x4000 404c) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 315 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.21 card detect register (cdetect) 18.6.22 write protect register (wrtprt) 18.6.23 general purpose i nput/output register (gpio) 18.6.24 transferred ciu card byte count register (tcbcnt) table 245. card detect register (cdetect, address 0x4000 4050) bit description bit symbol description reset value 29:0 card_detect_n value on card_detect_n input ports (1 bit per card); read-only bits. 0 represents presence of card. only num_cards number of bits are implemented. 31:30 - reserved table 246. write protect register (wrtpr t, address 0x4000 4054) bit description bit symbol description reset value 29:0 write_protect value on card_write_prt input ports (1 bit per card). 1 represents write protec tion. only num_cards number of bits are implemented. 31:30 - reserved table 247. general purpose input/output register (gpio, address 0x4000 4058) bit description bit symbol description reset value 7:0 gpi value on gpi input ports; this porti on of register is read-only. valid only when area_optimized parameter is 0. 23:8 gpo value needed to be driven to gpo pins; this portion of register is read/write. valid only when area_optimized parameter is 0. 0 31:24 - reserved table 248. transferred ciu card byte count register (tcbcnt, address 0x4000 405c) bit description bit symbol description reset value 31:0 trans_card_byte _count number of bytes transferred by ciu unit to card. in 32-bit or 64-bit amba data-bus-width modes, register should be accessed in full to avoid read-coherency problems. in 16-bit amba data-bus-width mode, internal 16-bit coherency register is implemented. user should first read lower 16 bits and then higher 16 bits. when reading lower 16 bits, higher 16 bits of counter are stored in temporary register. when higher 16 bits are read, data from temporary register is supplied. both tcbcnt and tbbcnt share same coherency register. when area_optimized parameter is 1, register should be read only after data transfer completes; during data transfer, register returns 0. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 316 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.25 transferred host to biu-fi fo byte count register (tbbcnt) 18.6.26 debounce count register (debnce) 18.6.27 user id register (usrid) 18.6.28 version id register (verid) table 249. transferred host to biu-fifo byte coun t register (tbbcnt, address 0x4000 4060) bit description bit symbol description reset value 31:0 trans_fifo_byte_ count number of bytes transferred between host/dma memory and biu fifo. in 32-bit or 64-bit amba data-bus-width modes, register should be accessed in full to avoid read-coherency problems. in 16-bit amba data-bus-width mode, internal 16-bit coherency register is implemented. user should first read lower 16 bits and then higher 16 bits. when reading lower 16 bits, higher 16 bits of counter are stored in temporary register. when higher 16 bits are read, data from temporary register is supplied. both tcbcnt and tbbcnt share same coherency register. 0 table 250. debounce count register (de bnce, address 0x4000 4064) bit description bit symbol description reset value 23:0 debounce_co unt number of host clocks (clk) used by debounce filter logic; typical debounce time is 5-25 ms. 0xffffff 31:24 - reserved table 251. user id register (usrid, address 0x4000 4068) bit description bit symbol description reset value 31:0 usrid user identification register; value set by user. default reset value can be picked by user while configuring core before synthesis. can also be used as scratch pad register by user. na table 252. version id register (verid, address 0x4000 406c) bit description bit symbol description reset value 31:0 verid version identification register; register value is hard-wired. can be read by firmware to support different versions of core. 0x5342230a www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 317 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.29 uhs-1 register (uhs_reg) 18.6.30 hardware reset (rst_n) 18.6.31 bus mode register (bmod) table 253. uhs-1 register (uhs_reg, address 0x4000 4074) bit description bit symbol description reset value 15:0 volt_reg high voltage mode. determines the voltage fed to the buffers by an external voltage regulator. 0 - buffers supplied with 3.3v vdd 1 - buffers supplied with 1.8v vdd these bits function as the output of the host controller and are fed to an external voltage regulator. the voltage regulator must switch the voltage of the buffers of a particular card to either 3.3v or 1.8v, depending on the value programmed in the register. volt_reg[0] should be set to 1 for card number 0 in order to make it operate for 1.8v. 0 31:16 ddr_reg ddr mode. determines the voltage fed to the buffers by an external voltage regulator. 0 - non-ddr mode 1 - ddr mode uhs_reg [16] should be set for card number 0, uhs_reg [17] for card number 1 and so on. 0 table 254. hardware reset (rst_n, address 0x4000 4078) bit description bit symbol description reset value 15:0 card_reset hardware reset. 1 - active mode 0 - reset these bits cause the cards to enter pre-idle state, which requires them to be re -initialized. card_reset[0] should be set to 1 to reset card number 0, and card_reset[15] should be set to reset card number 15. the number of bits implemented is restricted to num_cards. 1 31:16 - reserved table 255. bus mode register (bmod, address 0x4000 4080) bit description bit symbol value description reset value 0 swr software reset. when set, the dma contro ller resets all its inte rnal registers. swr is read/write. it is automati cally cleared after 1 clock cycle. 0 1 fb fixed burst. controls whether the ahb master interface performs fixed burst transfers or not. when set, the ah b will use only single, incr4, incr8 or incr16 during start of normal burst tr ansfers. when reset, the ahb will use single and incr burst transfer operations. fb is read/write. 0 6:2 dsl descriptor skip length. specifies the number of hword/word/dword (depending on 16/32/64-bit bus) to skip between two unchained descriptors. this is applicable only for dual buffer structure. dsl is read/write. 0 7 de idmac enable. when set, the idmac is enabled. de is read/write. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 318 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.32 poll demand register (pldmnd) 18.6.33 descriptor list ba se address regist er (dbaddr) 10:8 pbl programmable burst length. these bits indicate the maximum number of beats to be performed in one idmac transaction. the idmac will always attempt to burst as specified in pbl each time it starts a burst transfer on the host bus. the permissible values are 1, 4, 8, 16, 32, 64, 128 and 256. this value is the mirror of msize of fifoth register. in order to change this value, write the required value to fifoth register. this is an encode value as follows.transfer unit is either 16, 32, or 64 bits, based on hdata_width. pbl is a read-only value. 0 0x0 1 transfer 0x1 4 transfers 0x2 8 transfers 0x3 16 transfers 0x4 32 transfers 0x5 64 transfers 0x6 128 transfers 0x7 256 transfers 31:11 - reserved table 255. bus mode register (bmod, address 0x4000 4080) bit description bit symbol value description reset value table 256. poll demand register (pldmnd, address 0x4000 4084) bit description bit symbol description reset value 31:0 pd poll demand. if the own bit of a descriptor is not set, the fsm goes to the suspend state. the host needs to write any value into this register for the idmac fsm to resume normal descriptor fetch operation. this is a write only register. pd bit is write-only. table 257. descriptor list base address re gister (dbaddr, address 0x4000 4088) bit description bit symbol description reset value 31:0 sdl start of descriptor list. contains the base address of the first descriptor. the lsb bits [0/1/2:0] for 16/32/64-bit bus-width) are ignored and taken as all-zero by the idmac internally. hence these lsb bits are read-only. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 319 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.34 internal dmac st atus register (idsts) table 258. internal dmac status register (i dsts, address 0x4000 408c) bit description bit symbol description reset value 0 ti transmit interrupt. indicates that data transmission is finished for a descriptor. writing a 1 clears this bit. 0 1 ri receive interrupt. indicates the completion of data reception for a descriptor. writing a 1 clears this bit. 0 2 fbe fatal bus error interrupt. i ndicates that a bus error occurred (idsts[12:10]). when this bit is set, the dma disables all its bus accesses. writing a 1 clears this bit. 0 3- reserved 4 du descriptor unavailable interrupt. this bit is set when the descriptor is unavailable due to own bit = 0 (des0[31] =0). writing a 1 clears this bit. 0 5 ces card error summary. indicates the status of the transaction to/from the card; also present in rintsts. indicates the logical or of the following bits: ebe - end bit error rto - response time-out/boot ack time-out rcrc - response crc sbe - start bit error drto - data read time-out/bds time-out dcrc - data crc for receive re - response error writing a 1 clears this bit. 0 7:6 - reserved 8 nis normal interrupt summary. logical or of the following: idsts[0] - transmit interrupt idsts[1] - receive interrupt only unmasked bits affect this bit. this is a sticky bit and must be cleared each time a corresponding bit that causes nis to be set is cleared. writing a 1 clears this bit. 0 9 ais abnormal interrupt summary. logical or of the following: idsts[2] - fatal bus interrupt idsts[4] - du bit interrupt idsts[5] - card error summary interrupt only unmasked bits affect this bit. this is a sticky bit and must be cleared each time a corresponding bit that causes ais to be set is cleared. writing a 1 clears this bit. 0 12:10 eb error bits. indicates the type of error that caused a bus error. valid only with fatal bus error bit (idsts[2]) set. this field does not generate an interrupt. 001 - host abort received during transmission 010 - host abort received during reception others: reserved eb is read-only. 0 16:13 fsm dmac fsm present state. 0 - dma_idle 1 - dma_suspend 2 - desc_rd 3 - desc_chk 4 - dma_rd_req_wait 5 - dma_wr_req_wait 6 - dma_rd 7 - dma_wr 8 - desc_close this bit is read-only. 0 31:16 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 320 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.35 internal dmac interrup t enable register (idinten) 18.6.36 current host descript or address regi ster (dscaddr) table 259. internal dmac interrupt enable register (idinten, address 0x4000 4090) bit description bit symbol description reset value 0 ti transmit interrupt enable. when set with normal interrupt summary enable, transmit interrupt is enabled. when reset, transmit interrupt is disabled. 0 1 ri receive interrupt enable. when set with normal interrupt summary enable, receive interrupt is enabled. when reset, receive interrupt is disabled. 0 2 fbe fatal bus error enable. when set with abnormal interrupt summary enable, the fatal bus error interrupt is enabled. when reset, fatal bus error enable interrupt is disabled. 0 3- reserved 4 du descriptor unavailable interrupt. when set along with abnormal interrupt summary enable, the du interrupt is enabled. 0 5 ces card error summary interrupt enable. when set, it enables the card interrupt summary. 0 7:6 - reserved 8 nis normal interrupt summary enable. when set, a normal interrupt is enabled. when reset, a normal interrupt is disabled. this bit enables the following bits: idinten[0] - transmit interrupt idinten[1] - receive interrupt 0 9 ais abnormal interrupt summary enable. when set, an abnormal interrupt is enabled. this bit enables the following bits: idinten[2] - fatal bus error interrupt idinten[4] - du interrupt idinten[5] - card error summary interrupt 0 31:10 - reserved table 260. current host descriptor address register (dscaddr, address 0x4000 4094) bit description bit symbol description reset value 31:0 hda host descriptor address pointer. cleared on reset. pointer updated by idmac during operation. this register points to the start address of the current descriptor read by the idmac. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 321 of 1164 nxp semiconductors UM10430 chapter 18: lpc18xx sd/mmc interface 18.6.37 current buffer descrip tor address register (bufaddr) table 261. current buffer descriptor addre ss register (bufaddr, address 0x4000 4098) bit description bit symbol description reset value 31:0 hba host buffer address pointer. cleared on reset. pointer updated by idmac during operation. this register points to the current data buffer address being accessed by the idmac. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 322 of 1164 19.1 how to read this chapter the emc is available on all lpc18xx parts. the reset value of the emcstaticwaitrd0 r egister varies with the part revision: ? lpc1850/30/20/10 rev ?a?: reset value of the emcstaticwaitrd0 register is 0x0000 000e. ? lpc1850/30/20/10 rev ?-?: reset value of the emcstaticwait rd0 register is 0x0000 0007. for lpc1850/30/20/10 rev ?a? only: the emc su pports a cclk clock which is half of the frequency of the base_m3_c lk. the emc divided cloc k must be configured for half-frequency clock operation in both the creg6 register ( ta b l e 3 7 ) and the ccu1 clk_emcdiv_cfg register ( table 84 ). 19.2 basic configuration the external memory controlle r is configured as follows: ? see ta b l e 2 6 2 for clocking and power control. ? if the emc cclk is using the divided clock, the clk_m3_emc_div branch clock must be configured for half-frequency cloc k operation in both the creg6 register ( ta b l e 3 7 ) and the ccu1 clk_emcdiv_cfg register ( ta b l e 8 4 ). ? the emc is reset by the emc_rst (reset # 21). ? delay value for address, data, and command lines can be programmed through registers in the scu block. (see section 19.4.4 to section 19.4.12 .) 19.3 features ? dynamic chip selects each supp ort up to 256 mb of data. ? dynamic memory interface support in cluding single data rate sdram. ? asynchronous static memory device supp ort including ram, rom, and nor flash, with or without asynchronous page mode. ? low transaction latency. UM10430 chapter 19: lpc18xx external memory controller (emc) rev. 00.13 ? 20 july 2011 user manual table 262. emc clocking and power control base clock branch clock maximum frequency notes emc registers base_m3_clk clk_m3_emc 120 mhz - emc cclk base_m3_clk clk_m3_emc_div 120 mhz this is the cclk clock for the emc timing. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 323 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) ? read and write buffers to reduce latency and to improve performance. ? 8-bit, 16-bit, and 32-bit wide static memory support. ? 16-bit and 32-bit wide chip select sdram memory support. ? static memory features include: ? asynchronous page mode read ? programmable wait states ? bus turnaround delay ? output enable and write enable delays ? extended wait ? four chip selects for synchro nous memory and four chip selects for static memory devices. ? power-saving modes dynamically cont rol emc_cke and emc_clk to sdrams. ? dynamic memory self-refresh mode controlled by software. ? controller supports 2 kbit, 4 kbit, and 8 kbit row address synchronous memory parts. that is typical 512 mb, 256 mb, and 128 mb parts, with 4, 8, 16, or 32 data bits per device. ? separate reset domains allow the for auto-r efresh through a chip reset if desired. ? programmable delay elements allow fine-tuning emc timing. remark: synchronous static memory device s (synchronous burst mode) are not supported. 19.4 general description the lpc18xx external memory controller (emc) is an arm primecell multiport memory controller peripheral offering support for as ynchronous static memory devices such as ram, rom and flash, as well as dynamic memo ries such as single data rate sdram. the emc is an advanced microcontroller bus ar chitecture (amba) compliant peripheral. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 324 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.5 memory bank select eight independently-configurable memory chip selects are supported: ? pins emc_cs3 to emc_cs0 are used to select static memory devices. ? pins emc_dycs3 to emc_dycs0 are used to select dynamic memory devices. static memory chip select ranges are each 16 megabytes in size, while dynamic memory chip selects cover a range of 256 megabytes each. table 263 shows the address ranges of the chip selects. fig 29. emc block diagram extbus_a[23:0] extbus_d[31:0] extbus_we extbus_oe extbus_bls[3:0] extbus_cs[3:0] extbus_dycs[3:0] extbus_cas extbus_ras extbus_clk[3:0] extbus_ckeout[3:0] extbus_dqmout[3:0] static memory signals dynamic memory signals shared signals memory controller s tat e machine data buffers ahb slave register interface ahb slave memory interface emc ahb b us pa d in t erf ac e table 263. memory bank selection chip select pin address range memory type size of range emc_cs0 0x1c00 0000 - 0x1cff ffff static 16 mb emc_ cs1 0x1d00 0000 - 01dff ffff static 16 mb emc_ cs2 0x1e00 0000 - 0x1eff ffff static 16 mb emc_ cs3 0x1f00 0000 - 0x1fff ffff static 16 mb emc_ dycs0 0x2800 0000 - 0x2fff ffff dynamic 128 mb emc_ dycs1 0x3000 0000 - 0x3fff ffff dynamic 256 mb emc_ dycs2 0x6000 0000 - 0x6fff ffff dynamic 256 mb emc_ dycs3 0x7000 0000 - 0x7fff ffff dynamic 256 mb www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 325 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.6 pin description 19.7 register description this chapter describes the emc register s and provides details required when programming the microcontroller. the emc registers are shown in table 265 . reset value reflects the data stored in used bi ts only. it does not include the content of reserved bits. table 264. emc pin description function pinned out direction description emc_a[22:0] o address bus emc_d[31:0] i/o data bus emc_bls[3:0] o byte lane select emc_cs[3:0] o static ram memory bank select emc_oe o output enable emc_we o write enable emc_ckeout[3:0] o sdram clock enable signals emc_clk[3:0] o sdram clock signals emc_dqmout[3:0] o data mask output to sdram memory banks emc_dycs[3:0] o sdram memory bank select emc_cas o column address strobe emc_ras o row address strobe table 265. register overview: external memory controller (base address 0x4000 5000) name access address offset description reset value control r/w 0x000 controls operation of the memory controller. 0x0000 0003 [1] status ro 0x004 provides emc status information. 0x0000 0005 config r/w 0x008 configures operation of the memory controller. 0x0 - - 0x00c - 0x01c reserved. - dynamiccontrol r/w 0x020 controls dynam ic memory operation. 0x0000 0006 dynamicrefresh r/w 0x024 configures dynamic memory refresh operation. 0x0 dynamicreadconfig r/w 0x028 configures the dynamic memory read strategy. 0x0 - - 0x02c reserved. - dynamicrp r/w 0x030 selects the precharge command period. 0x0000 000f dynamicras r/w 0x034 selects the active to precharge command period. 0x0000 000f dynamicsrex r/w 0x038 selects the self-refresh exit time. 0x0000 000f dynamicapr r/w 0x03c selects the last-data-out to active command time. 0x0000 000f dynamicdal r/w 0x040 selects the data-in to active command time. 0x0000 000f dynamicwr r/w 0x044 selects the write recovery time. 0x0000 000f dynamicrc r/w 0x048 selects the active to active command period. 0x0000 001f dynamicrfc r/w 0x04c selects the auto-refresh period. 0x0000 001f www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 326 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) dynamicxsr r/w 0x050 selects the exit self-refresh to active command time. 0x0000 001f dynamicrrd r/w 0x054 selects the active bank a to active bank b latency. 0x0000 000f dynamicmrd r/w 0x058 selects the load mode regi ster to active command time. 0x0000 000f - r/w 0x05c - 0x07c reserved. - staticextendedwait r/w 0x080 selects time for long static memory read and write transfers. 0x0 - r/w - reserved. - dynamicconfig0 r/w 0x100 selects the configur ation information for dynamic memory chip select 0. 0x0 dynamicrascas0 r/w 0x104 selects the ras and cas latencies for dynamic memory chip select 0. 0x0000 0303 - 0x108 - 0x11c reserved. - dynamicconfig1 r/w 0x120 selects the configur ation information for dynamic memory chip select 1. 0x0 dynamicrascas1 r/w 0x124 selects the ras and cas latencies for dynamic memory chip select 1. 0x0000 0303 - - 0x128 - 0x13c reserved. - dynamicconfig2 r/w 0x140 selects the configur ation information for dynamic memory chip select 2. 0x0 dynamicrascas2 r/w 0x144 selects the ras and cas latencies for dynamic memory chip select 2. 0x0000 0303 - - 0x148 - 0x15c reserved. - dynamicconfig3 r/w 0x160 selects the configur ation information for dynamic memory chip select 3. 0x0 dynamicrascas3 r/w 0x164 selects the ras and cas latencies for dynamic memory chip select 3. 0x0000 0303 - - 0x168 - 0x1fc reserved. - staticconfig0 r/w 0x200 selects the memory configuration for static chip select 0. 0x0 staticwaitwen0 r/w 0x204 selects the delay from chip select 0 to write enable. 0x0 staticwaitoen0 r/w 0x208 selects the delay from chip select 0 or address change, whichever is later, to output enable. 0x0 staticwaitrd0 r/w 0x20c selects the delay from chip select 0 to a read access. 0x0000 0007 staticwaitpage0 r/w 0x210 selects the delay for asynchronous page mode sequential accesses for chip select 0. 0x0000 001f staticwaitwr0 r/w 0x214 selects the delay from chip select 0 to a write access. 0x0000 001f staticwaitturn0 r/w 0x218 selects the number of bus turnaround cycles for chip select 0. 0x0000 000f staticconfig1 r/w 0x220 selects the memory configuration for static chip select 1. 0x0 staticwaitwen1 r/w 0x224 selects the delay from chip select 1 to write enable. 0x0 table 265. register overview: external memory controller (base address 0x4000 5000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 327 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) [1] the reset value after warm reset for the control register is 0x0000 0001. 19.7.1 emc control register the control register is a read/write regist er that controls operation of the memory controller. the control bits can be altered during normal operation. staticwaitoen1 r/w 0x228 selects the delay from chip select 1 or address change, whichever is later, to output enable. 0x0 staticwaitrd1 r/w 0x22c selects the delay from chip select 1 to a read access. 0x0000 001f staticwaitpage1 r/w 0x230 selects the delay for asynchronous page mode sequential accesses for chip select 1. 0x0000 001f staticwaitwr1 r/w 0x234 selects the delay from chip select 1 to a write access. 0x0000 001f staticwaitturn1 r/w 0x238 selects the number of bus turnaround cycles for chip select 1. 0x0000 000f - - 0x23c reserved. - staticconfig2 r/w 0x240 selects the memory configuration for static chip select 2. 0x0 staticwaitwen2 r/w 0x244 selects the delay from chip select 2 to write enable. 0x0 staticwaitoen2 r/w 0x248 selects the delay from chip select 2 or address change, whichever is later, to output enable. 0x0 staticwaitrd2 r/w 0x24c selects the delay from chip select 2 to a read access. 0x0000 001f staticwaitpage2 r/w 0x250 selects the delay for asynchronous page mode sequential accesses for chip select 2. 0x0000 001f staticwaitwr2 r/w 0x254 selects the delay from chip select 2 to a write access. 0x0000 001f staticwaitturn2 r/w 0x258 selects the number of bus turnaround cycles for chip select 2. 0x0000 000f - - 0x25c reserved. - staticconfig3 r/w 0x260 selects the memory configuration for static chip select 3. 0x0 staticwaitwen3 r/w 0x264 selects the delay from chip select 3 to write enable. 0x0 staticwaitoen3 r/w 0x268 selects the delay from chip select 3 or address change, whichever is later, to output enable. 0x0 staticwaitrd3 r/w 0x26c selects the delay from chip select 3 to a read access. 0x0000 001f staticwaitpage3 r/w 0x270 selects the delay for asynchronous page mode sequential accesses for chip select 3. 0x0000 001f staticwaitwr3 r/w 0x274 selects the delay from chip select 3 to a write access. 0x0000 001f staticwaitturn3 r/w 0x278 selects the number of bus turnaround cycles for chip select 3. 0x0000 000f table 265. register overview: external memory controller (base address 0x4000 5000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 328 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) [1] the external memory cannot be accessed in low-power or disabled state. if a memo ry access is performed an ahb error response is generated. the emc register s can be programmed in low-power and/or disabled state. 19.7.2 emc status register the read-only status register pr ovides emc status information. table 266. emc control register (control - address 0x4000 5000) bit description bit symbol value description reset value 0 e emc enable. indicates if the emc is enabled or disabled.disabling the emc reduces power consumption. when the memory controller is disabled the memory is not refreshed. the memory controller is enabled by setting the enable bit, or by reset. this bit must only be modified when the emc is in idle state. [1] 1 0 disabled 1 enabled (por and warm reset value). 1 m address mirror. indicates normal or reset memory map. on por, cs1 is mirrored to both cs0 and dycs0 memory areas. clearing the m bit enables cs0 and dycs0 memory to be accessed. 1 0 normal memory map. 1 reset memory map. static memory cs1 is mirrored onto cs0 and dycs0 (por reset value). 2 l low-power mode. indicates normal, or low-power mode. entering low-power mode reduces memory controller power consumption. dynamic memory is refreshed as necessary. the memory controller returns to normal functional mode by clearing the low-power mode bit (l), or by por. this bit must only be modified when the emc is in idle state. [1] 0 0 normal mode (warm reset value). 1 low-power mode. 31:3 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 267. emc status register (status - address 0x4000 5008) bit description bit symbol value description reset value 0 b busy. this bit is used to ensure that the memory controller enters the low-power or disabled mode cleanly by determining if the memory controller is busy or not: 1 0 emc is idle (warm reset value). 1 emc is busy performing memory transactions, commands, auto-refresh cycles, or is in self-refresh mode (por reset value). 1 s write buffer status. this bit enables the emc to enter low-power mode or disabled mode cleanly: 0 0 write buffers empty (por reset value) 1 write buffers contain data. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 329 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.7.3 emc configuration register the config register configures the operation of the memory controller. it is recommended that this register is modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. this register is accessed with one wait state. 19.7.4 dynamic memory control register the dynamiccontrol register controls dynamic memory operation. the control bits can be altered during normal operation. 2 sa self-refresh acknowledge. this bit indicates the operating mode of the emc: 1 0 normal mode 1 self-refresh mode (por reset value). 31:3 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 267. emc status register (status - address 0x4000 5008) bit description bit symbol value description reset value table 268. emc configuration register (con fig - address 0x4000 5008) bit description bit symbol value description reset value 0 em endian mode. 0 0 little-endian mode (por reset value). 1 big-endian mode. on power-on reset, the value of the endian bit is 0. all data must be flushed in the emc before switching between little-endian and big-endian modes. 7:1 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 8 cr clock ratio. cclk: clkout[1:0] ratio: 0 0 1:1 (por reset value) 11:2 this bit must contain 0 for proper operation of the emc. 31:9 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 269. dynamic control register (d ynamiccontrol - address 0x4000 5020) bit description bit symbol value description reset value 0 ce dynamic memory clock enable. 0 0 clock enable of idle devices are deasserted to save power (por reset value). 1 all clock enables are driven high continuously. [1] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 330 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) [1] clock enable must be high during sdram initialization. [2] the memory controller exits from power-on reset with the self-refresh bit high. to enter normal functional mode set this bit low. [3] disabling clkout can be performed if there are no sdram memory transactions. when enabled this bit can be used in conjunction with the dynam ic memory clock control (cs) field. remark: deep-sleep mode can be entered by setting the deep-sleep mode (dp) bit, the dynamic memory clock enable bit (ce), and the dynamic clock control bit (cs) to one. the device is then put into a low-power mode where the device is powered down and no longer refreshed. all data in the memory is lost. 1 cs dynamic memory clock control. when clock control is low the output clock clkout is stopped when there are no sdram transactions. the clock is also stopped during self-refresh mode. 1 0 clkout stops when all sdrams are idle and during self-refresh mode. 1 clkout runs continuously (por reset value). 2 sr self-refresh request, emcsrefreq. by writing 1 to this bit self-refresh can be entered under software control. writing 0 to this bit returns the emc to normal mode. the self-refresh acknowledge bit in the status register must be polled to discover the current operating mode of the emc. [2] 1 0 normal mode. 1 enter self-refresh mode (por reset value). 4:3 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 5 mmc memory clock control. 0 0 clkout enabled (por reset value). 1 clkout disabled. [3] 6 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 8:7 i sdram initialization. 00 0x0 issue sdram normal operation command (por reset value). 0x1 issue sdram mode command. 0x2 issue sdram pall (precharge all) command. 0x3 issue sdram nop (no operation) command) 12:9 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 13 dp low-power sdram deep-sleep mode. 0 0 normal operation (por reset value). 1 enter deep-sleep mode. 31:14 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 269. dynamic control register (d ynamiccontrol - address 0x4000 5020) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 331 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.7.5 dynamic memory refresh timer register the dynamicrefresh register configures dy namic memory operation. it is recommended that this register is modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. however, these control bits can, if necessary, be altered during normal operation. this regi ster is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. for example, for the refresh period of 16 s, and a cclk frequency of 50 mhz, the following value must be prog rammed into this register: (16 x 10 -6 x 50 x 10 6 ) / 16 = 50 or 0x32 if auto-refresh through warm reset is requested (by setting the emc_reset_disable bit), the timing of auto-refresh must be adjusted to allow a sufficient refresh rate when the clock rate is reduced during the wake-up peri od of a reset cycle. during this period, the emc (and all other portions of the chip that are being clocke d) run from the irc oscillator at 12 mhz. the irc oscillator frequency must be used as the cclk rate for refresh calculations if auto-refresh through warm reset is requested. note: the refresh cycles are evenly distributed. however, there might be slight variations when the auto-refresh command is issued depending on the status of the memory controller. 19.7.6 dynamic memory read configuration register the dynamicreadconfig register configures the dynamic memory read strategy. this register must only be modified during system initialization. this register is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. important: it should be highlighted that the defa ult clock delay methodology requires the output clock to be delayed externally to the chip to avoid hold time issue for the sdram. in most application boards, th ere will be no such external dela y circuit and the application should write correct value to the dynamicre adconfig register to use command delay strategy. the clock delay strategy is the default setting on reset! table 270. dynamic memory refresh timer register (dynamicrefresh - address 0x4000 5024) bit description bit symbol description reset value 10:0 refresh refresh timer. indicates the mult iple of 16 cclks between sdram refresh cycles. 0x0 = refresh disabled (por reset value). 0x1 - 0x7ff = n x16 = 16n cclks between sdram refresh cycles. for example: 0x1 = 1 x 16 = 16 cclks between sdram refresh cycles. 0x8 = 8 x 16 = 128 cclks between sdram refresh cycles 0 31:11 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 332 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) see section 19.4.4 to section 19.4.12 for programming delay value for address, data, and command lines. 19.7.7 dynamic memory prechar ge command period register the dynamictrp register enables you to program the precharge command period, trp. this register must only be modified during s ystem initialization. th is value is normally found in sdram data sheets as trp. this register is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. 19.7.8 dynamic memory active to pr echarge command pe riod register the dynamictras register enables you to program the active to precharge command period, tras. it is recommended that this regist er is modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and th en entering low-power, or disabled mode. this value is normally found in sdram data sheets as tras. this register is a ccessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. table 271. dynamic memory read configurat ion register (dynamicreadconfig - address 0x4000 5028) bit description bit symbol value description reset value 1:0 rd read data strategy. 0x0 0x0 clock out delayed strategy, using clkout (command not delayed, clock out delayed). por reset value. 0x1 command delayed strategy, using cclkdelay (command delayed, clock out not delayed). 0x2 command delayed strategy plus one clock cycle, using cclkdelay (command delayed, clock out not delayed). 0x3 command delayed strategy plus two clock cycles, using cclkdelay (command delayed, clock out not delayed). 31:2 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 272. dynamic memory precharge command period register (dynamicrp - address 0x4000 5030) bit description bit symbol description reset value 3:0 trp precharge command period. 0x0 - 0xe = n + 1 clock cycles. the delay is in cclk cycles. 0xf = 16 clock cycles (por reset value). 0xf 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 333 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.7.9 dynamic memory self refresh exit time register the dynamictsrex register enables you to prog ram the self-refresh ex it time, tsrex. it is recommended that this register is modified during system initialization, or when there are no current or outstanding transactions. th is can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. this value is normally found in sdram data sheets as tsrex, for devices without this parameter you use the same value as txsr. this register is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. 19.7.10 dynamic memory last data out to active time register the dynamictapr register enables you to program the last-data-out to active command time, tapr. it is recommended that this register is modified duri ng system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and th en entering low-power, or disabled mode. this value is normally found in sdram data sheets as tapr. this register is a ccessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. table 273. dynamic memory active to precha rge command period register (dynamicras - address 0x4000 5034) bit description bit symbol description reset value 3:0 tras active to precharge command period. 0x0 - 0xe = n + 1 clock cycles. the delay is in cclk cycles. 0xf = 16 clock cycles (por reset value). 0xf 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 274. dynamic memory self refresh exit time register (dynamicsrex - address 0x4000 5038) bit description bit symbol description reset value 3:0 tsrex self-refresh exit time. 0x0 - 0xe = n + 1 clock cycles. the delay is in cclk cycles. 0xf = 16 clock cycles (por reset value). 0xf 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 275. dynamic memory last data out to active time register (dynamicapr - address 0x4000 503c) bit description bit symbol description reset value 3:0 tapr last-data-out to active command time. 0x0 - 0xe = n + 1 clock cycles. the delay is in cclk cycles. 0xf = 16 clock cycles (por reset value). 0xf 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 334 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.7.11 dynamic memory data in to active command time register the dynamictdal register enables you to pr ogram the data-in to active command time, tdal. it is recommended that this register is mo dified during system initialization, or when there are no current or outstanding transactio ns. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode . this value is normally found in sdram data sheets as tdal , or tapw. this register is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. 19.7.12 dynamic memory writ e recovery time register the dynamictwr register enables you to prog ram the write recovery time, twr. it is recommended that this register is modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then enterin g low-power, or disabled mode. th is value is normally found in sdram data sheets as twr, tdpl, trwl, or trdl. this register is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. 19.7.13 dynamic memory active to active command period register the dynamictrc register enables you to program the active to active command period, trc. it is recommended that this register is modified during system initialization, or when there are no current or outstanding transactio ns. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode . this value is normally found in sdram data sheets as trc. this regi ster is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. table 276. dynamic memory data in to active command time register (dynamicdal - address 0x4000 5040) bit description bit symbol description reset value 3:0 tdal data-in to active command. 0x0 - 0xe = n clock cycles. the delay is in cclk cycles. 0xf = 15 clock cycles (por reset value). 0xf 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 277. dynamic memory write recovery time register (dynamicwr - address 0x4000 5044) bit description bit symbol description reset value 3:0 twr write recovery time. 0x0 - 0xe = n + 1 clock cycles. the delay is in cclk cycles. 0xf = 16 clock cycles (por reset value). 0xf 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 335 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.7.14 dynamic memory auto -refresh period register the dynamictrfc register enables you to program the auto-refresh period, and auto-refresh to active command period, trfc. it is recommend ed that this register is modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. this value is normally found in sdram data sheets as trfc, or sometimes as trc. this regi ster is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. 19.7.15 dynamic memory exit self refresh register the dynamictxsr register enables you to pr ogram the exit self-refresh to active command time, txsr. it is recommended that this register is modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. this value is normally found in sdram data sheets as txsr. this register is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. table 278. dynamic memory active to active command period re gister (dynamicrc - address 0x4000 5048) bit description bit symbol description reset value 4:0 trc active to active command period. 0x0 - 0x1e = n + 1 clock cycles. the delay is in cclk cycles. 0x1f = 32 clock cycles (por reset value). 0x1f 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 279. dynamic memory auto refresh period register (dynamicrfc - address 0x4000 504c) bit description bit symbol description reset value 4:0 trfc auto-refresh period and auto-refresh to active command period. 0x0 - 0x1e = n + 1 clock cycles. the delay is in cclk cycles. 0x1f = 32 clock cycles (por reset value). 0x1f 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 280. dynamic memory exit self refresh register (dynamicxsr - address 0x4000 5050) bit description bit symbol description reset value 4:0 txsr exit self-refresh to active command time. 0x0 - 0x1e = n + 1 clock cycles. the delay is in cclk cycles. 0x1f = 32 clock cycles (por reset value). 0x1f 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 336 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.7.16 dynamic memory active bank a to active bank b time register the dynamictrrd register enables you to program the active bank a to active bank b latency, trrd. it is recommended that this register is modifi ed during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and th en entering low-power, or disabled mode. this value is normally found in sdram data sheets as trrd. this register is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. 19.7.17 dynamic memory load mode register to active command time the dynamictmrd register enables you to program the load mode register to active command time, tmrd. it is reco mmended that this register is modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. this value is normally found in sdram data sheets as tmrd, or trsa. this register is accessed with one wait state. note: this register is used fo r all four dynamic memory chip selects. therefore the worst case value for all of the chip selects must be programmed. 19.7.18 static memory extended wait register extendedwait (ew) bit in the staticconfig register is set. it is recommended that this register is modified during system initia lization, or when there are no current or outstanding transactions. however, if necessary, these control bits can be altered during normal operation. this register is accessed with one wait state. table 281. dynamic memory active bank a to active bank b time register (dynamicrrd - address 0x4000 5054) bit description bit symbol description reset value 3:0 trrd active bank a to active bank b latency 0x0 - 0xe = n + 1 clock cycles. the delay is in cclk cycles. 0xf = 16 clock cycles (por reset value). 0xf 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 282. dynamic memory load mode register to active command time (dynamicmrd - address 0x4000 5058) bit description bit symbol description reset value 3:0 tmrd load mode register to active command time. 0x0 - 0xe = n + 1 clock cycles. the delay is in cclk cycles. 0xf = 16 clock cycles (por reset value). 0xf 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 337 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) for example, for a static memory read/write transfer time of 16 s, and a cclk frequency of 50 mhz, the following value must be programmed into this register: (16 x 10 -6 x 50 x 10 6 )/16-1=49 19.7.19 dynamic memory configuration registers the dynamicconfig registers enable you to pr ogram the configuration information for the relevant dynamic memory chip select. these registers are normally only modified during system initialization. thes e registers are accessed with one wait state. table 283. static memory extended wait register (staticextendedwait - address 0x4000 5080) bit description bit symbol description reset value 9:0 extendedwait extended wait time out. 16 clock cycles (por reset va lue). the delay is in cclk cycles. 0x0 = 16 clock cycles. 0x1 - 0x3ff = (n+1) x16 clock cycles. 0x0 31:10 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 284. dynamic memory configuration registers (dynamicconfig, address 0x4000 5100 (dynamicconfig0), 0x4000 5120 (dynamicconfig1), 0x4000 5140 (dynamicconfig2), 0x4 000 5160 (dynamicconfig3)) bit description bit symbol value description reset value 2:0 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 4:3 md memory device. 00 0x0 sdram (por reset value). 0x1 low-power sdram. 0x2 reserved. 0x3 reserved. 6:5 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 12:7 am0 address mapping. see table 285 . 000000 = reset value. [1] 0 13 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 14 am1 address mapping see table 285 . 0 = reset value. 0 18:15 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 19 b buffer enable. 0 buffer disabled for accesses to this chip select (por reset value). 1 buffer enabled for accesses to this chip select. after configuration of the dynamic memory, the buffer must be enabled for normal operation. [2] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 338 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) [1] the sdram column and row width and number of banks are computed automatically from the address mapping. [2] the buffers must be disabled duri ng sdram and syncflash initialization. they must also be disabled when performing syncflash commands. the buffers must be enabled during normal operation. address mappings that are not shown in table 285 are reserved. 20 p write protect. 0 0 writes not protected (por reset value). 1 writes protected. 31:21 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 285. address mapping 14 12 11:9 8:7 description 16 bit external bus high-performance address mapping (row, bank, column) 0 0 000 00 16 mb (2mx8), 2 banks, row length = 11, column length = 9 0 0 000 01 16 mb (1mx16), 2 banks, row length = 11, column length = 8 0 0 001 00 64 mb (8mx8), 4 banks, row length = 12, column length = 9 0 0 001 01 64 mb (4mx16), 4 banks, row length = 12, column length = 8 0 0 010 00 128 mb (16mx8), 4 banks, row length = 12, column length = 10 0 0 010 01 128 mb (8mx16), 4 banks, row length = 12, column length = 9 0 0 011 00 256 mb (32mx8), 4 banks, row length = 13, column length = 10 0 0 011 01 256 mb (16mx16), 4 banks, row length = 13, column length = 9 0 0 100 00 512 mb (64mx8), 4 banks, row length = 13, column length = 11 0 0 100 01 512 mb (32mx16), 4 banks, row length = 13, column length = 10 16 bit external bus low-power sdram address mapping (bank, row, column) 0 1 000 00 16 mb (2mx8), 2 banks, row length = 11, column length = 9 0 1 000 01 16 mb (1mx16), 2 banks, row length = 11, column length = 8 0 1 001 00 64 mb (8mx8), 4 banks, row length = 12, column length = 9 0 1 001 01 64 mb (4mx16), 4 banks, row length = 12, column length = 8 0 1 010 00 128 mb (16mx8), 4 banks, row length = 12, column length = 10 0 1 010 01 128 mb (8mx16), 4 banks, row length = 12, column length = 9 0 1 011 00 256 mb (32mx8), 4 banks, row length = 13, column length = 10 0 1 011 01 256 mb (16mx16), 4 banks, row length = 13, column length = 9 0 1 100 00 512 mb (64mx8), 4 banks, row length = 13, column length = 11 0 1 100 01 512 mb (32mx16), 4 banks, row length = 13, column length = 10 32 bit external bus high-performance address mapping (row, bank, column) 1 0 000 00 16 mb (2mx8), 2 banks, row length = 11, column length = 9 1 0 000 01 16 mb (1mx16), 2 banks, row length = 11, column length = 8 1 0 001 00 64 mb (8mx8), 4 banks, row length = 12, column length = 9 table 284. dynamic memory configuration registers (dynamicconfig, address 0x4000 5100 (dynamicconfig0), 0x4000 5120 (dynamicconfig1), 0x4000 5140 (dynamicconfig2), 0x4 000 5160 (dynamicconfig3)) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 339 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) a chip select can be connected to a single memo ry device, in this ca se the chip select data bus width is the same as the device wi dth. alternatively the chip select can be connected to a number of external devices. in this case the chip select data bus width is the sum of the memory device data bus widths. for example, for a chip select connected to: ? a 32-bit wide memory device, choose a 32-bit wide address mapping. ? a 16-bit wide memory device, choose a 16-bit wide address mapping. ? four x 8-bit wide memory devices, choose a 32-bit wide address mapping. ? two x 8-bit wide memory devices, ch oose a 16-bit wide address mapping. the sdram bank select pins ba1 and ba0 ar e connected to address lines a14 and a13, respectively. 1 0 001 01 64 mb (4mx16), 4 banks, row length = 12, column length = 8 1 0 001 10 64 mb (2mx32), 4 banks, row length = 11, column length = 8 1 0 010 00 128 mb (16mx8), 4 banks, row length = 12, column length = 10 1 0 010 01 128 mb (8mx16), 4 banks, row length = 12, column length = 9 1 0 010 10 128 mb (4mx32), 4 banks, row length = 12, column length = 8 1 0 011 00 256 mb (32mx8), 4 banks, row length = 13, column length = 10 1 0 011 01 256 mb (16mx16), 4 banks, row length = 13, column length = 9 1 0 011 10 256 mb (8mx32), 4 banks, row length = 13, column length = 8 1 0 100 00 512 mb (64mx8), 4 banks, row length = 13, column length = 11 1 0 100 01 512 mb (32mx16), 4 banks, row length = 13, column length = 10 32 bit external bus low-power sdram address mapping (bank, row, column) 1 1 000 00 16 mb (2mx8), 2 banks, row length = 11, column length = 9 1 1 000 01 16 mb (1mx16), 2 banks, row length = 11, column length = 8 1 1 001 00 64 mb (8mx8), 4 banks, row length = 12, column length = 9 1 1 001 01 64 mb (4mx16), 4 banks, row length = 12, column length = 8 1 1 001 10 64 mb (2mx32), 4 banks, row length = 11, column length = 8 1 1 010 00 128 mb (16mx8), 4 banks, row length = 12, column length = 10 1 1 010 01 128 mb (8mx16), 4 banks, row length = 12, column length = 9 1 1 010 10 128 mb (4mx32), 4 banks, row length = 12, column length = 8 1 1 011 00 256 mb (32mx8), 4 banks, row length = 13, column length = 10 1 1 011 01 256 mb (16mx16), 4 banks, row length = 13, column length = 9 1 1 011 10 256 mb (8mx32), 4 banks, row length = 13, column length = 8 1 1 100 00 512 mb (64mx8), 4 banks, row length = 13, column length = 11 1 1 100 01 512 mb (32mx16), 4 banks, row length = 13, column length = 10 table 285. address mapping 14 12 11:9 8:7 description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 340 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.7.20 dynamic memory ras & cas delay registers the dynamicrascas0:3 registers enable you to program the ras and cas latencies for the relevant dynamic memory. it is recommended that these registers are modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. these registers are accessed with one wait state. note: the values programmed into these regi sters must be consistent with the values used to initialize the sdram memory device. 19.7.21 static memory c onfiguration registers the staticconfig registers configure the stat ic memory configuration. it is recommended that these registers are modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. these registers are accessed with one wait state. table 286. dynamic memory rascas delay registers (dynamicrascas, address 0x4000 5104 (dynamicrascas0), 0x4000 5124 (dynamicrascas1), 0x4000 5144 (dynamicrascas2), 0x4 000 5164 (dynamicrascas3)) bit description bit symbol value description reset value 1:0 ras ras latency (active to read/write delay). 11 0x0 reserved. 0x1 one cclk cycle. 0x2 two cclk cycles. 0x3 three cclk cycles (por reset value). 7:2 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 9:8 cas cas latency. 11 0x0 reserved. 0x1 one cclk cycle. 0x2 two cclk cycles. 0x3 three cclk cycles (por reset value). 31:10 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 341 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) table 287. static memory configuration re gisters (staticconfig, address 0x4000 5200 (staticconfig0), 0x4000 5220 (staticconfig1), 0x4000 5240 (staticconfig2), 0x4000 5260 (sta ticconfig3)) bit description bit symbol value description reset value 1:0 mw memory width. 0 0x0 8 bit (por reset value). 0x1 16 bit. 0x2 32 bit. 0x3 reserved. 2 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 3 pm page mode. in page mode the emc can burst up to four external accesses. therefore devices with asynchronous page mode burst four or higher devices are supported. asynchronous page mode burst two devices are not supported and must be accessed normally. 0 0 disabled (por reset value). 1 async page mode enabled (page length four). 5:4 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 6 pc chip select polarity. the value of the chip select polarity on power-on reset is 0. 0 0 active low chip select. 1 active high chip select. 7 pb byte lane state. the byte lane state bit, pb, enables different types of memory to be connected. for byte-wide static memories the blsn[3:0] signal from the emc is usually connected to we (write enable). in this case for reads all the blsn[3:0] bits must be high. this means that the byte lane state (pb) bit must be low. 16 bit wide static memory devices usually have the blsn[3:0] signals connected to the ubn and lbn (upper byte and lower byte) signals in the static memory. in this case a write to a particular byte must assert the appropriate ubn or lbn signal low. for reads, all the ub and lb signals must be asserted low so that the bus is driven. in this case the byte lane state (pb) bit must be high. remark: when pb is set to 0, the we signal is undefined or 0. you must set pb to 1, to use the we signal. 0 0 for reads all the bits in blsn[3:0] are high. for writes the respective active bits in blsn[3:0] are low (por reset value). 1 for reads the respective active bits in blsn[3:0] are low. for writes the respective active bits in blsn[3:0] are low. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 342 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) [1] extended wait and page mode cannot be selected simultaneously. [2] emc may perform burst read access even when the buffer enable bit is cleared. 19.7.22 static memory writ e enable delay registers the staticwaitwen registers enable you to program the delay from the chip select to the write enable. it is recommended that thes e registers are modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. these registers are accessed with one wait state. 8 ew extended wait. extended wait (ew) uses the staticextendedwait register to time both the read and write transfers rather than the staticwaitrd and staticwaitwr registers. this enables much longer transactions. [1] 0 0 extended wait disabled (por reset value). 1 extended wait enabled. 18:9 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 19 b buffer enable [2] .0 0 buffer disabled (por reset value). 1 buffer enabled. 20 p write protect. 0 0 writes not protected (por reset value). 1 write protected. 31:21 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 287. static memory configuration re gisters (staticconfig, address 0x4000 5200 (staticconfig0), 0x4000 5220 (staticconfig1), 0x4000 5240 (staticconfig2), 0x4000 5260 (sta ticconfig3)) bit description bit symbol value description reset value table 288. static memory write enable de lay registers (staticwaitwen, address 0x4000 5204 (staticwaitwen0), 0x4000 5 224 (staticwaitwen1), 0x4000 5244 (staticwaitwen2), 0x4000 5264 (staticwaitwen3)) bit description bit symbol description reset value 3:0 waitwen wait write enable. delay from chip select assertion to write enable. 0x0 = one cclk cycle delay between assertion of chip select and write enable (por reset value). 0x1 - 0xf = (n + 1) cclk cycle delay. the delay is (waitwen +1) x tcclk. 0x0 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 343 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.7.23 static memory output enable delay registers the staticwaitoen registers enable you to program the delay from the chip select or address change, whicheve r is later, to the output enable. it is recommended that these registers are modified during system initializ ation, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. these registers are accessed with one wait state. 19.7.24 static memory read delay registers the staticwaitrd registers enable you to prog ram the delay from the chip select to the read access. it is recommended that thes e registers are modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. it is not used if the extended wait bit is enabl ed in the staticconfig registers. these registers are accessed with one wait state. [1] the reset value is 0x0b for the staticwaitrd0 register only. 19.7.25 static memory page mode read delay registers the staticwaitpage registers enable you to program the delay for asynchronous page mode sequential accesses. it is recommended that these registers are modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode. this register is accessed with one wait state. table 289. static memory output enable delay registers (staticwaitoen, address 0x4000 5208 (staticwaitoen0), 0x4000 5228 (staticwaitoen1), 0x4000 5248 (staticwaitoen2), 0x4000 5268 (staticwaitoen3)) bit description bit symbol description reset value 3:0 waitoen wait output enable. delay from chip select assertion to output enable. 0x0 = no delay (por reset value). 0x1 - 0xf = n cycle delay. the delay is waitoen x tcclk. 0x0 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 290. static memory read delay regi sters (staticwaitrd, address 0x4000 520c (staticwaitrd0), 0x4000 522c (staticwaitrd1), 0x4000 524c (staticwaitrd2), 0x4000 526c (s taticwaitrd3)) bit description bit symbol description reset value 4:0 waitrd non-page mode read wait states or asynchronous page mode read first access wait state. non-page mode read or asynchronous page mode read, first read only: 0x0 - 0x1e = (n + 1) cclk cycl es for read accesses. for non-sequential reads, the wait state time is (waitrd + 1) x tcclk. 0x1f = 32 cclk cycles for re ad accesses (por reset value). 0xb [1] 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 344 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.7.26 static memory write delay registers the staticwaitwr registers enable you to program the delay from the chip select to the write access. it is recommended that these registers are modified during system initialization, or when there are no current or outstanding transactions. this can be ensured by waiting until the emc is idle, and then entering low-power, or disabled mode.these registers are not used if the extended wait (ew) bit is enabled in the staticconfig register. these regist ers are accessed with one wait state. 19.7.27 static memory turn round delay registers the staticwaitturn registers enable you to pr ogram the number of bus turnaround cycles. it is recommended that these registers are modi fied during system in itialization, or when there are no current or outstanding transactio ns. this can be ensured by waiting until the emc is idle, and then enter ing low-power, or disabled mode. these registers are accessed with one wait state. table 291. static memory page mode read delay registers (staticwaitpage, address 0x4000 5210 (staticwaitpage0), 0x 4000 5230 (staticwaitpage1), 0x4000 5250 (staticwaitpage2), 0x 4000 5270 (staticwaitpage3)) bit description bit symbol description reset value 4:0 waitpage asynchronous page mode read after the first read wait states. number of wait states for asynchronous page mode read accesses after the first read: 0x0 - 0x1e = (n+ 1) cclk cycle read access time. for asynchronous page mode read for sequential reads, the wait state time for page mode accesses after the first read is (waitpage + 1) x tcclk. 0x1f = 32 cclk cycle read access time (por reset value). 0x1f 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 292. static memory write delay regi sters (staticwaitwr, address 0x4000 5214 (staticwaitwr0), 0x4000 5234 (staticwaitwr1), 0x4000 5254 (staticwaitwr2), 0x4000 5274 (staticwaitwr3)) bit description bit symbol description reset value 4:0 waitwr write wait states. sram wait state time for writ e accesses after the first read: 0x0 - 0x1e = (n + 2) cclk cycle writ e access time. the wait state time for write accesses after the first read is waitwr (n + 2) x tcclk. 0x1f = 33 cclk cycle write ac cess time (por reset value). 0x1f 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 345 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) to prevent bus contention on the external me mory data bus, the waitturn field controls the number of bus turnaround cycles added between static memory read and write accesses. the waitturn field also controls the number of turnaround cycles between static memory and dy namic memory accesses. table 293. static memory turn round de lay registers (staticwaitturn, address 0x4000 5218 (staticwaitturn0), 0x40 00 5238 (staticwaitturn1), 0x4000 5258 (staticwaitturn2), 0x40 00 5278 (staticwaitturn3)) bit description bit symbol description reset value 3:0 waitturn bus turnaround cycles. 0x0 - 0xe = (n + 1) cclk turnaround cycles. bus turnaround time is (waitturn + 1) x tcclk. 0xf = 16 cclk turnaround cycles (por reset value). 0xf 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 346 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.8 functional description figure 30 shows a block diagram of the emc. the functions of the emc blocks are described in the following sections: ? ahb slave register interface. ? ahb slave memory interfaces. ? data buffers. ? memory controller state machine. ? pad interface. note: for 32 bit wide chip selects data is tr ansferred to and from dynamic memory in sdram bursts of four. for 16 bit wide chip selects sdram bursts of eight are used. 19.8.1 ahb slave register interface the ahb slave register inte rface block enables the registers of the emc to be programmed. this module also contains most of the registers and performs the majority of the register address decoding. to eliminate the possibility of endianness prob lems, all data transf ers to and from the registers of the emc must be 32 bits wide. fig 30. emc block diagram extbus_a[23:0] extbus_d[31:0] extbus_we extbus_oe extbus_bls[3:0] extbus_cs[3:0] extbus_dycs[3:0] extbus_cas extbus_ras extbus_clk[3:0] extbus_ckeout[3:0] extbus_dqmout[3:0] static memory signals dynamic memory signals shared signals memory controller s tat e machine data buffers ahb slave register interface ahb slave memory interface emc ahb b us pa d in t erf ac e www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 347 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) note: if an access is attempted with a size other than a word (32 bits), it causes an error response to the ahb bus and the transfer is terminated. 19.8.2 ahb slave memory interface the ahb slave memory interface allo ws access to external memories. 19.8.2.1 memory transaction endianness the endianness of the data transfers to and from the external memories is determined by the endian mode (n) bit in the config register. note: the memory controller must be idle (see the busy field of the status register) before endianness is changed, so that the data is transferred correctly. 19.8.2.2 memory transaction size memory transactions can be 8, 16, or 32 bi ts wide. any access attempted with a size greater than a word (32 bits) causes an error response to the ahb bus and the transfer is terminated. 19.8.2.3 write protected memory areas write transactions to write-protected memory areas generate an error response to the ahb bus and the transfer is terminated. 19.8.3 pad interface the pad interface block provides the interfac e to the pads. the pad interface uses one feedback clock per lane, fbclkin[3:0], from the clkout[3:0] outputs of the emc to resynchronize sdram read data from the off-chip to on-chip domains. the emc dynamic memory requires 2 clkout signals for 16-bit memory and 4 clkout signals for 32-bit memory. 19.8.4 data buffers the ahb interface reads and writes via buffers to improve memory bandwidth and reduce transaction latency. the emc contains four 16-word buffers. the buffers can be used as read buffers, write buffers, or a combination of both. the buffers are allocated automatically. the buffers must be disabled during sdram an d syncflash initialization. they must also be disabled when performing syncflash co mmands. the buffers must be enabled during normal operation. the buffers can be enabled or disabled fo r static memory usi ng the staticconfig registers. 19.8.4.1 write buffers write buffers are used to: ? merge write transactions so that the number of external transactions are minimized. buffer data until the emc can complete the write transaction, improving ahb write latency. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 348 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) convert all dynamic memory write transactions into quadword bursts on the external memory interface. this enhances tran sfer efficiency for dynamic memory. ? reduce external memory traffic. this improves memory bandwidth and reduces power consumption. write buffer operation: ? if the buffers are enabled, an ahb write operat ion writes into the least recently used (lru) buffer, if empty. if the lru buffer is not empty, the contents of the buffer are flushed to memory to make space for the ahb write data. ? if a buffer contains write data it is marked as dirty, and its contents are written to memory before the buffer can be reallocated. the write buffers are flushed whenever: ? the memory controller state machine is not busy performing accesses to external memory. the memory controller state machine is not busy performing accesses to external memory, and an ahb interface is writing to a different buffer. note: for dynamic memory, the sm allest buffer flush is a quadword of data. for static memory, the smallest buffer flush is a byte of data. 19.8.4.2 read buffers read buffers are used to: ? buffer read requests from memo ry. future read requests th at hit the buffer read the data from the buffer rather than memory, reducing transaction latency. convert all read transactions into quadword bursts on the external memory interface. this enhances transfer efficiency for dynamic memory. ? reduce external memory traffic. this improves memory bandwidth and reduces power consumption. read buffer operation: ? if the buffers are enabled and the read data is contained in one of the buffers, the read data is provided directly from the buffer. ? if the read data is not contained in a buffer, the lru buffer is selected. if the buffer is dirty (contains write data), the write data is flushed to memory. when an empty buffer is available the read command is posted to the memory. a buffer filled by performing a r ead from memory is marked as not-dirty (not containing write data) and its contents are not flushe d back to the memory controller unless a subsequent ahb transfer performs a write that hits the buffer. 19.9 low-power operation in many systems, the contents of the me mory system have to be maintained during low-power sleep modes. the emc provides a mechanism to place the dynamic memories into self-refresh mode. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 349 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) self-refresh mode can be entered by soft ware by setting the srefreq bit in the dynamiccontrol register and polling the srefack bit in the status register. any transactions to memory that are gene rated while the memory controller is in self-refresh mode are rejected and an error response is generated to the ahb bus. clearing the srefreq bit in the dynamiccontrol register returns the memory to normal operation. see the memory data sheet for refresh requirements. note: the static memory can be accessed as normal when the sdram memory is in self-refresh mode. 19.9.1 low-power sdra m deep-sleep mode the emc supports jedec low-power sdram deep-sleep mode. deep-sleep mode can be entered by setting the deep-sleep mode (dp) bit, the dynamic memory clock enable bit (ce), and the dynamic clock control bit (cs) in the dynamiccontrol register. the device is then put into a low-power mode where the device is powered down and no longer refreshed. all data in the memory is lost. 19.9.2 low-power sdram partial array refresh the emc supports jedec low-power sdram part ial array refresh. partial array refresh can be programmed by initializing the sdram memory device appropriately. when the memory device is put into self-refresh mode only the memory banks specified are refreshed. the memory banks that are not refreshed lose their data contents. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 350 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.10 external static memory interface external memory interfacing depends on the bank width (32, 16 or 8 bit selected via mw bits in corresponding staticconfig register). if a memory bank is configured to be 32 bits wide, address lines a0 and a1 can be used as non-address lines. if a memory bank is configured to 16 bits wide, a0 is not required. however, 8 bit wide memory ban ks do require all address lines down to a0. configuring a1 and/or a0 line(s) to provide address or non-address function is accomplished using the syscon registers. symbol "a_b" in the following figures refers to the highest order address line in the data bus. symbol "a_m" refers to the highest order address line of the memory chip used in the external memory interface. if the external memory is used as external boot memory for flashless devices, refer to section 3.2 on how to connect the emc. the memory bank width for memory banks 1 and 2 is determined by the setting of the boot pins. 19.10.1 32-bit wide memory bank connection a. 32 bit wide memory bank interfaced to four 8 bit memory chips b. 32 bit wide memory bank interfaced to two 16 bit memory chips a[a_b:2] bls[1] d[15:8] ce oe we io[7:0] a[a_m:0] bls[0] d[7:0] ce oe we io[7:0] a[a_m:0] oe cs bls[3] d[31:24] ce oe we io[7:0] a[a_m:0] bls[2] d[23:16] ce oe we io[7:0] a[a_m:0] oe cs we ce oe we ub lb io[15:0] a[a_m:0] d[31:16] bls[2] ce oe we ub lb io[15:0] a[a_m:0] d[15:0] bls[0] a[a_b:2] bls[3] bls[1] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 351 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.10.2 16-bit wide memory bank connection c. 32 bit wide memory bank interfaced to one 8 bit memory chip fig 31. 32 bit bank external memory interfaces ( bits mw = 10) oe cs we ce oe we b3 b2 b1 b0 io[31:0] a[a_m:0] d[31:0] bls[2] a[a_b:2] bls[3] bls[0] bls[1] a. 16 bit wide memory bank interfaced to two 8 bit memory chips b. 16 bit wide memory bank interfaced to a 16 bit memory chip fig 32. 16 bit bank external memory interfaces (bits mw = 01) oe cs bls[1] d[15:8] ce oe we io[7:0] a[a_m:0] bls[0] d[7:0] ce oe we io[7:0] a[a_m:0] a[a_b:1] oe cs we ce oe we ub lb io[15:0] a[a_m:0] d[15:0] bls[0] a[a_b:1] bls[1] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 352 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.10.3 8-bit wide memory bank connection fig 33. 8 bit bank external memory interface (bits mw = 00) oe cs we d[7:0] ce oe we io[7:0] a[a_m:0] a[a_b:0] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 353 of 1164 nxp semiconductors UM10430 chapter 19: lpc18xx external memory controller (emc) 19.10.4 memory configuration example fig 34. typical memory configuration diagram nce noe q[31:0] a[20:0] nce noe io[15:0] a[15:0] nwe nub nlb nce noe io[15:0] a[15:0] nwe nub nlb nce noe io[7:0] a[16:0] nwe nce noe io[7:0] a[16:0] nwe nce noe io[7:0] a[16:0] nwe nce noe io[7:0] a[16:0] nwe 2mx32 burst mask rom 64kx16 sram, two off 128kx8 sram, four off a[20:0] a[20:0] d[31:0] d[31:0] cs0 oe cs1 cs2 we bls3 bls2 bls1 bls0 a[16:0] a[16:0] a[16:0] a[16:0] a[15:0] a[15:0] d[31:16] d[15:0] d[31:24] d[23:16] d[15:8] d[7:0] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 354 of 1164 20.1 how to read this chapter the usb0 host/device/otg controller is av ailable on parts lpc1850, lpc1830, and lpc1820. 20.2 basic configuration the usb0 host/device/otg contro ller is configured as follows: ? see ta b l e 2 9 4 for clocking and power control. ? the usb0 is reset by the usb0_rst (reset # 17). ? the usb0 is connected to interrupt slot # 8 in the nvic, and the is connected to slot # 9 in the event router. 20.3 features ? complies with universal seri al bus specification 2.0. ? complies with usb on-the-go supplement. ? complies with enhanced host c ontroller interface specification. ? complies with amba specification. ? supports auto usb 2.0 mode discovery. ? supports all high-speed usb-compliant peripherals. ? supports all full-speed usb-compliant peripherals. ? supports all low-speed usb-compliant peripherals. ? supports software hnp an d srp for otg peripherals. ? contains utmi+ compliant transceiver (phy). ? supports power management. ? supports six endpoints, control endpoint included. UM10430 chapter 20: lpc18xx usb0 host/device/otg controller rev. 00.13 ? 20 july 2011 user manual table 294. usb0 clocking and power control base clock branch clock maximum frequency notes usb0 clock base_usb0_clk clk_usb0 480 mhz uses pll0 dedicated to usb0. clk_usb0 must be 480 mhz clock for the usb0 to operate in all three modes (low-speed, full-speed, and high-speed modes). usb0 register interface clock base_m3_clk clk_m3_usb0 150 mhz uses pll1. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 355 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.4 introduction universal serial bus (usb) is a standard prot ocol developed to connect several types of devices to each other in order to exchange data or for other purposes. many portable devices can benefit from the ability to commun icate to each other ov er the usb interface without intervention of a host pc. the additi on of the on-the-go functionality to usb makes this possible without losing the benefits of the standard usb protocol. examples of usb devices are: pc, mouse, keyboard, mp3 player, digital camera, usb storage device (usb stick). 20.4.1 block diagram 20.4.2 about usb on-the-go the usb on-the-go block enables usage in both device mode and in host mode. this means that you can connect to a pc to exchange data, but also to another usb device such as a digital camera or mp3 player. 20.4.3 usb acronyms and abbreviations fig 35. high-speed usb otg block diagram arm cortex-m3 system memory ahb tx-buffer (dual-port ram) usb 2.0 high-speed otg master slave rx-buffer (dual-port ram) usb bus table 295. usb related acronyms acronym description atx analog transceiver dcd device controller driver dqh device endpoint queue head dtd device transfer descriptor eop end of packet ep end point fs full speed hcd host controller driver www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 356 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.4.4 transmit and receive buffers the usb otg controller contains a tx buffer to store data to be transmitted on the usb and an rx buffer to store data received from the usb. the rx buffer contains 256 words, and the tx buffer contains 128 words for each endpoint in device mode and 512 words in host mode. 20.4.5 fixed endpoint configuration table 296 shows the supported endpoint configurations. the maximum packet size (mps) (see table 297 ) is dependent on the type of end point and the device configuration (low-speed, full-speed, or high-speed). hs high speed ls low speed mps maximum packet size nak negative acknowledge otg on-the-go pid packet identifier qh queue head se0 single ended 0 sof start of frame tt transaction translator usb universal serial bus table 295. usb related acronyms acronym description table 296. fixed endpoint configuration logical endpoint physical endpoint endpoint type direction 00 control out 01 control in 1 2 interrupt/bulk/isochronous out 1 3 interrupt/bulk/isochronous in 2 4 interrupt/bulk/isochronous out 2 5 interrupt/bulk/isochronous in 3 6 interrupt/bulk/isochronous out 3 7 interrupt/bulk/isochronous in 4 8 interrupt/bulk/isochronous out 4 9 interrupt/bulk/isochronous in 5 10 interrupt/bulk/isochronous out 5 11 interrupt/bulk/isochronous in www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 357 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.5 pin description table 297. usb packet size endpoint type speed packet size (byte) control low-speed 8 full-speed 8, 16, 32, or 64 high-speed 64 isochronous low-speed n/a full-speed up to 1023 high-speed up to 1024 interrupt low-speed up to 8 full-speed up to 64 high-speed up to 1024 bulk low-speed n/a full-speed 8, 16, 32, or 64 high-speed 8, 16, 32, 64 or 512 table 298. usb0 pin description function pinned out direction description usb0_ind0 o port indicator led control output. usb0_ind1 o port indicator led control output. usb0_pwr_fault o port power fault signal indicating overcurrent condition; this signal monitors over-current on the usb bus (external circuitry required to detect over-current condition). usb0_pwr_en o vbus drive signal (towards external charge pump or power management unit); indicates that vbus must be driven (active high). usb0_dp i/o usb0 bidirectional d+ line. usb0_dm i/o usb0 bidirectional d ? line. usb0_vbus i vbus pin (power on usb cable). usb0_id i indicates to the transceiver whether connected a a-device (id low) or b-device (id high). usb0_rref 12.0 kohm (accuracy 1%) on-board resistor to ground for current reference; usb0_vdda3v3_ driver separate analog power supply for driver, 3.3v. usb0_vdda3v3 usb 3.3 v separate power supply voltage usb0_vssa_term dedicated analog ground for clean reference for termination resistors. usb0_vssa_ref dedicated clean analog ground for generation of reference currents and voltages. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 358 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6 register description table 299. register access abbreviations abbreviation description r/w read/write r/wc read/write one to clear r/wo read/write once ro read only wo write only table 300. register overview: usb0 otg controller (register base address 0x4000 6000) name access address offset description reset value - - 0x000 - 0x0ff reserved device/host capability registers caplength ro 0x100 capability register length 0x0100 0040 hcsparams ro 0x104 host controller structural parameters 0x0001 0011 hccparams ro 0x108 host controller capability parameters 0x0000 0006 dciversion ro 0x120 device interface version number 0x0000 0001 dccparams ro 0x124 device controller capability parameters 0x0000 0186 - - 0x128 - 0x13c reserved device/host operational registers usbcmd_d r/w 0x140 usb command (device mode) 0x0008 0000 usbcmd_h r/w 0x140 usb command (host mode) 0x0008 0000 usbsts_d r/w 0x144 usb status (device mode) 0x0000 0000 usbsts_h r/w 0x144 usb status (host mode) 0x0000 0000 usbintr_d r/w 0x148 usb interrupt enable (device mode) 0x0000 0000 usbintr_h r/w 0x148 usb interrupt enable (host mode) 0x0000 0000 frindex_d r/w 0x14c usb frame index (device mode) 0x0000 0000 frindex_h r/w 0x14c usb frame index (host mode) 0x0000 0000 - - 0x150 reserved deviceaddr r/w 0x154 usb device address (device mode) 0x0000 0000 periodiclistbase r/w 0x154 frame list base address (host mode) 0x0000 0000 endpointlistaddr r/w 0x158 address of endpoint list in memory 0x0000 0000 asynclistaddr r/w 0x158 address of endpoint list in memory 0x0000 0000 ttctrl r/w 0x15c asynchronous buffer status for embedded tt (host mode) 0x0000 0000 burstsize r/w 0x160 programmable burst size 0x0000 0000 txfilltuning r/w 0x164 host transmit pre-buffer packet tuning (host mode) 0x0000 0000 - - 0x168 - 0x170 reserved - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 359 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.1 use of registers the register interface has bi t functions described for de vice mode and bit functions described for host mode. however, during otg operations it is necessary to perform tasks independent of the controller mode. the only way to transition the controller mode out of host or device mode is by setting the controller reset bit. therefore, it is also necessary for the otg tasks to be performed independently of a controller reset as well as independently of the controller mode. binterval r/w 0x174 length of virtual frame 0x0000 0000 endptnak r/w 0x178 endpoint nak (device mode) 0x0000 0000 endptnaken r/w 0x17c endpoint nak enable (device mode) 0x0000 0000 - - 0x180 reserved - portsc1_d r/w 0x184 port 1 status/control (device mode) 0x0000 0000 portsc1_h r/w 0x184 port 1 status/control (host mode) 0x0000 0000 - - 0x188 - 0x1a0 otgsc r/w 0x1a4 otg status and control 0x0000 0000 usbmode_d r/w 0x1a8 usb device mode (device mode) 0x0000 0000 usbmode_h r/w 0x1a8 usb device mode (host mode) 0x0000 0000 device endpoint registers endptsetupstat r/w 0x1ac endpoint setup status 0x0000 0000 endptprime r/w 0x1b0 endpoint initialization 0x0000 0000 endptflush r/w 0x1b4 endpoint de-initialization 0x0000 0000 endptstat ro 0x1b8 endpoint status 0x0000 0000 endptcomplete r/w 0x1bc endpoint complete 0x0000 0000 endptctrl0 r/w 0x1c0 endpoint control 0 0x0000 0000 endptctrl1 r/w 0x1c4 endpoint control 1 0x0000 0000 endptctrl2 r/w 0x1c8 endpoint control 2 0x0000 0000 endptctrl3 r/w 0x1cc endpoint control 3 0x0000 0000 endptctrl4 r/w 0x1d0 endpoint control 4 0x0000 0000 endptctrl5 r/w 0x1d4 endpoint control 5 0x0000 0000 table 300. register overview: usb0 otg controller (register base address 0x4000 6000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 360 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller the following registers and register bits are used for otg operations. the values of these register bits are independent of the controller mode and are not affected by a write to the reset bit in the usbcmd register. ? all identification registers ? all device/host capabilities registers ? all bits of the otgsc register ( section 20.6.16 ) ? the following bits of the portsc register ( section 20.6.15 ): ? pts (parallel interface select) ? sts (serial transceiver select) ? ptw (parallel transceiver width) ? phcd (phy low power suspend) ? wkoc, wkdc, wkcn (wake signals) ? pic[1:0] (port indicators) ? pp (port power) 20.6.2 device/host capability registers fig 36. usb controller modes idle mode = 00 device mode = 10 host mode = 11 hardware reset or usbcmd rst bit = 1 write 10 to usbmode write 11 to usbmode table 301. caplength register (caplength - address 0x4000 6100) bit description bit symbol description reset value access 7:0 caplength indicates offset to add to the register base address at the beginning of the operational register 0x40 ro 23:8 hciversion bcd encoding of the ehci revision number supported by this host controller. 0x100 ro 31:24 - these bits are reserved and should be set to zero. -- www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 361 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller table 302. hcsparams register (hcsparams - address 0x4000 6104) bit description bit symbol description reset value access 3:0 n_ports number of downstream ports. this field specifies the number of physical downstream ports implemented on this host controller. 0x1 ro 4 ppc port power control. this field indicates whether the host controller implementation includes port power control. 0x1 ro 7:5 - these bits are reserved and should be set to zero. - - 11:8 n_pcc number of ports per companion controller. this field indicates the number of ports supported per internal companion controller. 0x0 ro 15:12 n_cc number of companion controller. this field indicates the number of companion controllers associated with this us b2.0 host controller. 0x0 ro 16 pi port indicators. this bit indicates whether the ports support port indicator control. 0x1 ro 19:17 - these bits are reserved and should be set to zero. - - 23:20 n_ptt number of ports per transaction translator. this field indicates the number of ports assigned to each transaction translator within the usb2.0 host controller. 0x0 ro 27:24 n_tt number of transaction translators. this field indicates the number of embedded transaction translators associated with the usb2.0 host controller. 0x0 ro 31:28 - these bits are reserved and should be set to zero. - - table 303. hccparams register (hccparams - address 0x4000 6108) bit description bit symbol description reset value access 0 adc 64-bit addressing capability. if zero, no 64-bit addressing capability is supported. 0ro 1 pfl programmable frame list flag. if set to one, then the system software can specify and use a smaller frame list and configure the host controller via the usbcmd register frame list size field. the frame list must always be aligned on a 4k-boundary. this requirement ensures that the frame list is always physically contiguous. 1ro 2 asp asynchronous schedule park capability. if this bit is set to a one, then the host controller supports the park feature for high-speed queue heads in the asynchronous schedule.the feature can be disabled or enabled and set to a specific level by using the asynchronous schedule park mode enable and asynchronous schedule park mode count fields in the usbcmd register. 1ro www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 362 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.3 usb command register (usbcmd) the host/device controller executes the command indicated in this register. 20.6.3.1 device mode 7:4 ist isochronous scheduling threshold. this field indicates, relative to the current position of the executing host controller, where software can reliably update the isochronous schedule. 0ro 15:8 eecp ehci extended capabilities pointer. this optional field indicates the existence of a capabilities list. 0ro 31:9 - these bits are reserved and should be set to zero. - - table 304. dciversion register (dcivers ion - address 0x4000 6120) bit description bit symbol description reset value access 15:0 dciversion the device controller interface conforms to the two-byte bcd encoding of the interface version number contained in this register. 0x1 ro table 305. dccparams (address 0x4000 6124) bit symbol description reset value access 4:0 den device endpoint number. 0x4 ro 6:5 - these bits are reserved and should be set to zero. - - 7 dc device capable. 0x1 ro 8 hc host capable. 0x1 ro 31:9 - these bits are reserved and should be set to zero. - - table 303. hccparams register (hccparams - address 0x4000 6108) bit description bit symbol description reset value access table 306. usb command register in device mode (usbcmd_d - address 0x4000 6140) bit description bit symbol value description access reset value 0 rs run/stop r/w 0 0 writing a 0 to this bit will cause a detach event. 1 writing a one to this bit will cause the device controller to enable a pull-up on usb_dp and initiate an attach event. this control bit is not directly connected to the pull-up enable, as the pull-up will become disabled upon transitioning into high-speed mode. software should use this bit to prevent an attach event before the device controller has been properly initialized. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 363 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 1 rst controller reset. software uses this bit to reset the controller. this bit is set to zero by the host/device controller when the reset process is complete. software cannot terminate the reset process early by writing a zero to this register. r/w 0 0 set to 0 by hardware when the reset process is complete. 1 when software writes a one to this bit, the device controller resets its internal pipelines, timers, counters, state machines etc. to their initial values. writing a one to this bit when the device is in the attached state is not recommended, since the effect on an attached host is undefined. in order to ensure that the device is not in an attached state before initiating a device controller reset, all primed endpoints should be flushed and the usbcmd run/stop bit should be set to 0. 3:2 - - not used in device mode. - 0 4 - - not used in device mode. - 0 5 - - not used in device mode. - 0 6 - - not used in device mode. writing a one to this bit when the device mode is selected, will have undefined results. -- 7 - - reserved. these bits should be set to 0. - - 9:8 - - not used in device mode. - - 10 - reserved.these bits should be set to 0. - 0 11 - - not used in device mode. - 12 - reserved.these bits should be set to 0. - 0 13 sutw setup trip wire during handling a setup packet, this bit is used as a semaphore to ensure that the setup data payload of 8 bytes is extracted from a qh by the dcd without being corrupted. if the setup lockout mode is off (see usbmode register) then there exists a hazard when new setup data arrives while the dcd is copying the setup data payload from the qh for a previous setup packet. this bit is set and cleared by software and will be cleared by hardware when a hazard exists. (see section 20.10 ). r/w 0 14 atdtw add dtd trip wire this bit is used as a semaphore to ensure the to proper addition of a new dtd to an active (primed) endpoint?s linked list. this bit is set and cleared by software during the process of adding a new dtd. see also section 20.10 . this bit shall also be cleared by hardware when its state machine is hazard region for which adding a dtd to a primed endpoint may go unrecognized. r/w 0 table 306. usb command register in device mode (usbcmd_d - address 0x4000 6140) bit description ?continued bit symbol value description access reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 364 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.3.2 host mode 15 - not used in device mode. - - 23:16 itc interrupt threshold control. the system software uses this field to set the maximum rate at which the host/device controller will issue interrupts. itc contains the maximum interrupt interval measured in micro- frames. valid values are shown below. all other values are reserved. 0x0 = immediate (no threshold) 0x1 = 1 micro frame. 0x2 = 2 micro frames. 0x8 = 8 micro frames. 0x10 = 16 micro frames. 0x20 = 32 micro frames. 0x40 = 64 micro frames. r/w 0x8 31:24 - reserved 0 table 306. usb command register in device mode (usbcmd_d - address 0x4000 6140) bit description ?continued bit symbol value description access reset value table 307. usb command register in host mode (usbcm d_h - address 0x4000 6140) bit description - host mode bit symbol value description access reset value 0 rs run/stop r/w 0 0 when this bit is set to 0, the host controller completes the current transaction on the usb and then halts. the hc halted bit in the status register indicates when the host controller has finished the transaction and has entered the stopped state. software should not write a one to this field unless the host controller is in the halted state (i.e. hchalted in the usbsts register is a one). 1 when set to a 1, the host controller proceeds with the execution of the schedule. the host controller continues execution as long as this bit is set to a one. 1 rst controller reset. software uses this bit to reset the controller. this bit is set to zero by the host/device controller when the reset process is complete. software cannot terminate the reset process early by writing a zero to this register. r/w 0 0 this bit is set to zero by hardware when the reset process is complete. 1 when software writes a one to this bit, the host controller resets its internal pipelines, timers, counters, state machines etc. to their initial value. any transaction currently in progress on usb is immediately terminated. a usb reset is not driven on downstream ports. software should not set this bit to a one when the hchalted bit in the usbsts register is a zero. attempting to reset an actively running host controller will result in undefined behavior. 2 fs0 bit 0 of the frame list size bits. see table 308 . this field specifies the size of the frame list that controls which bits in the frame index register should be used for the frame list current index. note that this field is made up from usbcmd bits 15, 3, and 2. 0 3 fs1 bit 1 of the frame list size bits. see table 308 .0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 365 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 4 pse this bit controls whether the host controller skips processing the periodic schedule. r/w 0 0 do not process the periodic schedule. 1 use the periodiclistbase regi ster to access the periodic schedule. 5 ase this bit controls whether the host controller skips processing the asynchronous schedule. r/w 0 0 do not process the asynchronous schedule. 1 use the asynclistaddr to access the asynchronous schedule. 6 iaa this bit is used as a doorbell by software to tell the host controller to issue an interrupt the next time it advances asynchronous schedule. r/w 0 0 the host controller sets this bit to zero after it has se t the interrupt on sync advance status bit in the usbsts regi ster to one. 1 software must write a 1 to this bit to ring the doorbell. when the host controller has evict ed all appropriate cached schedule states, it sets the interrupt on async advance status bit in the usbsts register. if the interrupt on sync advance enable bit in the usbintr register is one, then the host controller will assert an interrupt at the next interrupt threshold. software should not write a one to this bit when the asynchronous schedule is inactive. doing so will yield undefined results. 7 - - reserved 0 9:8 asp1_0 asynchronous schedule park mode contains a count of the number of successive transactions the host controller is allowed to execute from a high-speed queue head on the asynchronous schedule before continuing traversal of the asynchronous schedule. valid values are 0x1 to 0x3. remark: software must not write 00 to this bit when park mode enable is one as this will result in undefined behavior. r/w 11 10 - - reserved. - 0 11 aspe asynchronous schedule park mode enable r/w 1 0 park mode is disabled. 1 park mode is enabled. 12 - - reserved. - 0 13 - - not used in host mode. - 14 - - reserved. - 0 table 307. usb command register in host mode (usbcm d_h - address 0x4000 6140) bit description - host mode bit symbol value description access reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 366 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.4 usb status register (usbsts) this register indicates various states of the host/device controller and any pending interrupts. software sets a bit to zero in this register by writing a one to it. remark: this register does not indicate status resulting from a transaction on the serial bus. 15 fs2 bit 2 of the frame list size bits. see table 308 .-0 23:16 itc interrupt threshold control. the system software uses this field to set the maximum rate at which the host/device controller will issue interrupts. itc contains the maximum interrupt interval measured in micro-frames. valid values are shown below. all other values are reserved. 0x0 = immediate (no threshold) 0x1 = 1 micro frame. 0x2 = 2 micro frames. 0x8 = 8 micro frames. 0x10 = 16 micro frames. 0x20 = 32 micro frames. 0x40 = 64 micro frames. r/w 0x8 31:24 - reserved 0 table 307. usb command register in host mode (usbcm d_h - address 0x4000 6140) bit description - host mode bit symbol value description access reset value table 308. frame list size values usbcmd bit 15 usbcmd bit 3 usbcmd bit 2 frame list size 0 0 0 1024 elements (4096 bytes) - default value 0 0 1 512 elements (2048 bytes) 0 1 0 256 elements (1024 bytes) 0 1 1 128 elements (512 bytes) 1 0 0 64 elements (256 bytes) 1 0 1 32 elements (128 bytes) 1 1 0 16 elements (64 bytes) 1 1 1 8 elements (32 bytes) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 367 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.4.1 device mode table 309. usb status register in device mode (usbsts_d - address 0x4000 6144) register bit description bit symbol value description reset value access 0 ui usb interrupt 0 r/wc 0 this bit is cleared by software writing a one to it. 1 this bit is set by the host/device controller when the cause of an interrupt is a completion of a usb transaction where the transfer descriptor (td) has an interrupt on complete (ioc) bit set. this bit is also set by the host/device controller when a short packet is detected. a short packet is when the actual number of bytes received was less than the expected number of bytes. 1 uei usb error interrupt 0 r/wc 0 this bit is cleared by software writing a one to it. 1 when completion of a usb transaction results in an error condition, this bit is set by the host/device controller. this bit is set along with the usbint bit, if the td on which the error interrupt occurred also had its interrupt on complete (ioc) bit set. the device controller detects resume signaling only (see section 20.10.11.6 ). 2 pci port change detect. 0 r/wc 0 this bit is cleared by software writing a one to it. 1 the device controller sets this bit to a one when the port controller enters the full or high-speed operational state. when the port controller exits the full or high-speed operation states due to reset or suspend events, the notification mechanisms are the usb reset received bit (uri) and the dcsuspend bits (sli) respectively. 3 - not used in device mode. - 4- reserved. 0- 5 aai not used in device mode. 0 - 6 uri usb reset received 0 r/wc 0 this bit is cleared by software writing a one to it. 1 when the device controller detects a usb reset and enters the default state, this bit will be set to a one. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 368 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 7sri sof received 0r/wc 0 this bit is cleared by software writing a one to it. 1 when the device controller detects a start of (micro) frame, this bit will be set to a one. when a sof is extremely late, the device controller will automatically set this bit to indicate that an sof was expected. therefore, this bit will be set roughly every 1 ms in device fs mode and every 125 ? s in hs mode and will be synchronized to the actual sof that is received. since the device controller is initialized to fs before connect, this bit will be set at an interval of 1ms during the prelude to connect and chirp. 8 sli dcsuspend 0 r/wc 0 the device controller clears the bit upon exiting from a suspend state. this bit is cleared by software writing a one to it. 1 when a device controller enters a suspend state from an active state, this bit will be set to a one. 11:9 - - reserved. software should only write 0 to reserved bits. 12 - - not used in device mode. 0 13 - - not used in device mode. 0 14 - - not used in device mode. 0 15 - - not used in device mode. 0 16 naki nak interrupt bit 0 ro 0 this bit is automatically cleared by hardware when the all the enabled tx/rx endpoint nak bits are cleared. 1 it is set by hardware when for a particular endpoint both the tx/rx endpoint nak bit and the corresponding tx/rx endpoint nak enable bit are set. 17 - - reserved. software should only write 0 to reserved bits. 0- 18 - not used in device mode. 0 - 19 - not used in device mode. 0 - 31:20 - - reserved. software should only write 0 to reserved bits. - table 309. usb status register in device mode (usbsts_d - address 0x4000 6144) register bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 369 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.4.2 host mode table 310. usb status register in host mode (usbst s_h - address 0x4000 6144) register bit description bit symbol value description reset value access 0 ui usb interrupt (usbint) 0 r/wc 0 this bit is cleared by software writing a one to it. 1 this bit is set by the host/device controller when the cause of an interrupt is a completion of a usb transaction where the transfer descriptor (td) has an interrupt on complete (ioc) bit set. this bit is also set by the host/device controller when a short packet is detected. a short packet is when the actual number of bytes received was less than the expected number of bytes. 1 uei usb error interrupt (usberrint) 0 r/wc 0 this bit is cleared by software writing a one to it. 1 when completion of a usb transaction results in an error condition, this bit is set by the host/device controller. this bit is set along with the usbint bit, if the td on which the error interrupt occurred also had its interrupt on complete (ioc) bit set. 2 pci port change detect. 0 r/wc 0 this bit is cleared by software writing a one to it. 1 the host controller sets this bit to a one when on any port a connect status occurs, a port enable/disable change occurs, or the force port resume bit is set as the result of a j-k transition on the suspended port. 3 fri frame list roll-over 0 r/wc 0 this bit is cleared by software writing a one to it. 1 the host controller sets this bit to a one when the frame list index rolls over from its maximum value to zero. the exact value at which the rollover occurs depends on the frame list size. for example, if the frame list size (as programmed in the frame list size field of the usbcmd register) is 1024, the frame index register rolls over every time frindex bit 13 toggles. similarly, if the size is 512, the host controller sets this bit to a one every time frindex bit 12 toggles (see section 20.6.6 ). 4- reserved. 5 aai interrupt on async advance 0 r/wc 0 this bit is cleared by software writing a one to it. 1 system software can force the host controller to issue an interrupt the next time the host controller advances the asynchronous schedule by writing a one to the interrupt on async advance doorbell bit in the usbcmd register. this status bit indicates the assertion of that interrupt source. 6 - - not used by the host controller. 0 r/wc 7sri sof received 0r/wc 0 this bit is cleared by software writing a one to it. 1 in host mode, this bit will be set every 125 ? s and can be used by host controller driver as a time base. 8 - - not used by the host controller. - - 11:9 - - reserved. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 370 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 12 hch hchalted 1 ro 0 the rs bit in usbcmd is set to zero. set by the host controller. 1 the host controller sets this bit to one after it has stopped executing because of the run/stop bit being set to 0, either by software or by the host controller hardware (e.g. because of an internal error). 13 rcl reclamation 0 ro 0 no empty asynchronous schedule detected. 1 an empty asynchronous schedule is detected. set by the host controller. 14 ps periodic schedule status this bit reports the current real status of the periodic schedule. the host controller is not required to immediately disable or enable the periodic schedule when software transitions the periodic schedule enable bit in the usbcmd register. when this bit and the periodic schedule enable bit are the same value, the periodic schedule is either enabled (if both are 1) or disabled (if both are 0). 0ro 0 the periodic schedule status is disabled. 1 the periodic schedule status is enabled. 15 as asynchronous schedule status this bit reports the current real status of the asynchronous schedule. the host controller is not required to immediately disable or enable the asynchronous schedule when software transitions the asynchronous schedule enable bit in the usbcmd register. when this bit and the asynchronous schedule enable bit are the same value, the asynchronous schedule is either enabled (if both are 1) or disabled (if both are 0). 0 0 asynchronous schedule status is disabled. 1 asynchronous schedule status is enabled. 16 - not used on host mode. 0 - 17 - reserved. 18 uai usb host asynchronous interrupt (usbhstasyncint) 0 r/wc 0 this bit is cleared by software writing a one to it. 1 this bit is set by the host controller when the cause of an interrupt is a completion of a usb transaction where the transfer descriptor (td) has an interrupt on comple te (ioc) bit set and the td was from the asynchronous schedule. this bit is also set by the host when a short packet is detected and the packet is on the asynchronous schedule. a short packet is when the actual number of bytes received was less than the expected number of bytes. 19 upi usb host periodic interrupt (usbhstperint) 0 r/wc 0 this bit is cleared by software writing a one to it. 1 this bit is set by the host controller when the cause of an interrupt is a completion of a usb transaction where the transfer descriptor (td) has an interrupt on complete (ioc) bit set and the td was from the periodic schedule. this bit is also set by the host controller when a short packet is detected and the packet is on the periodic schedule. a short packet is when the actual number of bytes received was less than the expected number of bytes. 31:20 - table 310. usb status register in host mode (usbst s_h - address 0x4000 6144) register bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 371 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.5 usb interrupt register (usbintr) the software interrupts are enabled with this register. an interrupt is generated when a bit is set and the corresponding interrupt is active. the usb status register (usbsts) still shows interrupt sources even if they are disabled by the usbintr register, allowing polling of interrupt events by the software. all interrupts must be acknowledged by software by clearing (that is writing a 1 to) the corresponding bit in the usbsts register. 20.6.5.1 device mode table 311. usb interrupt register in device mode (usbintr_d - address 0x4000 6148) bit description bit symbol description reset value access 0 ue usb interrupt enable when this bit is one, and the usbint bit in the usbsts r egister is one, the host/device controller will issue an interr upt at the next interr upt threshold. the interrupt is acknowledged by software clearing the usbint bit in usbsts. 0r/w 1 uee usb error interrupt enable when this bit is a one, and the usberrint bit in the usbst s register is a one, the host/device controller will issue an interr upt at the next interr upt threshold. the interrupt is acknowledged by software clearing the usberrint bit in the usbsts register. 0r/w 2 pce port change detect enable when this bit is a one, and the port chan ge detect bit in the usbsts register is a one, the host/device controller will issue an interrupt. the interrupt is acknowledged by software clearing the port change detect bit in usbsts. 0r/w 3 - not used by the device controller. 4- reserved 0- 5 - not used by the device controller. 6 ure usb reset enable when this bit is a one, and the usb reset received bit in the usbsts register is a one, the device controller will issue an interrupt. the interrupt is acknowledged by software clearing the usb reset received bit. 0r/w 7 sre sof received enable when this bit is a one, and the sof received bit in the u sbsts register is a one, the device controller will issue an interrupt. the interrupt is acknowledged by software clearing the sof received bit. 0r/w 8 sle sleep enable when this bit is a one, and the dcsuspend bit in the usbsts register transitions, the device controller will issue an interrupt. the interrupt is acknowledged by software writing a one to the dcsuspend bit. 0r/w 15:9 - reserved -- 16 nake nak interrupt enable this bit is set by software if it wants to enable the hardware interrupt for the nak interrupt bit. if both this bit and the corresponding nak interrupt bit are set, a hardware interrupt is generated. 0r/w 17 - reserved 18 - not used by the device controller. 19 - not used by the device controller. 31:20 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 372 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.5.2 host mode table 312. usb interrupt register in host mode (usbintr_h - address 0x4000 6148) bit description bit symbol description access reset value 0 ue usb interrupt enable when this bit is one, and the usbint bit in the usbsts r egister is one, the host/device controller will issue an interr upt at the next interr upt threshold. the interrupt is acknowledged by software clearing the usbint bit in usbsts. r/w 0 1 uee usb error interrupt enable when this bit is a one, and the usberrint bit in the usbst s register is a one, the host/device controller will issue an interr upt at the next interr upt threshold. the interrupt is acknowledged by software clearing the usberrint bit in the usbsts register. r/w 0 2 pce port change detect enable when this bit is a one, and the port chan ge detect bit in the usbsts register is a one, the host/device controller will issue an interrupt. the interrupt is acknowledged by software clearing the port change detect bit in usbsts. r/w 0 3 fre frame list rollover enable when this bit is a one, and the frame list rollover bit in the usbsts register is a one, the host controller will issue an interrupt. the interrupt is acknowledged by software clearing the frame list rollover bit. 4 - reserved -0 5 aae interrupt on asynchronous advance enable when this bit is a o ne, and the interrupt on async ad vance bit in the usbsts register is a one, the host controller will issue an in terrupt at the next interrupt threshold. the interrupt is acknowledged by software clearing the interrupt on async advance bit. r/w 0 6 - not used by the host controller. - 0 7 sre if this bit is one and the sri bit in the usbsts register is one, the host controller will issue an interrupt. in host mode, the sri bit will be set every 125 ? s and can be used by the host controller as a time base. the interrupt is acknowledged by software clearing the sri bit in the usbsts register. -0 8 - not used by the host controller. - 0 15:9 - reserved 16 - not used by the host controller. r/w 0 17 - reserved 18 uaie usb host asynchronous interrupt enable when this bit is a one, and the usbhstasyncint bit in the usbsts register is a one, the host controller will issue an interrupt at the next interrupt threshold. the interrupt is acknowledged by software clearing the usbhstasyncint bit. r/w 0 19 upia usb host periodic interrupt enable when this bit is a one, and the usbhstperint bit in the usbsts register is a one, the host controller will issue an interrupt at the next interrupt threshold. the interrupt is acknowledged by software clearing the usbhstperint bit. r/w 0 31:20 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 373 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.6 frame index register (frindex) 20.6.6.1 device mode in device mode this register is read on ly, and the device controller updates the frindex[13:3] register from the frame number indicated by the sof marker. whenever a sof is received by the usb bus, frind ex[13:3] will be checked against the sof marker. if frindex[13:3] is different from the sof marker, frind ex[13:3] will be set to the sof value and frindex[2:0] will be set to zero (i.e. sof for 1 ms frame). if frindex [13:3] is equal to the sof value, frindex[2:0] will be incremented (i.e. sof for 125 ? s micro-frame) by hardware. 20.6.6.2 host mode this register is used by the host controller to index the periodic frame list. the register updates every 125 ? s (once each micro-frame). bits[n: 3] are used to select a particular entry in the periodic frame list during periodic schedule execution. the number of bits used for the index depends on the size of th e frame list as set by system software in the frame list size field in the usbcmd register. this register must be written as a dword. byte writes produce undefined results. this register cannot be written unle ss the host controller is in the 'halted' state as indicated by the hchalted bit in the usbsts register (hos t mode). a write to this register while the run/stop bit is set to a one produces undefined results. writes to this register also affect the sof value. table 313. usb frame index register in device mode (frindex_d - address 0x4000 614c) bit description bit symbol description reset value access 2:0 frindex2_0 current micro frame number n/a ro 13:3 frindex13_3 current frame number of the last frame transmitted n/a ro 31:14 - reserved n/a table 314. usb frame index register in host (frindex_h - address 0x4000 614c) bit description bit symbol description reset value access 2:0 frindex2_0 current micro frame number n/a r/w 12:3 frindex12_3 frame list current index. n/a r/w 31:13 - reserved n/a table 315. number of bits used for the frame list index usbcmd bit 15 usbcmd bit 3 usbcmd bit 2 frame list size n 0 0 0 1024 elements (4096 bytes). default value. 12 0 0 1 512 elements (2048 bytes) 11 0 1 0 256 elements (1024 bytes) 10 0 1 1 128 elements (512 bytes) 9 1 0 0 64 elements (256 bytes) 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 374 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.7 device address (d eviceaddr - d evice) and periodic list base (periodiclistbase- host) registers 20.6.7.1 device mode the upper seven bits of this register repr esent the device address. after any controller reset or a usb reset, the device address is se t to the default address (0). the default address will match all incoming addresses. software shall reprogram the address after receiving a set_ad dress descriptor. the usbadra bit is used to accelerate the set_address sequence by allowing the dcd to preset the usbadr register bits be fore the status phase of the set_address descriptor. 20.6.7.2 host mode this 32-bit register contains the beginning address of the periodic frame list in the system memory. the host controlle r driver (hcd) loads this regi ster prior to starting the schedule execution by the host controller. the memory structure referenced by this 1 0 1 32 elements (128 bytes) 7 1 1 0 16 elements (64 bytes) 6 1 1 1 8 elements (32 bytes) 5 table 315. number of bits used for the frame list index usbcmd bit 15 usbcmd bit 3 usbcmd bit 2 frame list size n table 316. usb device address register in device mode (deviceaddr - address 0x4000 6154) bit description bit symbol value description reset value access 23:0 - reserved 0 - 24 usbadra device address advance 0 any write to usbadr are instantaneous. 1 when the user writes a one to this bit at the same time or before usbadr is written, the write to usbadr fields is staged and held in a hidden register. after an in occurs on endpoint 0 and is acknowledged, usbadr will be loaded from the holding register. hardware will automatically clear this bit on the following conditions: ? in is acked to endpoint 0. usbadr is updated from the staging register. ? out/setup occurs on endpoint 0. usbadr is not updated. ? device reset occurs. usbadr is set to 0. remark: after the status phase of the set_address descriptor, the dcd has 2 ms to program the usbadr field. this mechanism will ensure this specification is met when the dcd can not write the device address within 2 ms from the set_address stat us phase. if the dcd writes the usbadr with usbadra=1 after the set_address data phase (before the prime of the status phase), the usbadr will be programmed instantly at the correct time and meet the 2 ms usb requirement. 31:25 usbadr usb device address 0 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 375 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller physical memory pointer is assumed to be 4 kb aligned. the contents of this register are combined with the frame index register (fri ndex) to enable the host controller to step through the periodic frame list in sequence. 20.6.8 endpoint list address regist er (endpointlista ddr - device) and asynchronous list address (asy nclistaddr - host) registers 20.6.8.1 device mode in device mode, this register contains the addr ess of the top of the endpoint list in system memory. bits[10:0] of this r egister cannot be m odified by the system software and will always return a zero when read.the memory structure referenced by this physical memory pointer is assumed 64 byte aligned. 20.6.8.2 host mode this 32-bit register contains the address of the next asynchronous queue head to be executed by the host. bits [4:0] of this regist er cannot be modified by the system software and will always return a zero when read. 20.6.9 tt control register (ttctrl) 20.6.9.1 device mode this register is not used in device mode. table 317. usb periodic list base register in host mode (periodiclistbase - address 0x4000 6154) bit description bit symbol description reset value access 11:0 - reserved - - 31:12 perbase31_12 base address (low) these bits correspond to the memory address signals 31:12. -r/w table 318. usb endpoint list address register in devi ce mode (endpointlistaddr - address 0x4000 6158) bit description bit symbol description reset value access 10:0 - reserved 0 - 31:11 epbase31_11 endpoint list pointer (low) these bits correspond to memory address signals 31:11, respectively. this field will reference a list of up to 4 queue heads (qh). (i.e. one queue head per endpoint and direction.) -r/w table 319. usb asynchronous list address register in host mode (asynclistaddr- address 0x4000 6158) bit description bit symbol description reset value access 4:0 - reserved 0 - 31:5 asybase31_5 link pointer (low) lpl these bits correspond to memory address signals 31:5, respectively. this field may only reference a queue head (oh). -r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 376 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.9.2 host mode this register contains parameters needed for in ternal tt operations. this register is used by the host controller only. writes must be in dwords. 20.6.10 burst size register (burstsize) this register is used to control and dynami cally change the burst size used during data movement on the master interface of the usb dma controller. writes must be in dwords. the default for the length of a burst of 32-bit words for rx and tx dma data transfers is 16 words each. 20.6.11 transfer buffer fill t uning register (txfilltuning) 20.6.11.1 device controller this register is not used in device mode. 20.6.11.2 host controller the fields in this register control perf ormance tuning associated with how the host controller posts data to the tx latency fifo before moving the data onto the usb bus. the specific areas of performance include the how much data to post into the fifo and an estimate for how long that operation should take in the target system. definitions: t 0 = standard packet overhead t 1 = time to send data payload t ff = time to fetch packet into tx fifo up to specified level t s = total packet flight time (send-only) packet; t s = t 0 + t 1 t p = total packet time (fetch and send) packet; t p = t ff + t 0 + t 1 table 320. usb tt control register in host mode (ttctrl - address 0x4000 615c) bit description bit symbol description reset value access 23:0 - reserved. 0 - 30:24 ttha hub address when fs or ls device are connected directly. n/a r/w 31 - reserved. 0 table 321. usb burst size register (burstsize - ad dress 0x4000 6160) bit descrip tion - device/host mode bit symbol description reset value access 7:0 rxpburst programmable rx burst length this register represents the maximum length of a burst in 32-bit words while moving data from the usb bus to system memory. 0x10 r/w 15:8 txpburst programmable tx burst length this register represents the maximum length of a burst in 32-bit words while moving data from system memory to the usb bus. 0x10 r/w 31:16 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 377 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller upon discovery of a transmit (out/setup) pack et in the data structures, host controller checks to ensure t p remains before the end of the (micro) frame. if so it proceeds to pre-fill the tx fifo. if at an ytime during the pre-fill operati on the time remaining the [micro]frame is < t s then the packet attempt ceases and the packet is tried at a later time. although this is not an erro r condition and the host controller will ev entually recover, a mark will be made the scheduler health coun ter to note the occurr ence of a ?backoff? event. when a back-off event is detected, t he partial packet fetched may need to be discarded from the latency buff er to make room for periodic traffic that will begin after the next sof. too many back-off events can waste bandwidth and power on the system bus and thus should be minimized (not necessar ily eliminated). backoffs can be minimized with use of the tschhealth (t ff ) described below. 20.6.12 binterval register this register defines the binterval value which determines the length of the virtual frame (see section 20.7.7 ). table 322. usb transfer buffer fill tuning register in host mode (txfilltuning - address 0x4000 6164) bit description bit symbol description reset value access 7:0 txschoh fifo burst threshold this register controls the number of data bursts that are posted to the tx latency fifo in host mode before the packet begins on to the bus. the minimum value is 2 and this value should be a low as possible to maximize usb performance. a higher value can be used in systems with unpredictable latency and/or insufficient bandwidth where the fifo may underrun because the data transferred from the latency fifo to usb occurs before it can be replenished from system memory. this value is ignored if the stream disable bit in usbmode register is set. 0x2 r/w 12:8 txscheatlth scheduler health counter this register increments when the host controller fails to fill the tx latency fifo to the level programmed by txfifothres before running out of time to send the packet before the next start-of-frame . this health counter measures the number of times this occurs to provide feedback to selecting a proper txschoh. writing to this register will clear the counter. the maximum value is 31. 0x0 r/w 15:13 - reserved - - 21:16 txfifothres scheduler overhead this register adds an additional fixed offset to the schedule time estimator described above as t ff . as an approximation, the value chosen for this register should limit the number of back-off events captured in the txschhealth to less than 10 per second in a highly utilized bus. choosing a value that is too high for this register is not desired as it can needlessly reduce usb utilization. the time unit represented in this register is 1.267 ? s when a device is connected in high-speed mode for otg and sph. the time unit represented in this register is 6.333 ? s when a device is connected in low/full speed mode for otg and sph. 0x0 r/w 31:22 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 378 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.13 usb endpoint nak register (endptnak) 20.6.13.1 device mode this register indicates when the device se nds a nak handshake on an endpoint. each tx and rx endpoint has a bit in the eptn and eprn field respectively. a bit in this register is cleared by writing a 1 to it. 20.6.13.2 host mode this register is not used in host mode. 20.6.14 usb endpoint nak enable register (endptnaken) 20.6.14.1 device mode each bit in this register enables the corres ponding bit in the endptnak register. each tx and rx endpoint has a bit in the eptne and eprne field respectively. table 323. usb binterval register (binterv al - address 0x4000 6174) bit description bit symbol description reset value access 3:0 bint binterval value (see section 20.7.7 )0x00r/w 31:4 - reserved - - table 324. usb endpoint nak re gister (endptnak - address 0 x4000 6178) bit description bit symbol description reset value access 5:0 eprn rx endpoint nak each rx endpoint has one bit in this field. the bit is set when the device sends a nak handshake on a received out or ping token for the corresponding endpoint. bit 5 corresponds to endpoint 5. ... bit 1 corresponds to endpoint 1. bit 0 corresponds to endpoint 0. 0x00 r/wc 15:6 - reserved - - 21:16 eptn tx endpoint nak each tx endpoint has one bit in this field. the bit is set when the device sends a nak handshake on a received in token for the corresponding endpoint. bit 3 corresponds to endpoint 3. ... bit 1 corresponds to endpoint 1. bit 0 corresponds to endpoint 0. 0x00 r/wc 31:22 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 379 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.14.2 host mode this register is not used in host mode. 20.6.15 port status and c ontrol register (portsc1) 20.6.15.1 device mode the device controller implements one port regi ster, and it does not support power control. port control in device mode is used for stat us port reset, suspend, and current connect status. it is also used to initiate test mode or force signaling. this re gister allows software to put the phy into low-power suspend mode and disable the phy clock. table 325. usb endpoint nak enable register (end ptnaken - address 0x4000 617c) bit description bit symbol description reset value access 5:0 eprne rx endpoint nak enable each bit enables the corresponding rx nak bit. if this bit is set and the corresponding rx endpoint nak bit is set, the nak interrupt bit is set. bit 5 corresponds to endpoint 5. ... bit 1 corresponds to endpoint 1. bit 0 corresponds to endpoint 0. 0x00 r/w 15:6 - reserved - - 21:16 eptne tx endpoint nak each bit enables the corresponding tx nak bit. if this bit is set and the corresponding tx endpoint nak bit is set, the nak interrupt bit is set. bit 5 corresponds to endpoint 5. ... bit 1 corresponds to endpoint 1. bit 0 corresponds to endpoint 0. 0x00 r/w 31:22 - reserved - - table 326. port status and control register in device mode (portsc1_d - address 0x4000 6184) bit description bit symbol value description reset value access 0 ccs current connect status 0 ro 0 device not attached a zero indicates that the device did no t attach successfully or was forcibly disconnected by the software writing a zero to the run bit in the usbcmd register. it does not state the device being disconnected or suspended. 1 device attached. a one indicates that the device successfully attached and is operating in either high-speed mode or full-speed mode as indicated by the high speed port bit in this register. 1 - - not used in device mode 0 - 2 pe port enable. this bit is always 1. the device port is always enabled. 1ro 3 pec port enable/disable change this bit is always 0. the device port is always enabled. 0ro www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 380 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 5:4 - - reserved 0 ro 6 fpr force port resume after the device has been in suspend state for 5 ms or more, software must set this bit to one to drive resume signaling before clearing. the device controller will set this bit to one if a j-to-k transition is detected while the port is in the suspend state. the bit will be cleared when the device returns to normal operation. when this bit transitions to a one because a j-to-k transition detected, the port change detect bit in the usbsts register is set to one as well. 0r/w 0 no resume (k-state) detected/driven on port. 1 resume detected/driven on port. 7 susp suspend in device mode, this is a read-only status bit . 0ro 0 port not in suspend state 1 port in suspend state 8pr port reset in device mode, this is a read-only status bit. a device reset from the usb bus is also indicated in the usbsts register. 0ro 0 port is not in the reset state. 1 port is in the reset state. 9 hsp high-speed status remark: this bit is redundant with bits 27:26 (pspd) in this register. it is implemented for compatibility reasons. 0ro 0 host/device connected to the port is not in high-speed mode. 1 host/device connected to the port is in high-speed mode. 11:10 - - not used in device mode. 12 - - not used in device mode. 13 - - reserved - - 15:14 pic1_0 port indicator control writing to this field effects the value of the usb0_ind[1:0] pins. 00 r/w 0x0 port indicators are off. 0x1 amber 0x2 green 0x3 undefined table 326. port status and control register in device mode (portsc1_d - address 0x4000 6184) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 381 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 19:16 ptc3_0 port test control any value other than 0000 indicates that the port is operating in test mode. the force_enable_fs and force enable_ls are extensions to the test mode support specified in the ehci specification. writing the ptc field to any of the force_enable_hs/fs/ls values will force the port into the connected and enabled state at the selected speed. writing the ptc field back to test_mode_disable will allow the port st ate machines to progress normally from that point. values 0111 to 1111 are not valid. 0000 r/w 0x0 test_mode_disable 0x1 j_state 0x2 k_state 0x3 se0 (host)/nak (device) 0x4 packet 0x5 force_enable_hs 0x6 force_enable_fs 20 - - not used in device mode. this bit is always 0 in device mode. 0 - 21 - - not used in device mode. this bit is always 0 in device mode. 0 - 22 - not used in device mode. this bit is always 0 in device mode. 0 - 23 phcd phy low power suspe nd - clock disable (plpscd) in device mode, the phy can be put into low power suspend ? clock disable when the device is not running (usbcmd run/stop = 0) or the host has signaled suspend (portsc suspend = 1). low power suspend will be cleared automatically when the host has signaled resume. before forcing a resume from the device, the device controller driver must clear this bit. 0r/w 0 writing a 0 enables the phy clock. reading a 0 indicates the status of the phy clock (enabled). 1 writing a 1 disables the phy clock. reading a 1 indicates the status of the phy clock (disabled). 24 pfsc port force full speed connect 0 r/w 0 port connects at any speed. 1 writing this bit to a 1 will force the port to only connect at full speed. it disables the chirp sequence that allows the port to identify itself as high-speed. this is useful for testing fs configurations with a hs host, hub or device. 25 - - reserved 27:26 pspd port speed this register field indicates the speed at which the port is operating. 0ro 0x0 full-speed 0x1 invalid in device mode 0x2 high-speed 31:28 - - reserved - - table 326. port status and control register in device mode (portsc1_d - address 0x4000 6184) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 382 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.15.2 host mode the host controller uses one port. the register is only reset when po wer is initially applied or in response to a cont roller reset. the initial c onditions of the port are: ? no device connected ? port disabled if the port has power control, this state remains until software applies power to the port by setting port power to one in the portsc register. table 327. port status and control register in host mode (portsc1_h - address 0x4000 6184) bit description bit symbol value description reset value access 0 ccs current connect status this value reflects the current state of the port and may not correspond directly to the event that caused the csc bit to be set. this bit is 0 if pp (port power bit) is 0. software clears this bit by writing a 1 to it. 0r/wc 0 no device is present. 1 device is present on the port. 1 csc connect status change indicates a change has occurred in the port?s current connect status. the host/device controller sets this bit for all changes to the port device connect status, even if system software has no t cleared an existing connect status change. for example, the insertion status changes twice before system software has cleared the changed condition, hub hardware will be setting an already-set bit (i.e., the bit will remain set). software clears this bit by writing a one to it. this bit is 0 if pp (port power bit) is 0 0r/wc 0 no change in current status. 1 change in current status. 2 pe port enable. ports can only be enabled by the host controller as a part of the reset and enable. software cannot enable a port by writing a one to this field. ports can be disabled by either a fault condition (disconnect event or other fault condition) or by the host software. note that the bit status does not change until the port state actually changes. there may be a delay in disabling or enabling a port due to other host controller and bus events. when the port is disabled. downstream propagation of data is blocked except for reset. this bit is 0 if pp (port power bit) is 0. 0r/w 0 port disabled. 1 port enabled. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 383 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 3 pec port disable/enable change for the root hub, this bit gets set to a one only when a port is disabled due to disconnect on the port or due to the appropriate conditions existing at the eof2 point (see chapter 11 of the usb specification ). software clears this by writing a one to it. this bit is 0 if pp (port power bit) is 0, 0r/wc 0 no change. 1 port enabled/disabled status has changed. 4 oca over-current active this bit will automatically transition from 1 to 0 when the over-current condition is removed. 0ro 0 the port does not have an over-current condition. 1 the port has currently an over-current condition. 5 occ over-current change this bit gets set to one when there is a change to over-current active. software clears this bit by writing a one to this bit position. 0r/wc 6 fpr force port resume software sets this bit to one to drive resume signaling. the host controller sets this bit to one if a j-to-k transition is detected while the port is in the suspend state. when this bit tran sitions to a one because a j-to-k transition is detected , the port change detect bi t in the usbsts register is also set to one. this bit will automatically change to zero after the resume sequence is complete. this behavior is different from ehci where the host controller driver is required to set this bit to a zero after the resume duration is timed in the driver. note that when the host controller owns the port, the resume sequence follows the defined sequence documented in the usb specification revision 2.0. the resume signaling (full-speed k) is driven on the port as long as this bit remains a one. this bit will remain a one until the port has switched to the high-speed idle. writing a zero has no affect because the port controller will time the resume operation clear the bit the port control state switches to hs or fs idle. this bit is 0 if pp (port power bit) is 0. 0r/w 0 no resume (k-state) detected/driven on port. 1 resume detected/driven on port. table 327. port status and control register in host mode (portsc1_h - address 0x4000 6184) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 384 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 7 susp suspend together with the pe (port enabled bit), this bit describes the port states, see table 328 . the host controller will unconditionally set this bit to zero when software sets the force port resume bit to zero. the host controller ignores a write of zero to this bit. if host software sets this bit to a one when the port is not enabled (i.e. port enabled bit is a zero) the results are undefined. this bit is 0 if pp (port power bit) is 0. 0r/w 0 port not in suspend state 1 port in suspend state when in suspend state, downstream propagation of data is blocked on this port, except for port reset. the blocking occurs at the end of the current transaction if a transaction was in progress when this bit was written to 1. in the suspend state, the port is sensitive to resume detection. note that the bit status does not change until the port is suspended and that there may be a delay in suspending a port if there is a transaction currently in progress on the usb. 8pr port reset when software writes a one to this bit the bus-reset sequence as defined in the usb specification revision 2.0 is started. this bit will automatically change to zero after the reset sequence is complete. this behavior is different from ehci where the host contro ller driver is required to set this bit to a zero after the reset duration is timed in the driver. this bit is 0 if pp (port power bit) is 0. 0r/w 0 port is not in the reset state. 1 port is in the reset state. 9 hsp high-speed status 0 ro 0 host/device connected to the port is not in high-speed mode. 1 host/device connected to the port is in high-speed mode. 11:10 ls line status these bits reflect the current logical levels of the usb_dp and usb_dm signal lines. usb_dp corresponds to bit 11 and usb_dm to bit 10. in host mode, the use of linestate by the host controller driver is not necessary for this controller (unlike ehci) because the controller hardware manages the connection of ls and fs. 0x3 ro 0x0 se0 (usb_dp and usb_dm low) 0x1 j-state (usb_dp high and usb_dm low) 0x2 k-state (usb_dp low and usb_dm high) 0x3 undefined table 327. port status and control register in host mode (portsc1_h - address 0x4000 6184) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 385 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 12 pp - port power control host/otg controller requires port power control switches. this bit represents the current setting of the switch (0=off, 1=on). when power is not available on a port (i.e. pp equals a 0), the port is non-functional and will not report attaches, detaches, etc. when an over-current condition is detected on a powered port and ppc is a one, the pp bit in each affected port may be transitioned by the host controller driver from a one to a zero (removing power from the port). 0r/w 0 port power off. 1 port power on. 13 - - reserved 0 - 15:14 pic1_0 port indicator control writing to this field effects the value of the pins usb0_ind1 and usb0_ind0. 00 r/w 0x0 port indicators are off. 0x1 amber 0x2 green 0x3 undefined 19:16 ptc3_0 port test control any value other than 0000 indicates that the port is operating in test mode. the force_enable_fs and force enable_ls are extensions to the test mode support specified in the ehci specification. writing the ptc field to any of the force_enable_{hs/fs/ls} values will force the port into the connected and enabled state at the selected speed. writing the ptc field back to test_mode_disable will allow the port st ate machines to progress normally from that point. values 0x8 to 0xf are reserved. 0000 r/w 0x0 test_mode_disable 0x1 j_state 0x2 k_state 0x3 se0 (host)/nak (device) 0x4 packet 0x5 force_enable_hs 0x6 force_enable_fs 0x7 force_enable_ls 20 wkcn wake on connect enable (wkcnnt_e) this bit is 0 if pp (port power bit) is 0 0r/w 0 disables the port to wake up on device connects. 1 writing this bit to a one enables the port to be sensitive to device connects as wake-up events. 21 wkdc wake on disconnect enable (wkdscnnt_e) this bit is 0 if pp (port power bit) is 0. 0r/w 0 disables the port to wake up on device disconnects. 1 writing this bit to a one enables the port to be sensitive to device disconnects as wake-up events. table 327. port status and control register in host mode (portsc1_h - address 0x4000 6184) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 386 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.16 otg status and co ntrol register (otgsc) the otg register has four sections: ? otg interrupt enables (r/w) ? otg interrupt status (r/wc) ? otg status inputs (ro) ? otg controls (r/w) 22 wkoc wake on over-current enable (wkoc_e) 0 r/w 0 disables the port to wake up on over-current events. 1 writing a one to this bit enabled the port to be sensitive to over-current conditions as wake-up events. 23 phcd phy low power suspe nd - clock disable (plpscd) in host mode, the phy can be put into low power suspend ? clock disable when the downstream device has been put into suspend mode or when no downstream device is connected. low power suspend is completely under the control of software. 0r/w 0 writing a 0 enables the phy clock. reading a 0 indicates the status of the phy clock (enabled). 1 writing a 1 disables the phy clock. reading a 1 indicates the status of the phy clock (disabled). 24 pfsc port force full speed connect 0 r/w 0 port connects at any speed. 1 writing this bit to a 1 will force the port to only connect at full speed. it disables the chirp sequence that allows the port to identify itself as high speed. this is useful for testing fs configurations with a hs host, hub or device. 25 - - reserved 27:26 pspd port speed this register field indicates the speed at which the port is operating. for hs mode operation in the host controller and hs/fs operation in the device controller the port routing steers data to the protocol engine. for fs and ls mode operation in the host controller, the port routing steers data to the protocol engine w/ embedded transaction translator. 0ro 0x0 full-speed 0x1 low-speed 0x2 high-speed 31:28 - reserved - - table 327. port status and control register in host mode (portsc1_h - address 0x4000 6184) bit description bit symbol value description reset value access table 328. port states as described by the pe and susp bits in the portsc1 register pe bit susp bit port state 0 0 or 1 disabled 1 0 enabled 1 1 suspend www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 387 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller the status inputs are debounced using a 1 m sec time constant. values on the status inputs that do not persi st for more than 1 msec will not ca use an update of th e status input register or cause an otg interrupt. table 329. otg status and control register (o tgsc - address 0x4000 61a4) bit description bit symbol value description reset value access 0 vd vbus_discharge setting this bit to 1 causes vbus to discharge through a resistor. 0r/w 1 vc vbus_charge setting this bit to 1 causes the vbus line to be charged. this is used for vbus pulsing during srp. 0r/w 2 haar hardware assist auto_reset 0 r/w 0 disabled 1 enable automatic reset after connect on host port. 3ot otg termination this bit must be set to 1 when the otg controller is in device mode. this controls the pull-down on usb_dm. 0r/w 4 dp data pulsing setting this bit to 1 causes the pull-up on usb_dp to be asserted for data pulsing during srp. 0r/w 5 idpu id pull-up. this bit provides control over the pull-up resistor. 1r/w 0 pull-up off. the id bit will not be sampled. 1 pull-up on. 6 hadp hardware assist data pulse write a 1 to start data pulse sequence. 0r/w 7 haba hardware assist b-disconnect to a-connect 0 r/w 0 disabled. 1 enable automatic b-disconnect to a-connect sequence. 8 id usb id 0 ro 0 a-device 1 b-device 9 avv a-vbus valid reading 1 indicates that vbus is above the a-vbus valid threshold. 0ro 10 asv a-session valid reading 1 indicates that vbus is above the a-session valid threshold. 0ro 11 bsv b-session valid reading 1 indicates that vbus is above the b-session valid threshold. 0ro 12 bse b-session end reading 1 indicates that vbus is below the b-session end threshold. 0ro 13 ms1t 1 millisecond timer toggle this bit toggles once per millisecond. 0ro 14 dps data bus pulsing status reading a 1 indicates that data bus pulsing is detected on the port. 0ro 15 - - reserved 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 388 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 16 idis usb id interrupt status this bit is set when a change on the id input has been detected. software must write a 1 to this bit to clear it. 0r/wc 17 avvis a-vbus valid interrupt status this bit is set then vbus has either risen above or fallen below the a-vbus valid threshold (4 .4 v on an a-device). software must write a 1 to this bit to clear it. 0r/wc 18 asvis a-session valid interrupt status this bit is set then vbus has either risen above or fallen below the a-session valid threshold (0.8 v). software must write a 1 to this bit to clear it. 0r/wc 19 bsvis b-session valid interrupt status this bit is set then vbus has either risen above or fallen below the b-session valid threshold (0.8 v). software must write a 1 to this bit to clear it. 0r/wc 20 bseis b-session end interrupt status this bit is set then vbus has fallen below the b-session end threshold. software must write a 1 to this bit to clear it. 0r/wc 21 ms1s 1 millisecond timer interrupt status this bit is set once every millisecond. software must write a 1 to this bit to clear it. 0r/wc 22 dpis data pulse interrupt status this bit is set when data bus pulsing occurs on dp or dm. data bus pulsing is only detected when the cm bit in usbmode = host (11) and the portpower bit in portsc = off (0). software must write a 1 to this bit to clear it. 0r/wc 23 - - reserved 0 24 idie usb id interrupt enable setting this bit enables the interrupt. writing a 0 disables the interrupt. 0r/w 25 avvie a-vbus valid interrupt enable setting this bit enables the a-vbus valid interrupt. writing a 0 disables the interrupt. 0r/w 26 asvie a-session valid interrupt enable setting this bit enables the a-session valid interrupt. writing a 0 disables the interrupt 0r/w 27 bsvie b-session valid interrupt enable setting this bit enables the b-session valid interrupt. writing a 0 disables the interrupt. 0r/w 28 bseie b-session end interrupt enable setting this bit enables the b-session end interrupt. writing a 0 disables the interrupt. 0r/w table 329. otg status and control register (o tgsc - address 0x4000 61a4) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 389 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.17 usb mode register (usbmode) the usbmode register sets the usb mode for the otg controller. the possible modes are device, host, and idle mode for otg operations. 20.6.17.1 device mode 29 ms1e 1 millisecond timer interrupt enable setting this bit enables the 1 millisecond timer interrupt. writing a 0 disables the interrupt. 0r/w 30 dpie data pulse interrupt enable setting this bit enables the data pulse interrupt. writing a 0 disables the interrupt 0r/w 31 - - reserved 0 - table 329. otg status and control register (o tgsc - address 0x4000 61a4) bit description ?continued bit symbol value description reset value access table 330. usb mode register in device mode (usbmode_d - address 0x4000 61a8) bit description bit symbol value description reset value access 1:0 cm1_0 controller mode the controller defaults to an idle state and needs to be initialized to the desired operating mode after reset. this register can only be written once after reset. if it is necessary to sw itch modes, softwa re must reset the controller by writing to the reset bit in the usbcmd register before reprogramming this register. 00 r/ wo 0x0 idle 0x1 reserved 0x2 device controller 0x3 host controller 2 es endian select this bit can change the byte ordering of the transfer buffers to match the host microprocessor bus architecture. the bit fields in the microprocessor interface and the dma data structures (including the setup buffer within the device qh) are unaffected by the value of this bit, because they are based upon 32-bit words. 0r/w 0 little endian: first byte referenced in least significant byte of 32-bit word. 1 big endian: first byte referenced in most significant byte of 32-bit word. 3 slom setup lockout mode in device mode, this bit controls behavior of the setup lock mechanism. see section 20.10.8 . 0r/w 0 setup lockouts on 1 setup lockouts off (dcd requires the use of setup buffer tripwire in usbcmd) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 390 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.17.2 host mode 4 sdis stream disable mode remark: the use of this feature substantially limits the overall usb performance that can be achieved. 0r/w 0 not disabled 1 disabled. setting this bit to one disables double priming on both rx and tx for low bandwidth systems. this mode ensures that when the rx and tx buffers are sufficient to contain an entire packet that the standard double buffering scheme is disabled to prevent overruns/underruns in bandwidth limited systems. note: in high speed mode, all packets received will be responded to with a nyet handshake when stream disable is active. 5 - not used in device mode. 0 - 31:6 - - reserved table 330. usb mode register in device mode (usbmode_d - address 0x4000 61a8) bit description ?continued bit symbol value description reset value access table 331. usb mode register in host mode (u sbmode_h - address 0x4000 61a8) bit description bit symbol value description reset value access 1:0 cm controller mode the controller defaults to an idle state and needs to be initialized to the desired operating mode after reset. this register can only be written once after reset. if it is necessary to sw itch modes, softwa re must reset the controller by writing to the reset bit in the usbcmd register before reprogramming this register. 00 r/ wo 0x0 idle 0x1 reserved 0x2 device controller 0x3 host controller 2 es endian select this bit can change the byte ordering of the transfer buffers. the bit fields in the microprocessor interface and the dma data structures (including the setup buffer within the device qh) are unaffected by the value of this bit, because they are based upon 32-bit words. 0r/w 0 little endian: first byte referenced in least significant byte of 32-bit word. 1 big endian: first byte referenced in most significant byte of 32-bit word. 3 - not used in host mode 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 391 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.18 usb endpoint setup st atus register (endpsetupstat) 20.6.19 usb endpoint prim e register (endptprime) for each endpoint, software should write a one to the corresponding bit whenever posting a new transfer descriptor to an endpoint. hardwa re will automatically us e this bit to begin parsing for a new transfer descriptor from the queue head and prepare a receive buffer. hardware will clear this bit when the associated endpoint(s) is (are) successfully primed. remark: these bits will be momentarily set by hardware during hardware endpoint re-priming operations when a dtd is retired and the dqh is updated. 4 sdis stream disable mode remark: the use of this feature substantially limits the overall usb performance that can be achieved. 0r/w 0 not disabled 1 disabled. setting to a ?1? ensures that overruns/underruns of the latency fifo are eliminated for low bandwidth systems where the rx and tx buffers are sufficient to contain the entire packet. enabling stream disable also has the effect of ensuring the the tx latency is filled to capacity before the packet is launched onto the usb. note: time duration to pre-fill the fi fo becomes significant when stream disable is active. see txfilltuning to characterize the adjustments needed for the scheduler when using this feature. 5 vbps vbus power select 0 r/wo 0 vbus_pwr_select is set low. 1 vbus_pwr_select is set high 31:6 - - reserved - - table 331. usb mode register in host mode (u sbmode_h - address 0x4000 61a8) bit description ?continued bit symbol value description reset value access table 332. usb endpoint setup status register (endp tsetupstat - address 0x4000 61ac) bit description bit symbol description reset value access 5:0 endptset upstat setup endpoint status for logical endpoints 0 to 5. for every setup transaction that is received, a corresponding bit in this register is set to one. software must clear or acknowledge the setup transfer by writing a one to a respective bit after it has read the setup data from queue head. the response to a setup packet as in the or der of operations and total response time is crucial to limit bus time outs while the setup lockout mechanism is engaged. 0r/wc 31:6 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 392 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.20 usb endpoint flus h register (endptflush) writing a one to a bit(s) in this register wi ll cause the associated endpoint(s) to clear any primed buffers. if a packet is in progress for one of the associated endpoints, then that transfer will continue until completion. hardware will clear this register after the endpoint flush operation is successful. table 333. usb endpoint prime register (endptprime - address 0x4000 61b0) bit description bit symbol description reset value access 5:0 perb prime endpoint receive buffer for physical out endpoints 5 to 0. for each out endpoint, a corresponding bit is set to 1 by software to request a buffer be prepared for a receive operation for when a usb host initiates a usb out transaction. software should write a one to the corresponding bit whenever posting a new transfer descriptor to an endpoint. hardware will automatically use this bit to begin parsing for a new transfer descriptor from the queue head and prepare a receive buffer. hardware will clear this bit when the associated endpoint(s) is (are) successfully primed. perb0 = endpoint 0 ... perb5 = endpoint 5 0r/ws 15:6 - reserved - - 21:16 petb prime endpoint transmit buffer for physical in endpoints 5 to 0. for each in endpoint a corresponding bit is set to one by software to request a buffer be prepared for a transmit operation in order to respond to a usb in/interrupt transaction. software shoul d write a one to the corresponding bit when posting a new transfer descriptor to an endpoint. hardware will automatically use this bit to begin parsing for a new transfer descriptor from the queue head and prepare a transmit buffer. hardware will clear this bit when the associated endpoint(s) is (are) successfully primed. petb0 = endpoint 0 ... petb5 = endpoint 5 0r/ws 31:22 - reserved - - table 334. usb endpoint flush register (endptf lush - address 0x4000 61b4) bit description bit symbol description reset value access 5:0 ferb flush endpoint receive buffer for physical out endpoints 5 to 0. writing a one to a bit(s) will clear any primed buffers. ferb0 = endpoint 0 ... ferb5 = endpoint 5 0r/ws www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 393 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.6.21 usb endpoint stat us register (endptstat) one bit for each endpoint indicates status of th e respective endpoint buffer. this bit is set by hardware as a response to receiving a command from a corresponding bit in the endptprime register. there will always be a delay between sett ing a bit in the endptprime register and endpoint indicating ready. this delay time varies based upon the current usb traffic and the number of bi ts set in the endptprime register. buffer ready is cleared by usb reset, by the u sb dma system, or through the endptflush register. remark: these bits will be momentarily cleared by hardware during hardware endpoint re-priming operations when a dtd is retired and the dqh is updated. 20.6.22 usb endpoint comple te register (endptcomplete) each bit in this register indicates that a received/transmit event occurred and software should read the corresponding endpoint queue to determine the transfer status. if the corresponding ioc bit is set in the transfer descriptor, then this bit will be set simultaneously with the usbint. 15:6 - reserved - - 21:16 fetb flush endpoint transmit buffer for physical in endpoints 5 to 0. writing a one to a bit(s) will clear any primed buffers. fetb0 = endpoint 0 ... fetb5 = endpoint 5 0r/ws 31:22 - reserved - - table 334. usb endpoint flush register (endptf lush - address 0x4000 61b4) bit description bit symbol description reset value access table 335. usb endpoint status register (e ndptstat - address 0x4000 61b8) bit description bit symbol description reset value access 5:0 erbr endpoint receive buffer ready for physical out endpoints 5 to 0. this bit is set to 1 by hardware as a response to receiving a command from a corresponding bit in the endptprime register. erbr0 = endpoint 0 ... erbr5 = endpoint 5 0ro 15:6 - reserved - - 21:16 etbr endpoint transmit buffer ready for physical in endpoints 3 to 0. this bit is set to 1 by hardware as a response to receiving a command from a corresponding bit in the endptprime register. etbr0 = endpoint 0 ... etbr5 = endpoint 5 0ro 31:22 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 394 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller writing a one will clear the correspond ing bit in this register. 20.6.23 usb endpoint 0 control register (endptctrl0) this register initializes endpoint 0 for contro l transfer. endpoint 0 is always a control endpoint. table 336. usb endpoint complete register (endptcomplete - address 0x4000 61bc) bit description bit symbol description reset value access 5:0 erce endpoint receive complete event for physical out endpoints 5 to 0. this bit is set to 1 by hardware when receive event (out/setup) occurred. erce0 = endpoint 0 ... erce5 = endpoint 5 0r/wc 15:6 - reserved - - 21:16 etce endpoint transmit complete event for physical in endpoints 5 to 0. this bit is set to 1 by hardware w hen a transmit event (in/interrupt) occurred. etce0 = endpoint 0 ... etce5 = endpoint 5 0r/wc 31:21 - reserved - - table 337. usb endpoint 0 control register (endptctrl0 - address 0x4000 61c0) bit description bit symbol value description reset value access 0 rxs rx endpoint stall 0 r/w 0 endpoint ok. 1 endpoint stalled software can write a one to this bit to force the endpoint to return a stall handshake to the host. it will continue returning stall until the bit is cleared by software, or it will automatically be cleared upon receipt of a new setup request. after receiving a setup request, this bit will continue to be cleared by hardware until the associated endsetupstat bit is cleared. [1] 1 - - reserved 3:2 rxt1_0 endpoint type endpoint 0 is always a control endpoint. 00 r/w 6:4 - - reserved - - 7 rxe rx endpoint enable endpoint enabled. control endpoint 0 is always enabled. this bit is always 1. 1ro 15:8 - - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 395 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller [1] there is a slight delay (50 clocks max) between the enptsetu pstat being cleared and hardware continuing to clear this bit. i n most systems it is unlikely that the dcd software will observe this delay. however, should the dcd notice that the stall bit is not set after writing a one to it, software should continually write this st all bit until it is set or until a new setup has been received by checking the associated endptsetupstat bit. 20.6.24 endpoint 1 to 5 control registers each endpoint that is not a control endpoint has its own register to set the endpoint type and enable or disable the endpoint. remark: the reset value for all endpoint types is the control endpoint. if one endpoint direction is enabled and the paired endpoint of opposite direction is disabled, then the endpoint type of the unused direction must be changed from the cont rol type to any other type (e.g. bulk). leaving an unconfigured en dpoint control will cause undefined behavior for the data pid tracking on the active endpoint. 16 txs tx endpoint stall r/w 0 endpoint ok. 1 endpoint stalled software can write a one to this bit to force the endpoint to return a stall handshake to the host. it will continue returning stall until the bit is cleared by software, or it will automatically be cleared upon receipt of a new setup request. after receiving a setup request, this bit will continue to be cleared by hardware until the associated endsetupstat bit is cleared. [1] 17 - - reserved 19:18 txt1_0 endpoint type endpoint 0 is always a control endpoint. 00 ro 22:20 - - reserved 23 txe tx endpoint enable endpoint enabled. control endpoint 0 is always enabled. this bit is always 1. 1ro 31:24 - - reserved table 337. usb endpoint 0 control register (endptctrl0 - address 0x4000 61c0) bit description ?continued bit symbol value description reset value access table 338. usb endpoint 1 to 5 control registers (endptctrl - address 0x4000 61c4 (endptctrl1) to 0x4000 61d4 (endptctrl5)) bit description bit symbol value description reset value access 0 rxs rx endpoint stall 0 r/w 0 endpoint ok. this bit will be cleared automatically upon receipt of a setup request if this endpoint is configured as a control endpoint and this bit will continue to be cleared by hardware until the associated endptsetupstat bit is cleared. 1 endpoint stalled software can write a one to this bit to force the endpoint to return a stall handshake to the host. it will continue returning stall until the bit is cleared by software, or it will automatically be cleared upon receipt of a new setup request. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 396 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 1- reserved 0 r/w 3:2 rxt endpoint type 00 r/w 0x0 control 0x1 isochronous 0x2 bulk 0x3 reserved 4- - reserved 5 rxi rx data toggle inhibit this bit is only used for test and should always be written as zero. writing a one to this bit will cause this endpoint to ignore the data toggle sequence and always accept data packets regardless of their data pid. 0r/w 0 disabled 1 enabled 6 rxr rx data toggle reset write 1 to reset the pid sequence. whenever a configuration event is received for this endpoint, software must write a one to this bi t in order to synchronize the data pids between the host and device. 0ws 7 rxe rx endpoint enable remark: an endpoint should be enabled only after it has been configured. 0r/w 0 endpoint disabled. 1 endpoint enabled. 15:8 - - reserved 16 txs tx endpoint stall 0 r/w 0 endpoint ok. this bit will be cleared automatically upon receipt of a setup request if this endpoint is configured as a control endpoint, and this bit will continue to be cleared by hardware until the associated endptsetupstat bit is cleared. 1 endpoint stalled software can write a one to this bit to force the endpoint to return a stall handshake to the host. it will continue returning stall until the bit is cleared by software, or it will automatically be cleared upon receipt of a new setup request. 17 - - reserved 0 - 19:18 txt1_0 tx endpoint type 00 r/w 0x0 control 0x1 isochronous 0x2 bulk 0x3 interrupt 20 - - reserved table 338. usb endpoint 1 to 5 control registers (endptctrl - address 0x4000 61c4 (endptctrl1) to 0x4000 61d4 (endptctrl5)) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 397 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.7 functional description 20.7.1 otg core the otg core forms the main digita l part of the usb-otg. see the usb ehci specification for details about this core. 20.7.2 host data structures see chapter 4 of enhanced host controller inte rface specification for universal serial bus 1.0. 20.7.3 host operational model see chapter 3 of enhanced host controller inte rface specification for universal serial bus 1.0 . 20.7.4 atx_rgen module there are a number of requirements for the reset signal towards the atx transceiver, these are as follows: ? it requires the clocks to be running for a reset to occur correctly. ? it must see a rising edge of reset to correctly reset the clock generation module. ? the reset must be a minimum of 133 ns (4 ? 30 mhz clock cycles) in duration to reset all logic correctly. 21 txi tx data toggle inhibit this bit is only used for test and should always be written as zero. writing a one to this bit will cause this endpoint to ignore the data toggle sequence and always accept data packets regardless of their data pid. 0r/w 0 enabled 1 disabled 22 txr tx data toggle reset write 1 to reset the pid sequence. whenever a configuration event is received for this endpoint, software must write a one to this bi t in order to synchronize the data pid?s between the host and device. 1ws 23 txe tx endpoint enable remark: an endpoint should be enabled only after it has been configured 0r/w 0 endpoint disabled. 1 endpoint enabled. 31:24 - - reserved 0 table 338. usb endpoint 1 to 5 control registers (endptctrl - address 0x4000 61c4 (endptctrl1) to 0x4000 61d4 (endptctrl5)) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 398 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller the atx_rgen module generates a reset signal towards the atx fulfilling above 3 requirements, no matter how the ahb reset looks like. 20.7.5 atx transceiver the usb-otg has a usb transceiver with ut mi+ interface. it contains the required transceiver otg function ality; this includes: ? vbus sensing for producing the sess ion-valid and vbus-valid signals. ? sampling of the usb_id input for detection of a-device or b-device connection. ? charging and discharging of vbus for starting and ending a session as b-device. 20.7.6 modes of operation in general, the usb-otg can be operating either in host mode or in device mode. software must put the core in the appropri ate mode by setting the usbmode.cm field (?11? for host mode, ?10? for device mode). the usbmode.cm field can also be equal to ?0 0?, which means that th e core is in idle mode (neither host nor device mode). this will happen after the following: ? a hardware reset. ? a software reset via the usbcmd.rst bit; e.g. when switching from host mode to device mode as part of the hnp protocol (or vice versa), software must issue a software reset by which the co re will be to the idle state; this will happen in a time frame dependent on the software. 20.7.7 sof/vf indicator the usb-otg generates a sof/vf indicator si gnal, which can be used by user specific external logic. in fs mode, the sof/vf indicator signal has a frequency equal to the frame frequency, which is about 1 khz. the signal is high for half of the frame period and low for the other half of the frame period. the positive edge is aligned with the start of a frame (= sof). in hs mode, the sof/vf indicator signal has a frequency equal to the virtual frame frequency. the signal is high for half of the virtual frame period and low for the other half of the virtual frame period. the positive edge is aligned with the start of a virtual frame (= vf). the length of the virtual frame is defined as: vf = microframe ? 2 binterval ; binterval is specified in the 4-bit program mable binterval.bint register field. the minimum value of binterval is 0, the maximum value is 15. in suspend mode the sof/vf indicator signal is turned off (= remains low). 20.7.8 hardware assist the hardware assist provides automated response and sequencing that may not be possible in software if there are significant interrupt latency response times. the use of this additional circuitry is optional and c an be used to assist the following three state transitions by setting the appropriate bits in the otgsc register: www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 399 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller ? auto reset (set bit haar). ? data pulse (set bit hadp). ? b-disconnect to a-co nnect (set bit haba). 20.7.8.1 auto reset when the haar in the otgsc register is se t to one, the host will automatically start a reset after a connect event. this shortcuts the normal process where software is notified of the connect event and starts the reset. software will still receive notification of the connect event (ccs bit in the portsc register ) but should not write the reset bit in the usbcmd register when the haar is set. soft ware will be notified agai n after the reset is complete via the enable change bit in the po rtsc register which causes a port change interrupt. this assist will ensure the otg paramete r tb_acon_bse0_max = 1 ms is met (see otg specification for an explanation of the otg timing requirements). 20.7.8.2 data pulse writing a one to hadp in the otgsc register will start a data pulse of approximately 7 ms in duration and then automatically cease the data pulsing. during the data pulse, the dp bit will be set and then cleared. this auto mation relieves softwa re from accurately controlling the data-pulse durati on. during the data pulse, the hcd can poll to see that the hadp and dp bit have returned low to recognize the completion, or the hcd can simply launch the data pulse and wait to see if a vbus valid interrupt occurs when the a-side supplies bus power. this assist will ensure data pulsing meets the otg requirement of > 5 ms and < 10 ms. 20.7.8.3 b-disconnect to a-connect (transition to the a-peripheral state) during hnp, the b-disconnect occurs from the otg a_suspend state, and within 3 ms, the a-device must enable the pull-up on the dp leg in the a-peripheral state. for the hardware assist to begin the following conditions must be met: ? haba is set. ? host controller is in suspend mode. ? device is disconnecting. the hardware assist consists of the following steps: 1. hardware resets the ot g controller (writes 1 to the rst bit in usbcmd). 2. hardware selects the device mode (write s 10 to bits cm[1:0] in usbmode). 3. hardware sets the rs bit in usbcmd and enables the necessary interrupts: ? usb reset enable (ure) - enables interrupt on usb bus reset to device. ? sleep enable (sle) - enables interrupt on device suspend. ? port change detect enable (pce) - en ables interrupt on device connect. when software has enabled this hardware assis t, it must not interfere during the transition and should not write any register in the otg core until it gets an interrupt from the device controller signifying that a reset interrupt has occurred or until it has verified that the core has entered device mode. hcd/dcd must not ac tivate the core soft reset at any time www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 400 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller since this action is performed by hardware. during the transition, the software may see an interrupt from the disconnect and/or other spurious interrupts (i.e. sof/etc.) that may or may not cascade and my be cleared by the soft reset depending on the software response time. after the core has entered device mode with help of the hardware assist, the dcd must ensure that the endptlistaddr is programmed properly before the host sends a setup packet. since the end of the reset duration , which may be initia ted quickly (a few microseconds) after connect, will require at a minimum 50 ms, this is the time for which the dcd must be ready to acce pt setup packets after having received notification that the reset has been detected or simply that the otg is in device mode which ever occurs first. if the a-peripheral fails to see a reset afte r the controller enters device mode and engages the d+-pull-up, the device co ntroller interrupts the dcd signifying that a suspend has occurred. this assist will ensure the pa rameter ta_bdis_acon_max = 3ms is met. 20.8 deviations from ehci standard for the purposes of a dual -role host/device controller with support for on-the-go applications, it is necessary to deviate from the ehci specification. device operation and on-the-go operation is not specified in the ehci and thus the implementation supported in this core is specific to the lpc18xx. the host mode operation of the core is near ehci compatible with few minor differenc es documented in this section. the particulars of the deviations occur in the areas summarized here: ? embedded transaction translator ? allows di rect attachment of fs and ls devices in host mode without the need for a companion controller. ? device operation - in host mode the de vice operational registers are generally disabled and thus device mode is mostly transparent when in host mode. however, there are a couple exceptions documented in the following sections. ? on-the-go operation - this design includes an on-the-go controller. 20.8.1 embedded transacti on translator function the usb-hs otg controller supports direct ly connected full and low speed devices without requiring a comp anion controller by in cluding the capabilities of a usb 2.0 high speed hub transaction translator. although there is no separate transaction translator block in the system, the transaction translator function normally associated with a high speed hub has been implemented within th e dma and protocol engine blocks. the embedded transaction translator function is an extension to ehci interface but makes use of the standard data structures and operational models that exist in the ehci specification to support full and low speed devices. 20.8.1.1 capability registers the following items have been ad ded to the capability regist ers to support the embedded transaction translator function: ? n_tt bits added to hcsparams ? host control structural parameters (see table 302 ). ? n_ptt added to hcsparams ? host control structural parameters (see table 302 ). www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 401 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.8.1.2 operational registers the following items have been added to the operational registers to support the embedded tt: ? new register ttctrl (see section 20.6.9 ). ? two-bit port speed (pspd) bits added to the portsc1 register (see section 20.6.15 ). 20.8.1.3 discovery in a standard ehci controller design, the ehci host controller driver detects a full speed (fs) or low speed (ls) device by noting if th e port enable bit is set after the port reset operation. the port enable will only be set in a standard e hci controller implementation after the port reset operation and when th e host and device negotiate a high-speed connection (i.e. chirp completes successfully). since this controller has an embedded transaction translator, the port enable will always be set after the port reset operation regardless of the result of the host device chirp result and the resulting po rt speed will be indicated by the pspd field in portsc1 (see section 20.6.15 ). 20.8.1.4 data structures the same data structures used for fs/ls tran sactions though a hs hub are also used for transactions through the root hub with sm em bedded transaction translator. here it is demonstrated how the hub address and endpoint speed fields should be set for directly attached fs/ls devices and hubs: 1. qh (for direct attach fs/ls) ? async. (b ulk/control endpoints) periodic (interrupt) ? hub address = ttha (default ttha = 0) ? transactions to direct attached device/hub: qh.eps = port speed ? transactions to a device do wnstream from direct at tached fs hub: qh.eps = downstream device speed table 339. handling of directly connected full-speed and low-speed devices standard ehci model ehci with embedded transaction translator after the port enable bit is set following a connection and reset sequence, the device/hub is assumed to be hs. after the port enable bit is set following a connection and reset sequence, the device/hub speed is noted from portsc1. fs and ls devices are assumed to be downstream from a hs hub thus, all port-level control is performed through the hub class to the nearest hub. fs and ls device can be either downstream from a hs hub or directly attached. when the fs/ls device is downstream from a hs hub, then port-level control is done using the hub class through the nearest hub. when a fs/ls device is directly attached, then port-level control is accomplished using portsc1. fs and ls devices are assumed to be downstream from a hs hub with hubaddr=x, where hubaddr > 0 and hubaddr is the address of the hub where the bus transitions from hs to fs/ls (i.e. split target hub). fs and ls device can be either downstream from a hs hub with hubaddr = x [hubaddr > 0] or directly attached, where hubaddr = ttha (ttha is programmable and defaults to 0) and hubaddr is the address of the root hub where the bus transitions from hs to fs/ls (i.e. split target hub is the root hub). www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 402 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller remark: when qh.eps = 01 (ls) and portsc x.pspd = 00 (fs), a ls-pre-pid will be sent before the tr ansmitting ls traffic. maximum packet size must be less than or equal 64 or undefined behavior may result. 2. sitd (for direct attach fs) ? periodic (iso endpoint) all fs iso transactions: hub address = (default ttha = 0) sitd.eps = 00 (full speed) maximum packet size must less than or equal to 1023 or undefined behavior may result. 20.8.1.5 operational model the operational models are well defined for the behavior of the transaction translator (see usb 2.0 specification) and for the ehci controller moving pa ckets between system memory and a usb-hs hub. since the embedded transaction translator exists within the host controller there is no physical bus betw een ehci host controller driver and the usb fs/ls bus. these sections will briefly discu ss the operational model for how the ehci and transaction translator operational models are combined without the physical bus between. the following sections assume the reader is familiar with both the ehci and usb 2.0 transaction translator operational models. 20.8.1.5.1 micro-frame pipeline the ehci operational model uses the concept of h-frames and b-frames to describe the pipeline between the host (h) and the bus (b). the embedded transaction translator shall use the same pipeline algorithms specified in the usb 2.0 specification for a hub-based transaction translator. it is important to note that when programming the s-mask and c-masks in the ehci data structures to schedule periodic transfers fo r the embedded transaction translator, the ehci host controller driver must follow the sa me rules specified in ehci for programming the s-mask and c-mask for downstream hub-based transaction translators. once periodic transfers are exhaus ted, any stored asynchronous transfer will be moved. asynchronous transfers are opportunistic in that they shall execute whenever possible and their operation is not tied to h-frame and b-frame boundaries with the exception that an asynchronous transfer can not babble through the sof (start of b-frame 0.) 20.8.1.6 split state machines the start and complete split operational model differs from ehci slightly because there is no bus medium between the ehci controller and the embedded transaction translator. where a start or complete-split operation would occur by requesting the split to the hs hub, the start/complete split operation is si mple an internal operation to the embedded transaction translator. the following table summarizes the conditions where handshakes are emulated from internal state instead of actual handshakes to hs split bus traffic. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 403 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.8.1.7 asynchronous transaction scheduling and buffer management the following usb 2.0 specification items are implemented in the embedded transaction translator: 1. usb 2.0 specification, section 11.17.3 : sequencing is provided & a packet length estimator ensures no full-speed/low-sp eed packet babbles into sof time. 2. usb 2.0 specification, section 11.17.4 : transaction tracking for 2 data pipes. 3. usb 2.0 specification, section 11.17.5 : clear_tt_buffer capab ility provided though the use of the ttctrl register. 20.8.1.8 periodic transaction scheduling and buffer management the following usb 2.0 specification items are implemented in the embedded transaction translator: 1. usb 2.0 specs, section 11.18.6.[1-2] : ? abort of pending start-splits: eof (and not started in micro-frames 6) idle for more than 4 micro-frames ? abort of pending complete-splits: eof idle for more than 4 micro-frames 2. usb 2.0 specs, section 11.18.6.[7-8] : ? transaction tracking for up to 16 data pipes: some applications may not require transaction tracking up to a maximum of 16 periodic data pipes. the option to limit the tracking to only 4 periodic data pipes exists in the by changing the configuration constant vusb_hs_tt_periodic_contexts to 4. the result is a significant gate count savings to the core give n the limitations implied. remark: limiting the number of tracking pipe s in the embedded tt to four (4) will impose the restriction that no mo re than 4 periodic transactions (interrupt/isochronous) can be sche duled through t he embedded tt per frame. the number 16 was chosen in the u sb specification because it is sufficient to ensure that the high-speed to full- speed periodic pipeline can remain full. table 340. split state machine properties condition emulate tt response start-split all asynchronous buffers full. nak all periodic buffers full. err success for start of async. transaction. ack start periodic transaction. no handshake (ok) complete-split failed to find transaction in queue. bus time out transaction in queue is busy. nyet transaction in queue is complete. [actual handshake from ls/fs device] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 404 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller keeping the pipeline full puts no constraint on the number of periodic transactions that can be scheduled in a frame and the only limit becomes the flight time of the packets on the bus. ? complete-split tran saction searching: there is no data schedule mechanism for these transactions other than micro-frame pipeline. the embedded tt assumes the number of packets scheduled in a frame does not exceed the frame duration (1 ms) or else undefined behavior may result. 20.8.1.9 multiple transaction translators the maximum number of embedded transaction translators that is currently supported is one as indicated by the n_tt field in the hcsparams ? host control structural parameters register. 20.8.2 device operation the co-existence of a device operational co ntroller within the host controller has little effect on ehci compatibility for host oper ation except as noted in this section. 20.8.2.1 usbmode register given that the dual-role cont roller is initialized in neit her host nor device mode, the usbmode register must be programmed for host operation before the ehci host controller driver can begin ehci host operations. 20.8.2.2 non-zero fields the register file some of the reserved fields and reserved addresses in the capability registers and operational register have use in device mode, the following must be adhered to: ? write operations to all ehci reserved fields (some of which are device fields) with the operation registers should always be written to zero. this is an ehci requirement of the device controller driver that must be adhered to. ? read operations by the host controller must properly mask ehci reserved fields (some of which are device fields ) because fields that are used exclusive for device are undefined in host mode. 20.8.2.3 sof interrupt this sof interrupt used for device mode is shared as a free running 125us interrupt for host mode. ehci does not specify this inte rrupt but it has been added for convenience and as a potential software time base. see usbsts ( section 20.6.4 ) and usbintr ( section 20.6.5 ) registers. 20.8.3 miscellaneous variations from ehci 20.8.3.1 discovery 20.8.3.1.1 port reset the port connect methods specified by ehci require setting the port reset bit in the portscx register for a duration of 10 ms. du e to the complexity required to support the attachment of devices that are not high sp eed there are counter already present in the www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 405 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller design that can count the 10ms reset pulse to alleviate the requirement of the software to measure this duration. therefore, the basi c connection is then summarized as the following: ? [port change interrupt] port connect change oc curs to notify the host controller driver that a device has attached. ? software shall write a ?1? to the reset the device. ? software shall write a ?0? to the reset the device after 10 ms. this step, which is necessary in a standa rd ehci design, may be omitted with this implementation. should the ehci host controller driver attempt to write a ?0? to the reset bit while a reset is in progress the writ e will simple be igno red and the reset will continue until completion. ? [port change interrupt] port enable change occurs to notify the host controller that the device in now operational and at this point the port speed has been determined. 20.8.3.1.2 port speed detection after the port change interrupt indicates that a port is enabled, the ehci stack should determine the port speed. unlike the ehci implem entation which will re-assign the port owner for any device that does not connect at high-speed, this host controller supports direct attach of non high-speed devices. therefore, the following differences are important regarding port speed detection: ? port owner is read-only and always reads 0. ? a 2-bit port speed indicator has been added to portsc to provide the current operating speed of the port to the host controller driver. ? a 1-bit high speed indicator has been added to portsc to signify that the port is in high-speed vs. full/low speed ? this information is redundant with the 2-bit port speed indicator above. 20.9 device data structures this section defines the interface data struct ures used to communicate control, status, and data between device controller driver (dcd) software and th e device controller. the data structure definitions in this chap ter support a 32-bit memory buffer address space. remark: the software must ensure that no inte rface data structure reachable by the device controller crosses a 4k-page boundary the data structures defined in the chapter ar e (from the device controller?s perspective) a mix of read-only and read/ writable fields . the device controller must preserve the read-only fields on all data structure writes. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 406 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller device queue heads are arranged in an array in a continuous area of memory pointed to by the endpointlistaddr pointer. the even ?numbered device queue heads in the list support receive endpoints (out/setup) and the odd-numbered queue heads in the list are used for transmit endpoints (in/interrupt) . the device controlle r will index into this array based upon the endpoint number received from the usb bus. all information necessary to respond to transactions for all primed transfers is contained in this list so the device controller can readily respond to inco ming requests without having to traverse a linked list. remark: the endpoint queue head list must be aligned to a 2k boundary. 20.9.1 endpoint queue head (dqh) the device endpoint queue head (dqh) is where all transfers are managed. the dqh is a 48-byte data structure, but must be aligned on 64-byte boundaries. during priming of an endpoint, the dtd (device transf er descriptor) is copied into the overlay area of the dqh, which starts at the nexttd pointer dword and continues through the end of the buffer pointers dwords. after a transfer is complete, the dtd status dword is updated in the dtd pointed to by the currenttd pointer. while a packet is in progress, the overlay area of the dqh is used as a staging area for the dtd so that the device controller can access needed information with little minimal latency. 20.9.1.1 endpoint capabilities and characteristics this dword specifies static information a bout the endpoint, in other words, this information does not change over the lifetime of the endpoint. device controller software should not attempt to modify this information while the corresponding endpoint is enabled. fig 37. endpoint queue head organization endpoint dqh0 - out endpoint dqh0 - in endpoint dqh1 - out endpoint dqh5 - out endpoint dqh5 - in endpointlistaddr endpoint queue heads dqh endpoint transfer descriptors dtd transfer buffer transfer buffer transfer buffer transfer buffer dtd dtd dtd dtd transfer buffer pointer transfer buffer pointer transfer buffer pointer transfer buffer pointer www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 407 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller table 341. endpoint capabili ties and characteristics access bit name description ro 31:30 mult number of packets executed per transaction descriptor 00 - execute n transactions as demonstrated by the usb variable length protocol where n is computed using max_packet_length and the total_bytes field in the dtd. 01 - execute one transaction 10 - execute two transactions 11 - execute three transactions remark: non-isochronous endpoints must set mult = 00. remark: isochronous endpoints must set mult = 01, 10, or 11 as needed. ro 29 zlt zero length termination select this bit is used for non-isochronous endpoints to indicate when a zero-length packet is received to terminate transfers in case the total transfer length is ?multiple?. 0 - enable zero-length packet to terminate transfers equal to a multiple of max_packet_length (default). 1 - disable zero-length packet on transfers that are equal in length to a multiple max_packet_length. ro 28:27 - reserved ro 26:16 max_packet _length maximum packet size of the a ssociated endpoint (< 1024) ro 15 ios interrupt on setup this bit is used on control type endpoints to indicate if usbint is set in response to a setup being received. ro 14:0 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 408 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.9.1.2 transfer overlay the seven dwords in the overlay area represent a transaction working space for the device controller. the general operational mode l is that the device controller can detect whether the overlay area contains a description of an active transfer. if it does not contain an active transfer, then it will no t read the associated endpoint. after an endpoint is readied, the dtd will be copied into this queue head overlay area by the device controller. until a transfer is expi red, software must not write the queue head overlay area or the associated transfer descriptor. when the transfer is complete, the device controller will write the results back to the original transfer descriptor and advance the queue. see dtd for a description of the overlay fields. 20.9.1.3 current dtd pointer the current dtd pointer is used by the device controller to locate the transfer in progress. this word is for device contro ller (hardware) use only and should not be modified by dcd software. fig 38. endpoint queue head data structure endpoint capabilities/characteristics buffer pointer page 0 buffer pointer page 1 buffer pointer page 2 buffer pointer page 3 buffer pointer page 4 reserved set-up buffer: bytes 3:0 set-up buffer: bytes 7:4 total_bytes ioc mulo status current dtd pointer next dtd pointer curr_offs buffer pointer page 0 buffer pointer page 1 buffer pointer page 2 buffer pointer page 3 buffer pointer page 4 total_bytes ioc mulo status curr_offs frame_n device queue head (dqh) endpoint transfer descriptor (dtd) transfer overlay t next dtd pointer t 31 bit 0 offset 0x00 0x04 0x08 0x0c 0x10 0x14 0x18 0x1c 0x20 0x24 0x28 0x2c www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 409 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.9.1.4 set-up buffer the set-up buffer is dedicated storage for the 8-byte data that follows a set-up pid. remark: each endpoint has a tx and an rx dqh associated with it, and only the rx queue head is used for receiving setup data packets. 20.9.2 endpoint transfer descriptor (dtd) the dtd describes to the device controller th e location and quantity of data to be sent/received for given transfer. the dcd should not attempt to modify any field in an active dtd except the next link pointer, wh ich should only be modified as described in section 20.10.11 . table 342. current dtd pointer access bit name description r/w (hardware only) 31:5 current_td_pointer current dtd pointer this field is a pointer to the dtd that is represented in the transfer overlay area. this field will be modified by the device controller to the next dtd pointer during endpoint priming or queue advance. - 4:0 - reserved table 343. set-up buffer dword access bit name description 1 r/w 31:0 buf0 setup buffer 0 this buffer contains bytes 3 to 0 of an incoming setup buffer packet and is written by the device controller to be read by software. 2 r/w 31:0 buf1 setup buffer 1 this buffer contains bytes 7 to 4 of an incoming setup buffer packet and is written by the device controller to be read by software. table 344. next dtd pointer access bit name description ro 31:5 next_link_pointer next link pointer this field contains the physical memory address of the next dtd to be processed. the field corresponds to memory address signals [31:5], respectively. 4:1 - reserved 0 t terminate this bit indicates to the device controller when there are no more valid entries in the queue. 1 - pointer is invalid 0 - pointer is valid, i.e. pointer points to a valid transfer element descriptor. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 410 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller table 345. dtd token access bit name description - 31 - reserved r/w 30:16 total_bytes total bytes this field specifies the total number of bytes to be moved with this transfer descriptor. this field is decremented by the number of bytes actually moved during the transaction and it is decremented only when the transaction has been completed successfully. the maximum value software can write into this field is 0x5000 (5 x 4 kb) for the maximum number of bytes five page pointers can access. although it is possible to create a transfer up to 20 kb this assumes that the first offset into the first page is zero. when the offset cannot be predetermined, crossing past the fifth page can be guaranteed by limiting the total bytes to 16 kb. therefore, the maximum recommended total-bytes = 16 kb (0x4000). if total_bytes = 0 when the host controller fetches this transfer descriptor and the active bit is set in the status field of this dtd, the device controller executes a zero-length transaction and retires the dtd. remark: for in transfers, it is not a requirement that total_bytes is an even multiple of max_packet_length. if software builds such a dtd, the last transaction will always be less than max_pa cket_length. ro 15 ioc interrupt on complete this bit is used to indicate if usbint will be set when the device controller is finished with this dtd. 1 - usbint set. 0 - usbint not set. - 14:12 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 411 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.9.2.1 determining the number of packets for isochronous in endpoints the following examples show how the mult field in the dqh and the multo in the dtd are used to control the number of packets se nt in an in-transaction for an isochronous endpoint: example 1 mult = 3; max_packet_size = 8; to tal_bytes = 15; multo = 0 (default) ro 11:10 multo multiplier override (see section 20.9.2.1 for an example) this field can be used for transmit isos to override the mult field in the dqh. this field must be zero for all packet types that are not transmit-iso. 00 - execute n transactions as demonstrated by the usb variable length protocol where n is computed using max_packet_length and the total_bytes field in the dtd. 01 - execute one transaction 10 - execute two transactions 11 - execute three transactions remark: non-iso and non-tx endpoints must set multo=?00?. 9:8 - reserved r/w 7:0 status status this field is used by the device controller to communicate individual execution states back to the software. this field contains the status of the last transaction performed on this dtd. bit 7 = 1 - status: active bit 6 = 1 - status: halted bit 5 = 1 - status: buffer error bit 4 - reserved bit 3 = 1 - status: transaction error bit 2 - reserved bit 1 - reserved bit 0 - reserved table 346. dtd buffer page pointer list access bit name description ro 31:12 buff_p selects the page offset in memory for the packet buffer. non-virtual memory systems will typically set the buffer pointers to a series of incrementing integers. page 0: 11:0 curr_offs offset into the 4 kb buffer where the packet is to begin. page 1: 10:0 frame_n written by the device controller to indicate the frame number in which a packet finishes. this is typically used to correlate relative completion times of packets on an isochronous endpoint. table 345. dtd token ?continued access bit name description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 412 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller in this case three packets are sent: data2 (8 bytes), data1 (7 bytes), data0 (0 bytes). example 2 mult = 3; max_packet_size = 8; total_bytes = 15; multo = 2 in this case two packets are sent: data1 (8 bytes), data0 (7 bytes). to optimize efficiency for in transfers, so ftware should compute multo = greatest integer of (total_bytes/max_packet_size). if total_bytes = 0, then multo should be 1. 20.10 device operational model the function of the device operation is to tr ansfer a request in the memory image to and from the universal serial bus. using a set of linked list transfer descr iptors, pointed to by a queue head, the device contro ller will perform the data trans fers. the following sections explain the use of the device controller from the device controller driver (dcd) point-of-view and further describe how specific usb bus events relate to status changes in the device controller programmer's interface. 20.10.1 device controller initialization after hardware reset, the device is disabled until the run/stop bit is set to a ?1?. in the disabled state, the pull-up on the usb_dm is not active which prevents an attach event from occurring. at a minimum, it is necessar y to have the queue heads setup for endpoint zero before the device attach occurs. shortl y after the device is enabled, a usb reset will occur followed by setup packet arriving at endpoint 0. a queue head must be prepared so that the device controller can store the incoming setup packet. in order to initialize a device, the so ftware should perform the following steps: 1. set controller mode in the usbmode register to device mode. remark: transitioning from host mode to device mode requires a device controller reset before modifying usbmode. 2. allocate and initialize device queue heads in system memory (see section 20.9 ). minimum: initialize device queue heads 0 tx & 0 rx. remark: all device queue heads associated with control endpoints mu st be initialized before the control endpoint is enabled. non-control device queue heads must be initialized before the endpoint is used and not necessarily before the endpoint is enabled. 3. configure endpointlistaddr pointer (see section 20.6.8 ). 4. enable the microprocessor interrupt associated with the usb-hs core. recommended: enable all device interrupt s including: usbint, usberrint, port change detect, usb reset received, dcsuspend (see ta b l e 3 11 ). 5. set run/stop bit to run mode. after the run bit is set, a device reset w ill occur. the dcd must monitor the reset event and adjust the software state as described in the bus reset section of the following port state and control section below. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 413 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller remark: endpoint 0 is designed as a control endpoint only and does not need to be configured using endptctrl0 register. it is also not necessary to initially prime en dpoint 0 because the first packet received will always be a setup packet. the contents of th e first setup packet will require a response in accordance with usb device framework command set (see usb specification rev. 2.0 , chapter 9 ). 20.10.2 port state and control from a chip or system reset, the device controller enters the powered state. a transition from the powered state to the attach state occurs when the run/stop bit is set to a ?1?. after receiving a reset on the bus, the port will enter the defaultfs or defaulths state in accordance with the reset protocol described in appendix c.2 of the usb specification rev. 2.0 . the following state diagram depicts the state of a usb 2.0 device. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 414 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller the states powered, attach, default fs/h s, suspend fs/hs are implemented in the device controller and are communicated to the dcd using the following status bits: ? dcsuspend - see table 309 . ? usb reset received - see table 309 . ? port change detect - see table 309 . ? high-speed port - see table 326 . fig 39. device state diagram powered attach default fs/hs spend fs/hs set run/stop bit to run mode inactive state address fs/hss configured fs/hs suspend fs/hs suspend fs/hs when the host resets, the device returns to default state power interruption active state reset su address asigned device configured device deconfigured bus inactive bus inactive bus inactive bus activity bus activity bus activity software only state www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 415 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller it is the responsibility of the d cd to maintain a state variable to differentiate between the defaultfs/hs state and the address/configured states. change of state from default to address and the configured states is part of the enumeration process described in the device framework section of the usb 2.0 specification . as a result of entering the address state, the device address register (deviceaddr) must be programmed by the dcd. entry into the configured indicates that all endpoints to be used in the operation of the device have been properly initialized by programming the endptctrlx registers and initializing the associated queue heads. 20.10.3 bus reset a bus reset is used by the host to initia lize downstream devices. when a bus reset is detected, the device controller will renegotiat e its attachment speed, reset the device address to 0, and notify the dcd by interrupt (assuming the usb reset interrupt enable is set). after a reset is received, all endpoi nts (except endpoint 0) are disabled and any primed transactions will be canc elled by the device controller. the concept of priming will be clarified below, but the dcd must perform the following tasks when a reset is received: ? clear all setup token semaphores by reading the endptsetupstat register and writing the same value back to the endptsetupstat register. ? clear all the endpoint complete status bits by reading the endptcomplete register and writing the same value back to the endp tcomplete register. ? cancel all primed status by waiting until all bits in the endptprime are 0 and then writing 0xffffffff to endptflush. ? read the reset bit in the portscx register and make sure that it is still active. a usb reset will occur for a minimum of 3 ms and the dcd must reach this point in the reset cleanup before end of the reset occurs, otherwise a hardware reset of the device controller is recommended (rare). remark: a hardware reset can be performed by writing a one to the device controller reset bit in the usbcmd reset. note: a hard ware reset will cause the device to detach from the bus by clearing the run/stop bit. thus, the dcd must completely re-initialize the device controller after a hardware reset. ? free all allocated dtds because they will no longer be executed by the device controller. if this is the first time the dcd is processing a usb reset event, then it is likely that no dtds have been allocated. at this time, the dcd may release control back to the os because no further changes to the device controller are permitted until a port change detect is indicated. ? after a port change detect, the device has reached the default state and the dcd can read the portscx to determine if the device is operating in fs or hs mode. at this time, the device controller has reached normal operating mode and dcd can begin enumeration according to the usb2.0 specification chapter 9 - device framework . remark: the device dcd may use the fs/hs mode information to determine the bandwidth mode of the device. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 416 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller in some applications, it may not be possible to enable one or more pipes while in fs mode. beyond the data rate issue, there is no difference in dcd operation between fs and hs modes. 20.10.4 suspend/resume 20.10.4.1 suspend in order to conserve power, usb devices automatically enter the suspended state when the device has observed no bus traffic for a specified period. when suspended, the usb device maintains any internal status, including its address and configuration. attached devices must be prepared to suspend at any time they are powered, regardless of if they have been assigned a non-default address, ar e configured, or neither bus activity may cease due to the host entering a suspend mode of its own. in addition, a usb device shall also enter the suspended state when the hub port it is attached to is disabled. a usb device exits suspend mode when there is bus activity. a usb device may also request the host to exit suspend mode or sele ctive suspend by using electrical signaling to indicate remote wake-up. the ab ility of a device to signal re mote wake-up is optional. if the usb device is capable of remote wake-up signaling, the device must support the ability of the host to ena ble and disable this capability. wh en the device is reset, remote wake-up signaling must be disabled. 20.10.4.1.1 operational model the device controller moves into the suspen d state when suspend signaling is detected or activity is missing on the upstream port for mo re than a specific period. after the device controller enters the su spend state, the dcd is notified by an interrup t (assuming dc suspend interrupt is enabled). when the dcsu spend bit in the portscx is set to a ?1?, the device controller is suspended. dcd response when the device controller is suspended is application specific and may involve switching to low power operation. in formation on the bus power limits in suspend state can be found in usb 2.0 specification . 20.10.4.2 resume if the device controller is suspended, its oper ation is resumed when any non-idle signaling is received on its upstream facing port. in addition, the device can signal the system to resume operation by forcing resume signaling to the upstream port. resume signaling is sent upstream by writing a ?1? to the resume bit in the in the portscx while the device is in suspend state. sending resume signal to an upstream port should cause the host to issue resume signaling and bring the suspended bus segment (one more devices) back to the active condition. remark: before resume signaling can be used, the host must enable it by using the set feature command defined in device framework (chapter 9) of the usb 2.0 specification . www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 417 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.10.5 managing endpoints the usb 2.0 specification defines an endpoint, also called a device endpoint or an address endpoint as a uniquely addressable po rtion of a usb device that can source or sink data in a communications channel between the host and the device. the endpoint address is specified by the combinatio n of the endpoint number and the endpoint direction. the channel between the host and an endpoint at a specific device represents a data pipe. endpoint 0 for a device is always a control type data channel used for device discovery and enumeration. other types of endpoints support by usb include bulk, interrupt, and isochronous. each endpoint type has specific behavior related to packet response and error handling. more detail on endpoint operation can be found in the usb 2.0 specification . the lpc18xx supports up to six endpoints. each endpoint direction is essentially in dependent and can be configured with differing behavior in each direction. fo r example, the dcd can configure endpoint 1-in to be a bulk endpoint and endpoint 1- out to be an isochronous endpoint. this helps to conserve the total number of endpoints required for device o peration. the only exception is that control endpoints must use both directions on a single endpoint number to function as a control endpoint. endpoint 0 is, for example, is alwa ys a control endpoint and uses the pair of directions. each endpoint direction requires a queue head allocated in memory. if the maximum of 4 endpoint numbers, one for each endpoint direction are being used by the device controller, then 8 queue heads are required. the operation of an endpoint and use of queue heads are described later in this document. 20.10.5.1 endpoint initialization after hardware reset, all endpoints except endpoint zero are un-initialized and disabled. the dcd must configure and enable each endpoi nt by writing to configuration bit in the endptctrlx register (see table 338 ). each 32-bit endptctrlx is split into an upper and lower half. the lower half of endptctrlx is used to configure the receive or out endpoint and the upper half is likewise used to configure the corresponding transmit or in endpoint. control endpoints must be configured the same in both the upper and lower half of the endptctrlx register otherwise the behavior is undefined. the following table shows how to construct a configurat ion word for endpoint initialization. table 347. device controller endpoint initialization field value data toggle reset 1 data toggle inhibit 0 endpoint type 00 - control 01 - isochronous 10 - bulk 11 - interrupt endpoint stall 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 418 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.10.5.2 stalling there are two occasions where the device controller may need to return to the host a stall: 1. the first occasion is the functional stall , which is a condition set by the dcd as described in the usb 2.0 device framework (chapter 9) . a functional stall is only used on non-control endpoints and can be enabled in the device controller by setting the endpoint stall bit in the endptctrlx regist er associated with the given endpoint and the given direction. in a functional stall co ndition, the device co ntroller will continue to return stall responses to all transactions occurring on the respective endpoint and direction until the endpoint stall bit is cleared by the dcd. 2. a protocol stal l, unlike a function stall, is used on control endpoints is automatically cleared by the device controller at the start of a new control transaction (setup phase). when enabling a protocol stall, the dcd shoul d enable the stall bits (both directions) as a pair. a single write to the endptctrlx register can ensure that both stall bits are set at the same instant. remark: any write to the endptctrlx register du ring operational mode must preserve the endpoint type field (i.e. perform a read-modify-write). 20.10.5.3 data toggle data toggle is a mechanism to maintain data coherency between host and device for any given data pipe. for more information on data toggle, refer to the usb 2.0 specification. 20.10.5.3.1 data toggle reset the dcd may reset the data toggle state bit and cause the data toggle sequence to reset in the device controller by wr iting a ?1? to the data toggle reset bit in the endptctrlx register. this should only be necessary when configuring/initializing an endpoint or returning from a stall condition. 20.10.5.3.2 data toggle inhibit remark: this feature is for test purposes only and should never be used during normal device controller operation. table 348. device controller stall response matrix usb packet endpoint stall bit effect on stall bit usb response setup packet received by a non-control endpoint. n/a none stall in/out/ping packet received by a non-control endpoint. 1 none stall in/out/ping packet received by a non-control endpoint. 0 none ack/nak/nyet setup packet received by a control endpoint. n/a cleared ack in/out/ping packet received by a control endpoint. 1 none stall in/out/ping packet received by a control endpoint. 0 none ack/nak/nyet www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 419 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller setting the data toggle inhibit bit active (?1?) causes the device controller to ignore the data toggle pattern that is normally sent and accept all incoming data packets regardless of the data toggle state. in normal operation, th e device controller checks the data0/data1 bit against the data toggle to determine if the packet is valid. if data pid does not match the data toggle state bit maintained by the device controller for that endpoint, the data toggle is considered not valid. if the data toggle is not valid, the device controller assumes the packet was already received and discards the packet (not reporting it to the dcd). to prevent the host cont roller from re-sending the same packet, the device controller will respond to the error packet by acknowledging it with either an ack or nyet response. 20.10.6 operational model for packet transfers all transactions on the usb bu s are initiated by the host and in turn, the device must respond to any request from the host within the turnaround time stated in the usb 2.0 specification. at usb 1.1 full or low speed ra tes, this turnaround time was significant and the usb 1.1 device controllers were designed so that the device controller could access main memory or interrupt a host protocol processor in order to respond to the usb 1.1 transaction. the architecture of the usb 2.0 device controller must be different because same methods will not meet usb 2.0 high-speed tu rnaround time requirements by simply increa sing clock rate. a usb host will send requests to the device controller in an order that can not be precisely predicted as a single pipeline, so it is not possible to prepare a single packet for the device controller to execute. however, the order of packet requests is predictable when the endpoint number and direction is consider ed. for example, if endpoint 3 (transmit direction) is configured as a bulk pipe, then we can expect the host will send in requests to that endpoint. this device controller is designed in such a way that it can prepare packets for each endpoint/direction in antic ipation of the host request. the process of preparing the device controller to send or receive data in response to host initiated transaction on the bus is referred to as ?p riming? the endpoint. th is term will be used throughout the following documentation to desc ribe the device controller operation so the dcd can be designed properly to use priming. further, note that the term ?flushing? is used to describe the action of clearing a packet that was queued for execution. 20.10.6.1 priming transmit endpoints priming a transmit endpoint will cause the de vice controller to fetc h the device transfer descriptor (dtd) for the transaction pointed to by the device queue head (dqh). after the dtd is fetched, it will be st ored in the dqh until the de vice controller completes the transfer described by the dtd. storing the dt d in the dqh allows th e device controller to fetch the operating context needed to handle a request from the host without the need to follow the linked list, starting at the dqh when the host request is received. after the device has loaded the dtd, the leading data in the packet is stored in a fifo in the device controller. this fifo is split into virtual chan nels so that the leading data can be stored for any endpoint up to four endpoints. after a priming request is complete, an endpoint state of primed is indicated in the endptstatus register. for a primed trans mit endpoint, the device controller can respond to an in request from the host and meet the stringent bus turnaround time of high speed usb. since only the leading data is stored in the device controller fifo, it is necessary for the device controller to be gin filling in behind leading data after the www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 420 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller transaction starts. the fifo must be sized to account for the maximum latency that can be incurred by the system memory bus. on the lpc18xx, 128 x 36 bit dual port memory fifos are used for each in endpoint. 20.10.6.2 priming receive endpoints priming receive endpoints is identical to prim ing of transmit endpoints from the point of view of the dcd. at the device controller the major difference in the operational model is that there is no data movement of the lead ing packet data simply because the data is to be received from the host. note as part of the architecture, the fifo for the receive endpoints is not partitioned into multiple channels like the transmit fifo. thus, the size of the rx fifo does not scale with the number of endpoints. 20.10.7 interrupt/bulk en dpoint operational model the behaviors of the device controller for interrupt and bulk endpoints are identical. all valid in and out transactions to bulk pi pes will handshake with a nak unless the endpoint had been primed. once the endpoint has been primed, data delivery will commence. a dtd will be retired by the device controller when the packets described in the transfer descriptor have been completed. each dtd describes n packets to be transferred according to the usb variable length transfer protocol. the formula and table on the following page describe how the device cont roller computes the number and length of the packets to be sent/received by the usb vary according to the total number of bytes and maximum packet length. with zero length termination (zlt) = 0 n = int(number of bytes/ max. packet length) + 1 with zero length termination (zlt) = 1 n = maxint(number of byte s/max. packet length) remark: the mult field in the dqh must be set to ?00? for bulk, interrupt, and control endpoints. tx-dtd is complete when a ll packets described dtd were successfully transmitted.total bytes in dtd will equal zero when this occurs. table 349. variable length transfer protocol example (zlt = 0) bytes (dtd) max packet length (dqh) n p1 p2 p3 511 256 2 256 255 - 512 256 3 256 256 0 512 512 2 512 0 - table 350. variable length transfer protocol example (zlt = 1) bytes (dtd) max packet length (dqh) n p1 p2 p3 511 256 2 256 255 - 512 256 2 256 256 - 512 512 1 512 - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 421 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller rx-dtd is complete when: ? all packets described in dtd were successfully received. to tal bytes in dtd will equal zero when this occurs. ? a short packet (number of bytes < maximum packet length) was received. this is a successful transfer co mpletion; dcd must check total bytes in dtd to determine the number of bytes that are remaining. from the total bytes remaining in the dtd, the dcd can compute the actual bytes received. ? a long packet was received (number of byte s > maximum packet size) or (total bytes received > total bytes specifie d). this is an er ror condition. the device controller will discard the remaining packet, and set the buffer error bit in the dtd. in addition, the endpoint will be flushed and the u sberr interrupt will become active. on the successful completion of the packet(s) described by the dtd, the active bit in the dtd will be cleared and the next pointer will be followed when the terminate bit is clear. when the terminate bit is set, the device controller will flush the endpoint/direction and cease operations for that endpoint/direction. on the unsuccessful completion of a packet (see long packet above), the dqh will be left poin ting to the dtd that wa s in error. in order to recover from this error co ndition, the dcd must properly reinitialize the dqh by clearing the active bit and update the nexttd pointer before attempting to re-prime the endpoint. remark: all packet level errors such as a missin g handshake or crc error will be retried automatically by the device controller. there is no required interaction with the dcd for handling such errors. 20.10.7.1 interrupt/bulk endpoint bus response matrix [1] bs error = force bit stuff error [2] nyet/ack ? nyet unless the transfer descriptor has packets remaining according to the usb variable length protocol then ack. [3] syserr ? system error should never occur when the latency fifos are corr ectly sized and the dcd is responsive. 20.10.8 control endpoint operational model 20.10.8.1 setup phase all requests to a control endpoint begin with a setup phase followed by an optional data phase and a required status phase. the device controlle r will always accept the setup phase unless the setup lockout is engaged. table 351. interrupt/bulk endpoint bus response matrix token type stall not primed primed underflow overflow setup ignore ignore ignore n/a n/a in stall nak transmit bs error n/a out stall nak receive and nyet/ack n/a nak ping stall nak ack n/a n/a invalid ignore ignore ignore ignore ignore www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 422 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller the setup lockout will engage so that future setup packets are ignored. lockout of setup packets ensures that while software is reading the setup packet stored in the queue head, that data is not written as it is being read potentially causing an invalid setup packet. in hardware the setup lockout mechanism can be disabled and a new tripwire type semaphore will ensure that the setup packet payload is extracted from the queue head without being corrupted by an incoming setup packet. this is the preferred behavior because ignoring repeated setup packets due to long software interrupt latency would be a compliance issue. 20.10.8.1.1 setup packet handling using setup lockout mechanism after receiving an interrupt and inspecting usbmode to determine that a setup packet was received on a particular pipe: 1. duplicate contents of dqh.ssetupbuffer into local software byte array. 2. write '1' to clear corresponding endptsetupstat bit and thereby disabling setup lockout (i.e. the setup lockout activates as soon as a setup arrives. by writing to the endptsetupstat, the device contro ller will accept new setup packets.). 3. process setup packet using local soft ware byte array copy and execute status/handshake phases. remark: after receiving a new setup packet the status and/or handshake phases may still be pending from a previous cont rol sequence. these should be flushed & deallocated before linking a new status and/or handshake dtd for the most recent setup packet. 4. before priming for status/handshake phas es ensure that endptsetupstat is ?0?. the time from writing a ?1? to endptset upstat and reading back a ?0? may vary according to the type of traffic on the bus up to nearly a 1ms, however the it is absolutely necessary to ensu re endptsetupstat has transitioned to ?0? after step 1) and before priming for t he status/handshake phases. remark: to limit the exposure of setup packets to the setup lockout mechanism (if used), the dcd should designate the priority of responding to setup packets above responding to other packet completions 20.10.8.1.2 setup packet handling using trip wire mechanism ? disable setup lockout by writ ing ?1? to setup lockout mode (slom) in usbmode. (once at initialization). se tup lockout is not necessary when using the tripwire as described below. remark: leaving the setup lockout mode as ?0? will result in pre-2.3 hardware behavior. ? after receiving an interrupt and inspecting endptsetupstat to determine that a setup packet was received on a particular pipe: a. write '1' to clear corresponding bit endptsetupstat. b. duplicate contents of dqh.setupbuffer into local software byte array. c. write ?1? to setup tripwire (sutw) in usbcmd register. d. read setup tripwire (sutw) in usbcmd register. (if set - continue; if cleared - go to b). e. write '0' to clear setup tripwir e (sutw) in usbcmd register. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 423 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller f. process setup packet using local software byte array copy and execute status/handshake phases. g. before priming for status/handshake phases ensure that endptsetupstat is ?0?. ? a poll loop should be used to wait until endp tsetupstat transitions to ?0? after step a) above and before priming for the status/handshake phases. ? the time from writing a ?1? to endptsetupst at and reading back a ?0? is very short (~1-2 us) so a poll loop in the dcd will not be harmful. remark: after receiving a new setup packet the status and/or hand shake phases may still be pending from a previous control sequence. these should be flushed & deallocated before linking a new status and/or handshake dtd for the most recent setup packet. 20.10.8.2 data phase following the setup phase, the dcd must create a devi ce transfer descriptor for the data phase and prime the transfer. after priming the packet, the dcd must verify a new setup packet has not been received by reading the endptsetupstat register immediately verifying that the prime had completed. a prime will complete when the asso ciated bit in the endp tprime register is zero and the associated bit in the endptsta tus register is a one. if a prime fails, i.e. the endptprime bit goes to zero and the endptstatus bit is not set, then the prime has failed. this can only be due to improper setup of the dqh, dtd or a setup arriving during the prime operation. if a new setup packet is indicated after the endptprime bit is cleared, then the transfer descriptor ca n be freed and the dcd must reinterpret the setup packet. should a setup arrive after the data st age is primed, the device controller will automatically clear the prime status (endpts tatus) to enforce data coherency with the setup packet. remark: the mult field in the dqh must be set to ?00? for bulk, interrupt, and control endpoints. remark: error handling of data phase packets is the same as bulk packets described previously. 20.10.8.3 status phase similar to the data phase, th e dcd must create a transfer descriptor (with byte length equal zero) and prime the endpoint for the st atus phase. the dcd mu st also perform the same checks of the endptsetupstat as described above in the data phase. remark: the mult field in the dqh must be set to ?00? for bulk, interrupt, and control endpoints. remark: error handling of data phase packets is the same as bulk packets described previously. 20.10.8.4 control endpoint bus response matrix shown in the following table is the device controller response to packets on a control endpoint according to the device controller state. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 424 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller [1] bs error = force bit stuff error [2] nyet/ack ? nyet unless the transfer descriptor has packets remaining according to the usb variable length protocol then ack. [3] syserr ? system error should never occur when the latency fifos are corr ectly sized and the dcd is responsive. 20.10.9 isochronous endpoint operational model isochronous endpoints are used for real-tim e scheduled delivery of data, and their operational model is significantly different than the host throttled bulk, interrupt, and control data pipes. real time delivery by the device controller is accomplished by the following: ? exactly mult packets per (micro) frame ar e transmitted/received. note: mult is a two-bit field in the device queue head. the variable length packet protocol is not used on isochronous endpoints. ? nak responses are not used. instead, zero length packets are sent in response to an in request to an unprimed endpoints. for unprimed rx endpoints, the response to an out transaction is to ignore the packet within the device controller. ? prime requests always schedule the transfer described in the dtd for the next (micro) frame. if the iso-dtd is st ill active after that frame, then the iso-dtd will be held ready until executed or canceled by the dcd. an ehci compatible host controller uses the periodic frame list to schedule data exchanges to isochronous endpoints. the operational model for device mode does not use such a data structure. instead, the same dtd used for c ontrol/bulk/interrupt endpoints is also used for isochronous endpoints. the difference is in the handling of the dtd. the first difference between bulk and iso-endp oints is that priming an iso-endpoint is a delayed operation such that an endpoint will become primed onl y after a sof is received. after the dcd writes the prime bit, the prime bit will be clea red as usual to indicate to software that the device controller completed a priming the dtd for transfer. internal to the design, the device controller hardware masks that prime start until the next frame boundary. this behavior is hidden from the dcd but occurs so that the device controller can match the dtd to a specific (micro) frame. another difference with isochronous endpoi nts is that the transaction must wholly complete in a (micro) frame. once an iso transaction is st arted in a (micro) frame it will retire the corresponding dtd when mult trans actions occur or the device controller finds table 352. control endpoint bus response matrix token type endpoint sate setup lockout stall not primed primed underflow overflow setup ack ack ack n/a syserr - in stall nak transmit bs error n/a n/a out stall nak receive and nyet/ack n/a nak n/a ping stall nak ack n/a n/a n/a invalid ignore ignore ignore ignore ignore ignore www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 425 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller a fulfillment condition. th e transaction error bit set in the status field indicates a fulfillment error condition. when a fulf illment error occurs, the frame after the transfer failed to complete wholly, the device co ntroller will force retire the is o-dtd and move to the next iso-dtd. it is important to note that fulfillment errors are only caus ed due to partially completed packets. if no activity occurs to a primed iso-dtd, the transaction will stay primed indefinitely. this means it is up to software discard transmit iso-dtds that pile up from a failure of the host to move th e data. finally, the last difference with iso packets is in the data level error handling. when a crc erro r occurs on a received packet, the packet is not retried similar to bulk and control endpoint s. instead, the crc is noted by setting the transaction error bit and the data is stored as usual for the application software to sort out. tx packet retired ? mult counter reaches zero. ? fulfillment error [transaction error bit is set]. ? # packets occurred > 0 and # packets occurred < mult. remark: for tx-iso, mult counter can be loaded with a lesser value in the dtd multiplier override field. if the multiplier override is zero, the mult counter is initialized to the multiplier in the qh. rx packet retired ? mult counter reaches zero. ? non-mdata data pid is received. remark: exit criteria only valid in hardware version 2.3 or later. previous to hardware version 2.3, any pid sequence that did not match the mult fi eld exactly would be flagged as a transaction error due to pid mismatch or fulfillment error. ? overflow error: ? packet received is > maximum packet length. [buffer error bit is set]. ? packet received exceeds total bytes alloca ted in dtd. [buffer error bit is set]. ? fulfillment error [transaction error bit is set]: # packets occurred > 0 and # packets occurred < mult. ? crc error [transaction error bit is set] remark: for iso, when a dtd is retired, the next dtd is primed for the next frame. for continuous (micro) frame to (micro) frame oper ation the dcd should ensure that the dtd linked-list is out ahead of the device c ontroller by at least two (micro) frames. 20.10.9.1 isochronous pipe synchronization when it is necessary to synchronize an is ochronous data pipe to the host, the (micro) frame number (frindex register) can be used as a marker. to cause a packet transfer to occur at a specific (micro) frame number [n], the dcd should interrupt on sof during frame n-1. when the frind ex=n?1, the dcd must write the prime bit. the device controller will prime the isochron ous endpoint in (micro) fram e n?1 so that the device controller will execute deliver y during (micro) frame n. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 426 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller remark: priming an endpoint towa rds the end of (micro) fr ame n-1 will not guarantee delivery in (micro) frame n. the delivery may ac tually occur in (micro) frame n+1 if device controller does not have enough time to complete the prime before the sof for packet n is received. 20.10.9.2 isochronous endpoint bus response matrix [1] bs error = force bit stuff error [2] null packet = zero length packet. 20.10.10 managing queue heads the device queue hea d (dqh) points to the linked list of transfer tasks, each depicted by the device transfer descriptor (dtd). an area of memory pointed to by endpointlistaddr contains a group of all dqh?s in a sequential list as shown figure 40 . the even elements in the list of dqh?s are used for receive endpoints (out/setup) and the odd elements are used for transmit endpoints (in/interrupt). device transfer descriptors are linked head to tail starting at the queue head and ending at a terminate bit. once the dtd has been retired, it will no lon ger be part of the linked list table 353. isochronous endpoint bus response matrix token type stall not primed primed underflow overflow setup stall stall stall n/a n/a in null packet null packet transmit bs error n/a out ignore ignore receive n/a drop packet ping ignore ignore ignore ignore ignore invalid ignore ignore ignore ignore ignore fig 40. endpoint queue head diagram endpoint dqh0 - out endpoint dqh0 - in endpoint dqh1 - out endpointlistaddr endpoint queue heads dqh endpoint transfer descriptors dtd transfer buffer transfer buffer transfer buffer transfer buffer dtd dtd dtd dtd transfer buffer pointer transfer buffer pointer transfer buffer pointer transfer buffer pointer www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 427 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller from the queue head. therefore, software is re quired to track all transfer descriptors since pointers will no longer exist within the q ueue head once the dt d is retired (see section 20.10.11.1 ). in addition to the current and next pointers and the dtd overlay examined in section operational model for packet transfers, the dqh also contains the following parameters for the associated endpoint: multiplier, maxi mum packet length, inte rrupt on setup. the complete initialization of th e dqh including these fields is demonstrated in the next section. 20.10.10.1 queue head initialization one pair of device queue heads must be initia lized for each active endpoint. to initialize a device queue head: ? write the wmaxpacketsize field as required by the usb chapter 9 or application specific protocol. ? write the multiplier field to 0 for control, bulk, and interrupt endpoints. for iso endpoints, set the multiplier to 1,2, or 3 as required bandwidth and in conjunction with the usb chapter 9 protocol . note: in fs mode, the multip lier field can only be 1 for iso endpoints. ? write the next dtd terminate bit field to ?1?. ? write the active bit in the status field to ?0?. ? write the halt bit in the status field to ?0?. remark: the dcd must only modify dqh if the as sociated endpoint is not primed and there are no outstanding dtd?s. 20.10.10.2 operational model for setup transfers as discussed in section contro l endpoint operational model ( section 20.10.8 ), setup transfer requires special treatment by the dcd. a setup transfer does not use a dtd but instead stores the incoming data from a setu p packet in an 8-byte buffer within the dqh. upon receiving notification of the setup packet, the dcd should handle the setup transfer as demonstrated here: 1. copy setup buffer contents from dqh - rx to software buffer. 2. acknowledge setup backup by writing a ?1? to the corresponding bit in endptsetupstat. remark: the acknowledge must occur before continuing to process the setup packet. remark: after the acknowledge has occurred, the dcd must not attempt to access the setup buffer in the dqh ? rx. only the local software copy should be examined. 3. check for pending data or status dtd?s from previous control transfers and flush if any exist as discussed in section flushing/de-priming an endpoint. remark: it is possible for the device contro ller to receive setup packets before previous control transfers complete. existi ng control packets in progress must be flushed and the new control packet completed. 4. decode setup packet and prepare data phas e [optional] and status phase transfer as require by the usb specification chapter 9 or application specific protocol. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 428 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.10.11 managing transfers wi th transfer descriptors 20.10.11.1 software link pointers it is necessary for the dcd software to maintain head and tail pointers to the linked list of dtds for each respective queue head. this is necessary because the dqh only maintains pointers to the current working dtd and the next dtd to be executed. the operations described in next section for managing dtd will assume th e dcd can use reference the head and tail of the dtd linked list. remark: to conserve memory, the reserved fields at the end of the dqh can be used to store the head & tail pointers but it still remain s the responsibility of the dcd to maintain the pointers. 20.10.11.2 building a transfer descriptor before a transfer can be executed from the lin ked list, a dtd must be built to describe the transfer. use the following procedure for building dtds: allocate 8-dword dtd block of memory aligned to 8-dword boundaries. example: bit address 4:0 would be equal to ?00000?. write the following fields: 1. initialize first 7 dwords to 0. 2. set the terminate bit to ?1?. 3. fill in total bytes with transfer size. 4. set the interrupt on complete if desired. 5. initialize the status field with the active bit set to ?1? and all remaining status bits set to ?0?. 6. fill in buffer pointer page 0 and the current of fset to point to the start of the data buffer. 7. initialize buffer pointer page 1 through page 4 to be one greater than each of the previous buffer pointer. fig 41. software link pointers head pointer tail pointer current next endpoint qh completed dtds queued dtds www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 429 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.10.11.3 executing a transfer descriptor to safely add a dtd, the dcd must follow this procedur e which will handle the event where the device controller reaches the end of the dtd list at the same time a new dtd is being added to the end of the list. determine whether the link list is empty: check dcd driver to see if pipe is empty (internal representation of linked-list should indicate if any packets are outstanding). link list is empty 1. write dqh next pointer and dqh terminate bit to 0 as a single dword operation. 2. clear active and halt bits in dqh (in case set from a previous error). 3. prime endpoint by writing ?1? to correct bit position in endptprime. link list is not empty 1. add dtd to end of the linked list. 2. read correct prime bit in endptprime ? if ?1? done. 3. set atdtw bit in usbcmd register to ?1?. 4. read correct status bit in endptstat. (store in temp va riable for later). 5. read atdtw bit in usbcmd register. ? if ?0? go to step 3. ? if ?1? continue to step 6. 6. write atdtw bit in usbcmd register to ?0?. 7. if status bit read in step 4 (endpstat reg) indicates endpoint priming is done (corresponding erbrx or etbrx is one): done. 8. if status bit read in step 4 is 0 then go to linked list is empty: step 1. 20.10.11.4 transfer completion after a dtd has been initialized and the associated endpoint primed the device controller will execute the transfer upon the host-initi ated request. the dcd will be notified with a usb interrupt if the in terrupt on complete bit was set or alternately, the dcd can poll the endpoint complete register to find when the dtd had been executed. after a dtd has been executed, dcd can check the status bits to determine success or failure. remark: multiple dtd can be completed in a single endpoint complete notification. after clearing the notification, dcd mu st search the dtd lin ked list and retire all dtds that have finished (active bit cleared). by reading the status fields of the comp leted dtds, the dcd can determine if the transfers comple ted successfully. success is determined with the fo llowing combination of status bits: active = 0 halted = 0 transaction error = 0 data buffer error = 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 430 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller should any combination other than the one shown above exist, the dcd must take proper action. transfer failure mechanisms are indicated in the device error matrix (see table 354 ). in addition to checking the status bit, the dcd must read the transfer bytes field to determine the actual bytes transferred. when a transfer is complete, the total bytes transferred is decremented by the actual bytes transferred. for transmit packets, a packet is only complete after the actual by tes reaches zero, but fo r receive packets, the host may send fewer bytes in the transfer according the usb variable length packet protocol. 20.10.11.5 flushing/de-priming an endpoint it is necessary for the dcd to flush to de-prime one more endpoints on a usb device reset or during a broken control transfer. there may also be application specific requirements to stop transfers in progress. the following procedure can be used by the dcd to stop a transfer in progress: 1. write a ?1? to the corresponding bit(s) in endptflush. 2. wait until all bits in endptflush are ?0?. remark: software note: this operation may take a large amount of time depending on the usb bus activity. it is not desirable to have this wait l oop within an interrupt service routine. 3. read endptstat to ensure that for all endpoints commanded to be flushed, that the corresponding bits are now ?0?. if the corresponding bits are ?1? after step #2 has finished, then the flush failed as described in the following: in very rare cases, a packet is in pr ogress to the particular endpoint when commanded flush using endptflush. a safeguard is in place to refuse the flush to ensure that the packet in progress completes successfully. the dcd may need to repeatedly flush any endpoints that fail to flush by repeating steps 1-3 until each endpoint is successfully flushed. 20.10.11.6 device error matrix the table 354 summarizes packet errors that are not automatically handled by the device controller. the following errors can occur: overflow : number of bytes received exceeded max. packet size or total buffer length. this error will also set the halt bit in the dqh, and if ther e are dtds remaining in the linked list for the endpoint, then those will not be executed. iso packet error : crc error on received iso packet. contents not guaranteed to be correct. iso fulfillment error : host failed to complete the number of packets defined in the dqh mult field within the given (micro) frame. fo r scheduled data delivery the dcd may need to readjust the data queue because a fulf illment error will cause de vice controller to cease data transfers on the pipe for one (micro ) frame. during the ?dead? (micro) frame, the device controller reports error on the pipe and primes for the following frame www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 431 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.10.12 servicing interrupts the interrupt service routine must consider that there are high-frequency, low-frequency operations, and error operations and order accordingly. 20.10.12.1 high-frequency interrupts high frequency interrupts in particular should be handed in the order below. the most important of these is listed first because the dcd must acknowledge a setup buffer in the timeliest manner possible. [1] it is likely that multiple interrupts to stack up on any call to the interrupt service routine and during the interrupt service routine. 20.10.12.2 low-frequency interrupts the low frequency events include the following interrupts. these interrupt can be handled in any order since they don?t occur often in comparison to the high-frequency interrupts. 20.10.12.3 error interrupts error interrupts will be least frequent and shoul d be placed last in the interrupt service routine. table 354. device error matrix error direction packet type data buffer error bit transaction error bit overflow rx any 1 0 iso packet error rx iso 0 1 iso fulfillment error both iso 0 1 table 355. high-frequency interrupt events execution order interrupt action 1a usb interrupt: endptsetupstatus [1] copy contents of setup buffer and acknowledge setup packet (as indicated in section 20.10.10 ). process setup packet according to usb 2.0 chapter 9 or application specific protocol. 1b usb interrupt: endptcomplete [1] handle completion of dtd as indicated in section 20.10.10 . 2 sof interrupt action as deemed necessary by application. this interrupt may not have a use in all applications. table 356. low-frequency interrupt events interrupt action port change change software state information. sleep enable (suspend) change software state information. low power handling as necessary. reset received change software state information. abort pending transfers. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 432 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.11 usb power optimization the usb-hs core is a fully synchronous static design. the power used by the design is dependent on the implementation technology used to fabricate the design and on the application usage of the core. applications that transfer more data or use a greater number of packets to be sent will consume a greater amount of power. because the design is synchronous and static , power may be conserved by reducing the transitions of the clock net. this may be done in several ways. 1. reduce the clock frequency to the core . the clock frequency may not be reduced below the minimum recommended operating frequency of the core without first disabling the usb operation. 2. reduce transition on the clock net through the use of clock gating methods. (the lpc18xx is synthesized using this mechanism). 3. the clock may be shut off to the core entire ly to conserve power. again this may only be done after the usb operations on the bus have been disabled. a device may suspend operations autonomously by disconnecting from the usb, or, in response to the suspend signaling, the usb has moved it into the suspend state. a host can suspend operation autonomously, or it can command portions or the entire usb to transition into the suspend state. 20.11.1 usb power states the usb provides a mechanism to place segmen ts of the usb or the entire usb into a low-power suspend state. usb bus powered devices are required to respond to a 3ms lack of activity on the usb bus by going into a suspend state. in the usb-hs core software is notified of the suspend condition via the transition in the portsc register. optionally an interrupt can be generated which is controlled by the port change detect enable bit in the usbintr control register. software then has 7 ms to transition a bus powered device into the suspend state. in the suspend state, a usb device has a maximum usb bus power budget of 500 ? a. in general, to achieve that level of power conservation, most of the device circuits will need to be switched off, or clock at an extremely low frequency. this can be ac complished by suspending the clock. the implementation of low power states in th e usb-hs core is dependant on the use of the device role (host or peripheral), whether the device is bus powered, and the selected clock architecture of the core. table 357. error interrupt events interrupt action usb error interrupt this error is redundant because it combines usb interrupt and an error status in the dtd. the dcd will more aptly handle packet-level errors by checking dtd status field upon receipt of usb interrupt (w/ endptcomplete). system error unrecoverable error. immediate reset of core; free transfers buffers in progress and restart the dcd. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 433 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller bus powered peripheral devices are required by the usb specification to support a low power suspend state. self powered peripheral devices and hosts set their own power management strategies based on their system level requirements. the clocking architecture selected is important to consider as it determines what portions of the design will remain active when transitio ned into the low power state. before the system cl ock is suspended or set to a frequency that is below the operational frequency of the usb-hs core, the core must be moved from the operational state to a low power state. the power strategies designed into the usb-hs core allow for the most challenging case, a self powered device that is clocked entirely by the transceiver clock. 20.11.2 device power states a bus powered peripheral device must move th rough the power states as directed by the host. optionally autonomously directed low power states may be implemented. in the operational state both the transceiver clock and system clocks are running. software can initiate a low power mode autonomously by disconnecting from the host to go into the disconnect state. once in this st ate, the software can set the suspend bit to fig 42. device power state diagram host directed autonomous operational 3 ms idle low-power request resume interrupt received prepare for suspend disconnect sw sets suspend bit sw sets suspend bit user-defined wakeup disconnect suspend suspend resume user-defined wakeup start resume lock power states (clock may be suspended) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 434 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller turn off the transceiver clock putting the system in to the disconnect-suspend state. since software cannot depend on the presents of a clock to clear the suspend bit, a wake-up event must be defined which would clear the suspend bit and allow the transceiver clock to resume. the device can also go into suspend mode as a result of a suspend command from the host. suspend is signaled on th e bus by 3ms of idle time on the bus. this will generate a suspend interrupt to the software at which point the software must prepare to go into suspend then set the suspend bit. once the suspend bit is set the transceiver clock may turn off and the device will be in the sus pended state. the device has two ways of getting out of suspend. 1. if remote wake-up is enabled, a wake-up event could be defined which would clear the suspend bit. the software would then initiate the resume by setting the resume bit in the port controller then waiting for a port change interrupt indicating that the port is in an operational state. 2. if the host puts resume signaling on the bu s, it will clear the su spend bit and generate a port change interrupt when the resume is finished. in either case the system designer must insu re an orderly restoration of the power and clocks to the suspended circuitry. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 435 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.11.3 host power states from an operational state when a host gets a low power request, it must set the suspend bit in the port controller. this will put an idle on the bus, blo ck all traffic th rough th e port, and turn off the transceiver clock. there are tw o ways for a host controller to get out of the suspend state. if it has enabled remote wa ke-up, a k-state on the bus will turn the transceiver clock and generate an interrupt. the software will t hen have to wait 20 ms for the resume to complete and the port to go back to an active state. alternatively an external event could clear the suspend bit and start the transceiver clock running again. the software can then initiate a resume by setting the resume bit in the port controller, or force a reconnect by setting the reset bit in the port controller. if all devices have disconnected from the host, the host can go into a low power mode by the software setting the suspend bit. from the disconnect-suspend state a connect event would start the transceiver clock and interrupt the software. the software would then need to set the reset bit to start the connect process. fig 43. host/otg power state diagram operational disconnect sw sets suspend bit user-defined wakeup disconnect suspend suspend user-defined wakeup lock power states (clock may be suspended) low-power request all devices disconnected signal suspend wait for 3 ms k-state on bus wait resume resume or reset connect interrupt www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 436 of 1164 nxp semiconductors UM10430 chapter 20: lpc18xx usb0 host/device/otg controller 20.11.4 susp_ctrl module the susp_ctrl module implements the power management logic of usb-otg. it controls the suspend input of the transceiver. asserting this suspend signal will put the transceiver in suspend mode and the generation of the 30 mhz clock and 60 mhz clock will be switched off. a suspend control input of the transceiver (o tg_on) that was previously tied high and prevented the transceiver to go into full suspend mode, has been connected to . this bit is low by default and only needs to be set high in otg host mode operation. in suspend mode, the transcei ver will raise an output signal indicating that the pll generating the 480 mhz clock can be switched off. the susp_ctrl module also generates an output signal indicating whether the ahb clock is needed or not. if '0' the ahb clock is allowed to be switched off or reduced in frequency in order to save power. the core will enter t he low power state if: ? software sets the portsc.phcd bit. when operating in host mode, the core will leave the low power state on one of the following conditions: ? software clears the portsc.phcd bit ? a device is connected and the portsc.wkcn bit is set ? a device is disconnected an the portsc.wkdc bit is set ? an over-current condition occurs and the portsc.wkoc bit is set ? a remote wake-up from the attached device occurs (when usb bus was in suspend) ? a change on vbusvalid occurs (= vbus threshold at 4.4 v is crossed) ? a change on bvalid occurs (=vbus threshold at 4.0 v is crossed). when operating in device mode, the core will leave the low power state on one of the following conditions: ? software clears the portsc.phcd bit. ? a change on the usb data lines (dp/dm) occurs. ? a change on vbusvalid occurs (= vbus threshold at 4.4 v is crossed). ? a change on bvalid occurs (= vbus threshold at 4.0 v is crossed). the vbusvalid and bvalid signals coming from the transceiver are not filtered in the susp_ctrl module. any change on those signals will cause a wake-up event. input signals 'host_wakeup_n' and 'dev_wakeup_n' are extra external wake-up signals (for host mode and device mode respectively). however the detectio n of all usb related wake-up events is already handled in the susp_ctrl mode. therefore in normal situations these signals can be tied high (= inactive). www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 437 of 1164 21.1 how to read this chapter the usb1 host/device controller is available on parts lpc1850 and lpc1830. 21.2 basic configuration the usb1 controller is configured as follows: ? see ta b l e 3 5 8 for clocking and power control. ? the usb1 is reset by a usb1_rst (reset # 18). ? the usb1 otg interrupt is connected to interrupt slot # 9 in the nvic. the usb wake-up interrupt is connected to slot # 10 in the event router. ? in the sfsusb register, the usb_esea bit must be set to 1 for the usb1 to operate (see table 204 ). 21.2.1 full-speed mode without external phy in full-speed mode, use clk_usb1 to gen erate a clock for the usb1 interface. 21.2.2 high-speed mode with ulpi interface in high-speed mode, the external phy genera tes the clock for the usb1 interface, and the usb1_ulpi_clk must be enabled on pins pc_0 or p8_8 through their respective pin configuration registers in the system conf iguration block. the usb1 branch clock clk_usb1 must be disabled. 21.3 features ? complies with universal serial bus specification 2.0 . ? complies with enhanced host controller interface specification . ? supports auto usb 2.0 mode discovery. ? supports all high-speed usb-compliant peripherals if connected to external ulpi phy. UM10430 chapter 21: lpc18xx usb1 host/device controller rev. 00.13 ? 20 july 2011 user manual table 358. usb1 clocking and power control base clock branch clock maximum frequency notes usb1 clock base_usb1_clk clk_usb1 15 0 mhz uses pll1 only. clk_usb1 must be 60 mhz when the usb1 is operated at low-speed and full-speed modes. in high-speed mode, the clock is provided by the ulpi phy. usb1 register interface clock base_m3_clk clk_m3_usb1 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 438 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller ? supports all full-speed usb-compliant peripherals. ? supports interrupts. ? this module has its own, integrated dma engine. 21.4 general description the high speed-on-the-go controller is a peripheral for embedded applications containing digital circuitry to prov ide usb2.0 on-the-go functionality. usb2.0 provides plug-and-play connection of peripheral devices to a host with three different data speeds: high-speed with a data rate of 480 mbps, full-speed with a data rate of 12 mbps, low-speed with a data ra te of 1.5 mbps. many portable devices can benefit from the ability to co mmunicate to each other over the usb interface without intervention of a host pc. the addition of the on-the-go functionality to usb makes this possible without losing the benefits of the standard usb protocol. support of the high-speed data rate and the otg functionality requires an external usb hs otg phy that connects to the usb contro ller via the ulpi inte rface. full-speed or low-speed is supported through the on-chip full-speed phy. 21.5 pin description table 359. usb1 pin description function name direction description usb1_dp i/o usb1 bidirectional d+ line. usb1_dm i/o usb1 bidirectional d ? line. usb1_vbus i vbus pin (power on usb cable). usb1_vbus_en o vbus power enable. usb1_ind0 o port indicator led control output 0. usb1_ind1 o port indicator led control output 1. usb1_pwr_fault i port power fault signal indicating over-current condition; this signal monitors over-current on the usb bus (external circuitry required to detect over-current condition). ulpi pins ulpi_data[7:0] i/o ulpi link 8-bit bidirectional data bus timed on the rising clock edge. ulpi_stp o ulpi link stp signal. asserted to end or interrupt transfers to the phy. ulpi_nxt i ulpi link nxt signal. data flow control signal from the phy. ulpi_dir i ulpi link dir signal. controls the data bus direction. ulpi_clk i ulpi link clk signal. 60 mhz clock generated by the phy. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 439 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6 register description remark: for full-speed operation with on-chip fu ll-speed phy, the pads of the phy need to be configured. for c onfiguration of these pads see section 19.3.4 ?usb1 dp1/dm1 pins? . remark: for operations with an external phy connected through the ulpi interface the interface needs to be selected in th e pts bits of the portsc1 register ( section 21.6.15 ). table 360. register access abbreviations abbreviation description r/w read/write r/wc read/write one to clear r/wo read/write once ro read only wo write only table 361. register overview: usb1 host/device controller (register base address 0x4000 7000) name access address offset description reset value - - 0x000 - 0x0ff reserved device/host capability registers caplength ro 0x100 capability register length 0x0001 0040 hcsparams ro 0x104 host controller structural parameters 0x0001 0011 hccparams ro 0x108 host controller capability parameters 0x0000 0005 dciversion ro 0x120 device interface version number 0x0000 0001 dccparams ro 0x124 device controller capability parameters 0x0000 0184 - - 0x128 - 0x13c reserved device/host operat ional registers usbcmd_d r/w 0x140 usb command (device mode) 0x0004 0000 usbcmd_h r/w 0x140 usb command (host mode) 0x0004 00b0 usbsts_d r/w 0x144 usb status (device mode) 0x0000 0000 usbsts_h r/w 0x144 usb status (host mode) 0x0000 1000 usbintr_d r/w 0x148 usb interrupt enable (device mode) 0x0000 0000 usbintr_h r/w 0x148 usb interrupt enable (host mode) 0x0000 0000 frindex_d ro 0x14c usb frame index (device mode) 0x0000 0000 frindex_h r/w 0x14c usb frame index (host mode) 0x0000 0000 - - 0x150 reserved deviceaddr r/w 0x154 usb device address 0x0000 0000 periodiclistbase r/w 0x154 frame list base address 0x0000 0000 endpointlistaddr r/w 0x158 address of endpoint list in memory (device mode) 0x0000 0000 asynclistaddr r/w 0x158 address of endpoint list in memory (host mode) 0x0000 0000 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 440 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.1 device/host capability registers ttctrl r/w 0x15c asynchronous buffer status for embedded tt (host mode) 0x0000 0000 burstsize r/w 0x160 programmable burst size 0x0000 0000 txfilltuning r/w 0x164 host transmit pre-buffer packet tuning (host mode) 0x0000 0000 - - 0x168 - 0x16c reserved ulpiviewport r/w 0x170 ul pi viewport 0x0000 0000 binterval r/w 0x174 length of virtual frame 0x0000 0000 endptnak r/w 0x178 endpoint nak (device mode) 0x0000 0000 endptnaken r/w 0x17c endpoint nak e nable (device mode) 0x0000 0000 configflag ro 0x180 configured flag register 0x0000 0000 portsc1_d r/w 0x184 port 1 status/control (device mode) 0x0000 0000 portsc1_h r/w 0x184 port 1 status/control (host mode) 0x0000 0000 - - 0x188 - 0x1a0 - - - 0x1a4 - usbmode_d r/w 0x1a8 usb mode (device mode) 0x0000 0000 usbmode_h r/w 0x1a8 usb mode (host mode) 0x0000 0000 device endpoint registers endptsetupstat r/w 0x1ac endpoint setup status 0x0000 0000 endptprime r/w 0x1b0 endpoint initialization 0x0000 0000 endptflush r/w 0x1b4 endpoint de-initialization 0x0000 0000 endptstat ro 0x1b8 endpoint status 0x0000 0000 endptcomplete r/w 0x1bc endpoint complete 0x0000 0000 endptctrl0 r/w 0x1c0 endpoint control 0 0x0000 0000 endptctrl1 r/w 0x1c4 endpoint control 1 0x0000 0000 endptctrl2 r/w 0x1c8 endpoint control 2 0x0000 0000 endptctrl3 r/w 0x1cc endpoint control 3 0x0000 0000 table 361. register overview: usb1 host/device controller (register base address 0x4000 7000) ?continued name access address offset description reset value table 362. caplength register (caplength - address 0x4000 7100) bit description bit symbol description reset value access 7:0 caplength indicates offset to add to the register base address at the beginning of the operational register 0x40 ro 23:8 hciversion bcd encoding of the ehci revision number supported by this host controller. 0x100 ro 31:24 - these bits are reserved and should be set to zero. -- www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 441 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller table 363. hcsparams register (hcsparams - address 0x4000 7104) bit description bit symbol description reset value access 3:0 n_ports number of downstream ports. this field specifies the num ber of physical downstream ports implemented on this host controller. 0x1 ro 4 ppc port power control. this field indicates whether the host controller implementation includes port power control. 0x1 ro 7:5 - these bits are reserved and should be set to zero. -- 11:8 n_pcc number of ports per companion controller. this field indicates the number of ports supported per internal companion controller. 0x0 ro 15:12 n_cc number of companion controller. this field indicates the number of companion controllers associated with this usb2.0 host controller. 0x0 ro 16 pi port indicators. this bit indicates whether the ports support port indicator control. 0x1 ro 19:17 - these bits are reserved and should be set to zero. -- 23:20 n_ptt number of ports per transaction translator. this field indicates the number of ports assigned to each transaction translator within the usb2.0 host controller. 0x0 ro 27:24 n_tt number of transaction translators. this field indicates the number of embedded transaction translators associated with the usb2.0 host controller. 0x0 ro 31:28 - these bits are reserved and should be set to zero. -- www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 442 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.2 usb command register (usbcmd) the host/device controller executes the command indicated in this register. table 364. hccparams register (hccparams - address 0x4000 7108) bit description bit symbol description reset value access 0 adc 64-bit addressing capability. if zero, no 64-bit addressing capability is supported. 0ro 1 pfl programmable frame list flag. if set to one, then the system software can specify and use a smaller frame list and configure the host controller via the usbcmd register frame list size field. the frame list must always be aligned on a 4k-boundary. this requirement ensures that the frame list is always physically contiguous. 1ro 2 asp asynchronous schedule park capability. if this bit is set to a one, then the host controller supports the park feature for high-speed queue heads in the asynchronous schedule.the feature can be disabled or enabled and set to a specific level by using the asynchronous schedule park mode enable and asynchronous schedule park mode count fields in the usbcmd register. 1ro 7:4 ist isochronous scheduling threshold. this field indicates, relative to the current position of the executing host controller, where software can reliably update the isochronous schedule. 0ro 15:8 eecp ehci extended capabilities pointer. this optional field indicates the existence of a capabilities list. 0ro 31:9 - these bits are reserved and should be set to zero. - - table 365. dciversion register (dcivers ion - address 0x4000 7120) bit description bit symbol description reset value access 15:0 dciversion the device controller interface conforms to the two-byte bcd encoding of the interface version number contained in this register. 0x1 ro 31:16 - these bits are reserved and should be set to zero. -- table 366. dccparams (address 0x4000 7124) bit symbol description reset value access 4:0 den device endpoint number. 0x4 ro 6:5 - these bits are reserved and should be set to zero. - - 7 dc device capable. 0x1 ro 8 hc host capable. 0x1 ro 31:9 - these bits are reserved and should be set to zero. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 443 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.2.1 device mode table 367. usb command register in device mode (usbcmd_d - address 0x4000 7140) bit description bit symbol value description reset value access 0 rs run/stop 0 r/w 0 writing a 0 to this bit will cause a detach event. 1 writing a one to this bit will cause the device controller to enable a pull-up on usb_dp and initiate an attach event. this control bit is not directly connected to the pull-up enable, as the pull-up will become disabled upon transitioning into high-speed mode. software should use this bit to prevent an attach event before the device controller has been properly initialized. 1 rst controller reset. software uses this bit to reset the controller. this bit is set to zero by the host/device controller when the reset process is complete. software cannot terminate the reset process early by writing a zero to this register. 0r/w 0 set to 0 by hardware when the reset process is complete. 1 when software writes a one to this bit, the device controller resets its internal pipelines, timers, counters, state machines etc. to their initial values. writing a one to this bit when the device is in the attached state is not recommended, since the effect on an attached host is undefined. in order to ensure that the device is not in an attached state before initiating a device controller reset, all primed endpoints should be flushed and the usbcmd run/stop bit should be set to 0. 3:2 - not used in device mode. 0 - 4 - not used in device mode. 0 - 5 - not used in device mode. 0 - 6 - not used in device mode. writing a one to this bit when the device mode is selected, will have undefined results. -- 7 - - reserved. these bits should be set to 0. - - 9:8 - - not used in device mode. - - 10 - reserved.these bits should be set to 0. 0 - 11 - - not used in device mode. - 12 - reserved.these bits should be set to 0. 0 - 13 sutw setup trip wire during handling a setup packet, this bit is used as a semaphore to ensure that the setup data payload of 8 bytes is extracted from a qh by the dcd without being corrupted. if the setup lockout mode is off (see usbmode register) then there exists a hazard when new setup data arrives while the dcd is copying the setup data payload from the qh for a previous setup packet. this bit is set and cleared by software and will be cleared by hardware when a hazard exists. (see section 20.10 ). 0r/w 14 atdtw add dtd trip wire this bit is used as a semaphore to ensure the to proper addition of a new dtd to an active (primed) endpoint?s linked list. this bit is set and cleared by software during the process of adding a new dtd. see also section 20.10 . this bit shall also be cleared by hardware when its state machine is hazard region for which adding a dtd to a primed endpoint may go unrecognized. 0r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 444 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.2.2 host mode 15 fs2 not used in device mode. - - 23:16 itc interrupt threshold control. the system software uses this field to set the maximum rate at which the host/device controller will issue interrupts. itc contains the maximum interrupt interval measured in micro- frames. valid values are shown below. all other values are reserved. 0x0 = immediate (no threshold) 0x1 = 1 micro frame. 0x2 = 2 micro frames. 0x8 = 8 micro frames. 0x10 = 16 micro frames. 0x20 = 32 micro frames. 0x40 = 64 micro frames. 0x8 r/w 31:24 - reserved 0 table 367. usb command register in device mode (usbcmd_d - address 0x4000 7140) bit description ?continued bit symbol value description reset value access table 368. usb command register in host mode (usbcmd_h - address 0x4000 7140) bit description bit symbol value description reset value access 0 rs run/stop 0 r/w 0 when this bit is set to 0, the host controller completes the current transaction on the usb and then halts. the hc halted bit in the status register indicates when the host controller has finished the transaction and has entered the stopped state. software should not write a one to this field unless the host controller is in the halted state (i.e. hchalted in the usbsts register is a one). 1 when set to a 1, the host controller proceeds with the execution of the schedule. the host controller continues execution as long as this bit is set to a one. 1 rst controller reset. software uses this bit to reset the controller. this bit is set to zero by the host/device controller when the reset process is complete. software cannot terminate the reset process early by writing a zero to this register. 0r/w 0 this bit is set to zero by hardware when the reset process is complete. 1 when software writes a one to this bit, the host controller resets its internal pipelines, timers, counters, state machines etc. to their initial value. any transaction currently in progress on usb is immediately terminated. a usb reset is not driven on downstream ports. software should not set this bit to a one when the hchalted bit in the usbsts register is a zero. attempting to reset an actively running host controller will result in undefined behavior. 2 fs0 bit 0 of the frame list size bits. see table 369 . this field specifies the size of the frame list that controls which bits in the frame index register should be used for the frame list current index. note that this field is made up from usbcmd bits 15, 3, and 2. 0 3 fs1 bit 1 of the frame list size bits. see table 369 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 445 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 4 pse this bit controls whether the host controller skips processing the periodic schedule. 0r/w 0 do not process the periodic schedule. 1 use the periodiclistbase regi ster to access the periodic schedule. 5 ase this bit controls whether the host controller skips processing the asynchronous schedule. 0r/w 0 do not process the asynchronous schedule. 1 use the asynclistaddr to access the asynchronous schedule. 6 iaa this bit is used as a doorbell by software to tell the host controller to issue an interrupt the next time it advances asynchronous schedule. 0r/w 0 the host controller sets this bit to zero after it has se t the interrupt on sync advance status bit in the usbsts regi ster to one. 1 software must write a 1 to this bit to ring the doorbell. when the host controller has evict ed all appropriate cached schedule states, it sets the interrupt on async advance status bit in the usbsts register. if the interrupt on sync advance enable bit in the usbintr register is one, then the host controller will assert an interrupt at the next interrupt threshold. software should not write a one to this bit when the asynchronous schedule is inactive. doing so will yield undefined results. 7 - - reserved 0 9:8 asp1_0 asynchronous schedule park mode. contains a count of the number of successive transactions the host controller is allowed to execute from a high-speed queue head on the asynchronous schedule before continuing traversal of the asynchronous schedule. valid values are 0x1 to 0x3. remark: software must not write 00 to this bit when park mode enable is one as this will result in undefined behavior. 11 r/w 10 - - reserved. 0 - 11 aspe asynchronous schedule park mode enable 1 r/w 0 park mode is disabled. 1 park mode is enabled. 12 - - reserved. 0 - 13 - - not used in host mode. - 14 - - reserved. 0 - table 368. usb command register in host mode (usbcmd_h - address 0x4000 7140) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 446 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.3 usb status register (usbsts) this register indicates various states of the host/device controller and any pending interrupts. software sets a bit to zero in this register by writing a one to it. remark: this register does not indicate status resulting from a transaction on the serial bus. 15 fs2 bit 2 of the frame list size bits. see table 369 .0- 23:16 itc interrupt threshold control. the system software uses this field to set the maximum rate at which the host/device controller will issue interrupts. itc contains the maximum interrupt interval measured in micro-frames. valid values are shown below. all other values are reserved. 0x0 = immediate (no threshold) 0x1 = 1 micro frame. 0x2 = 2 micro frames. 0x8 = 8 micro frames. 0x10 = 16 micro frames. 0x20 = 32 micro frames. 0x40 = 64 micro frames. 0x8 r/w 31:24 - reserved 0 table 368. usb command register in host mode (usbcmd_h - address 0x4000 7140) bit description ?continued bit symbol value description reset value access table 369. frame list size values usbcmd bit 15 usbcmd bit 3 usbcmd bit 2 frame list size 0 0 0 1024 elements (4096 bytes) - default value 0 0 1 512 elements (2048 bytes) 0 1 0 256 elements (1024 bytes) 0 1 1 128 elements (512 bytes) 1 0 0 64 elements (256 bytes) 1 0 1 32 elements (128 bytes) 1 1 0 16 elements (64 bytes) 1 1 1 8 elements (32 bytes) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 447 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.3.1 device mode table 370. usb status register in device mode (usbsts_d - address 0x4000 7144) register bit description bit symbol value description reset value access 0 ui usb interrupt 0 r/wc 0 this bit is cleared by software writing a one to it. 1 this bit is set by the host/device controller when the cause of an interrupt is a completion of a usb transaction where the transfer descriptor (td) has an interrupt on complete (ioc) bit set. this bit is also set by the host/device controller when a short packet is detected. a short packet is when the actual number of bytes received was less than the expected number of bytes. 1 uei usb error interrupt 0 r/wc 0 this bit is cleared by software writing a one to it. 1 when completion of a usb transaction results in an error condition, this bit is set by the host/device controller. this bit is set along with the usbint bit, if the td on which the error interrupt occurred also had its interrupt on complete (ioc) bit set. the device controller detects resume signaling only (see section 20.10.11.6 ). 2 pci port change detect. 0 r/wc 0 this bit is cleared by software writing a one to it. 1 the device controller sets this bit to a one when the port controller enters the full or high-speed operational state. when the port controller exits the full or high-speed operation states due to reset or suspend events, the notification mechanisms are the usb reset received bit (uri) and the dcsuspend bits (sli) respectively. 3 - not used in device mode. 4 - 0 reserved. 5 - not used in device mode. 0 - 6 uri usb reset received 0 r/wc 0 this bit is cleared by software writing a one to it. 1 when the device controller detects a usb reset and enters the default state, this bit will be set to a one. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 448 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 7sri sof received 0r/wc 0 this bit is cleared by software writing a one to it. 1 when the device controller detects a start of (micro) frame, this bit will be set to a one. when a sof is extremely late, the device controller will automatically set this bit to indicate that an sof was expected. therefore, this bit will be set roughly every 1 ms in device fs mode and every 125 ? s in hs mode and will be synchronized to the actual sof that is received. since the device controller is initialized to fs before connect, this bit will be set at an interval of 1ms during the prelude to connect and chirp. 8 sli dcsuspend 0 r/wc 0 the device controller clears the bit upon exiting from a suspend state. this bit is cleared by software writing a one to it. 1 when a device controller enters a suspend state from an active state, this bit will be set to a one. 11:9 - - reserved. software should only write 0 to reserved bits. 0 12 - - not used in device mode. 0 13 - - not used in device mode. 0 14 - - not used in device mode. 0 15 - - not used in device mode. 0 16 naki nak interrupt bit 0 ro 0 this bit is automatically cleared by hardware when the all the enabled tx/rx endpoint nak bits are cleared. 1 it is set by hardware when for a particular endpoint both the tx/rx endpoint nak bit and the corresponding tx/rx endpoint nak enable bit are set. 17 - - reserved. software should only write 0 to reserved bits. 0- 18 - not used in device mode. 0 - 19 - not used in device mode. 0 - 31:20 - - reserved. software should only write 0 to reserved bits. - table 370. usb status register in device mode (usbsts_d - address 0x4000 7144) register bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 449 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.3.2 host mode table 371. usb status register in host mode (usbst s_h - address 0x4000 7144) register bit description bit symbol value description reset value access 0 ui usb interrupt (usbint) 0 r/wc 0 this bit is cleared by software writing a one to it. 1 this bit is set by the host/device controller when the cause of an interrupt is a completion of a usb transaction where the transfer descriptor (td) has an interrupt on complete (ioc) bit set. this bit is also set by the host/device controller when a short packet is detected. a short packet is when the actual number of bytes received was less than the expected number of bytes. 1 uei usb error interrupt (usberrint) 0 r/wc 0 this bit is cleared by software writing a one to it. 1 when completion of a usb transaction results in an error condition, this bit is set by the host/device controller. this bit is set along with the usbint bit, if the td on which the error interrupt occurred also had its interrupt on complete (ioc) bit set. 2 pci port change detect. 0 r/wc 0 this bit is cleared by software writing a one to it. 1 the host controller sets this bit to a one when on any port a connect status occurs, a port enable/disable change occurs, or the force port resume bit is set as the result of a j-k transition on the suspended port. 3 fri frame list roll-over 0 r/wc 0 this bit is cleared by software writing a one to it. 1 the host controller sets this bit to a one when the frame list index rolls over from its maximum value to zero. the exact value at which the rollover occurs depends on the frame list size. for example, if the frame list size (as programmed in the frame list size field of the usbcmd register) is 1024, the frame index register rolls over every time frindex [13] toggles. similarly, if the size is 512, the host controller sets this bit to a one every time frindex bit 12 toggles (see section 21.6.5 ). 4 - 0 reserved. 5 aai interrupt on async advance 0 r/wc 0 this bit is cleared by software writing a one to it. 1 system software can force the host controller to issue an interrupt the next time the host controller advances the asynchronous schedule by writing a one to the interrupt on async advance doorbell bit in the usbcmd register. this status bit indicates the assertion of that interrupt source. 6 - - not used by the host controller. 0 r/wc 7sri sof received 0r/wc 0 this bit is cleared by software writing a one to it. 1 in host mode, this bit will be set every 125 ? s and can be used by host controller driver as a time base. 8 sli - not used by the host controller. - - 11:9 - - reserved. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 450 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 12 hch hchalted 1 ro 0 the rs bit in usbcmd is set to zero. set by the host controller. 1 the host controller sets this bit to one after it has stopped executing because of the run/stop bit being set to 0, either by software or by the host controller hardware (e.g. because of an internal error). 13 rcl reclamation 0 ro 0 no empty asynchronous schedule detected. 1 an empty asynchronous schedule is detected. set by the host controller. 14 ps periodic schedule status this bit reports the current real status of the periodic schedule. the host controller is not required to immediately disable or enable the periodic schedule when software transitions the periodic schedule enable bit in the usbcmd register. when this bit and the periodic schedule enable bit are the same value, the periodic schedule is either enabled (if both are 1) or disabled (if both are 0). 0ro 0 the periodic schedule status is disabled. 1 the periodic schedule status is enabled. 15 as asynchronous schedule status this bit reports the current real status of the asynchronous schedule. the host controller is not required to immediately disable or enable the asynchronous schedule when software transitions the asynchronous schedule enable bit in the usbcmd register. when this bit and the asynchronous schedule enable bit are the same value, the asynchronous schedule is either enabled (if both are 1) or disabled (if both are 0). 0 0 asynchronous schedule status is disabled. 1 asynchronous schedule status is enabled. 16 - not used on host mode. 0 - 17 - reserved. 18 uai usb host asynchronous interrupt (usbhstasyncint) 0 r/wc 0 this bit is cleared by software writing a one to it. 1 this bit is set by the host controller when the cause of an interrupt is a completion of a usb transaction where the transfer descriptor (td) has an interrupt on comple te (ioc) bit set and the td was from the asynchronous schedule. this bit is also set by the host when a short packet is detected and the packet is on the asynchronous schedule. a short packet is when the actual number of bytes received was less than the expected number of bytes. 19 upi usb host periodic interrupt (usbhstperint) 0 r/wc 0 this bit is cleared by software writing a one to it. 1 this bit is set by the host controller when the cause of an interrupt is a completion of a usb transaction where the transfer descriptor (td) has an interrupt on complete (ioc) bit set and the td was from the periodic schedule. this bit is also set by the host controller when a short packet is detected and the packet is on the periodic schedule. a short packet is when the actual number of bytes received was less than the expected number of bytes. 31:20 - reserved. - - table 371. usb status register in host mode (usbst s_h - address 0x4000 7144) register bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 451 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.4 usb interrupt register (usbintr) the software interrupts are enabled with this register. an interrupt is generated when a bit is set and the corresponding interrupt is active. the usb status register (usbsts) still shows interrupt sources even if they are disabled by the usbintr register, allowing polling of interrupt events by the software. all interrupts must be acknowledged by software by clearing (that is writing a 1 to) the corresponding bit in the usbsts register. 21.6.4.1 device mode table 372. usb interrupt register in device mode (usbintr_d - address 0x4000 7148) bit description bit symbol description reset value access 0 ue usb interrupt enable when this bit is one, and the usbint bit in the usbsts r egister is one, the host/device controller will issue an interr upt at the next interr upt threshold. the interrupt is acknowledged by software clearing the usbint bit in usbsts. 0r/w 1 uee usb error interrupt enable when this bit is a one, and the usberrint bit in the usbst s register is a one, the host/device controller will issue an interr upt at the next interr upt threshold. the interrupt is acknowledged by software clearing the usberrint bit in the usbsts register. 0r/w 2 pce port change detect enable when this bit is a one, and the port chan ge detect bit in the usbsts register is a one, the host/device controller will issue an interrupt. the interrupt is acknowledged by software clearing the port change detect bit in usbsts. 0r/w 3 - not used by the device controller. 4- reserved 0- 5 - not used by the device controller. 6 ure usb reset enable when this bit is a one, and the usb reset received bit in the usbsts register is a one, the device controller will issue an interrupt. the interrupt is acknowledged by software clearing the usb reset received bit. 0r/w 7 sre sof received enable when this bit is a one, and the sof received bit in the u sbsts register is a one, the device controller will issue an interrupt. the interrupt is acknowledged by software clearing the sof received bit. 0r/w 8 sle sleep enable when this bit is a one, and the dcsuspend bit in the usbsts register transitions, the device controller will issue an interrupt. the interrupt is acknowledged by software writing a one to the dcsuspend bit. 0r/w 15:9 - reserved -- 16 nake nak interrupt enable this bit is set by software if it wants to enable the hardware interrupt for the nak interrupt bit. if both this bit and the corresponding nak interrupt bit are set, a hardware interrupt is generated. 0r/w 17 - reserved 18 uaie not used by the device controller. 19 upia not used by the device controller. 31:20 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 452 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.4.2 host mode table 373. usb interrupt register in host mode (usbintr_h - address 0x4000 7148) bit description bit symbol description access reset value 0 ue usb interrupt enable when this bit is one, and the usbint bit in the usbsts r egister is one, the host/device controller will issue an interr upt at the next interr upt threshold. the interrupt is acknowledged by software clearing the usbint bit in usbsts. r/w 0 1 uee usb error interrupt enable when this bit is a one, and the usberrint bit in the usbst s register is a one, the host/device controller will issue an interr upt at the next interr upt threshold. the interrupt is acknowledged by software clearing the usberrint bit in the usbsts register. r/w 0 2 pce port change detect enable when this bit is a one, and the port chan ge detect bit in the usbsts register is a one, the host/device controller will issue an interrupt. the interrupt is acknowledged by software clearing the port change detect bit in usbsts. r/w 0 3 fre frame list rollover enable when this bit is a one, and the frame list rollover bit in the usbsts register is a one, the host controller will issue an interrupt. the interrupt is acknowledged by software clearing the frame list rollover bit. 4 - reserved -0 5 aae interrupt on asynchronous advance enable when this bit is a o ne, and the interrupt on async ad vance bit in the usbsts register is a one, the host controller will issue an in terrupt at the next interrupt threshold. the interrupt is acknowledged by software clearing the interrupt on async advance bit. r/w 0 6 - not used by the host controller. - 0 7 sre if this bit is one and the sri bit in the usbsts register is one, the host controller will issue an interrupt. in host mode, the sri bit will be set every 125 ? s and can be used by the host controller as a time base. the interrupt is acknowledged by software clearing the sri bit in the usbsts register. -0 8 - not used by the host controller. - 0 15:9 - reserved 16 - not used by the host controller. r/w 0 17 - reserved 18 uaie usb host asynchronous interrupt enable when this bit is a one, and the usbhstasyncint bit in the usbsts register is a one, the host controller will issue an interrupt at the next interrupt threshold. the interrupt is acknowledged by software clearing the usbhstasyncint bit. r/w 0 19 upia usb host periodic interrupt enable when this bit is a one, and the usbhstperint bit in the usbsts register is a one, the host controller will issue an interrupt at the next interrupt threshold. the interrupt is acknowledged by software clearing the usbhstperint bit. r/w 0 31:20 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 453 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.5 frame index register (frindex) 21.6.5.1 device mode in device mode this register is read on ly, and the device controller updates the frindex[13:3] register from the frame number indicated by the sof marker. whenever a sof is received by the usb bus, frind ex[13:3] will be checked against the sof marker. if frindex[13:3] is different from the sof marker, frind ex[13:3] will be set to the sof value and frindex[2:0] will be set to zero (i.e. sof for 1 ms frame). if frindex [13:3] is equal to the sof value, frindex[2:0] will be incremented (i.e. sof for 125 ? s micro-frame) by hardware. 21.6.5.2 host mode this register is used by the host controller to index the periodic frame list. the register updates every 125 ? s (once each micro-frame). bits[n: 3] are used to select a particular entry in the periodic frame list during periodic schedule execution. the number of bits used for the index depends on the size of th e frame list as set by system software in the frame list size field in the usbcmd register. this register must be written as a dword. byte writes produce undefined results. this register cannot be written unle ss the host controller is in the 'halted' state as indicated by the hchalted bit in the usbsts register (hos t mode). a write to this register while the run/stop bit is set to a one produces undefined results. writes to this register also affect the sof value. table 374. usb frame index register in device mode (frindex_d - address 0x4000 714c) bit description bit symbol description reset value access 2:0 frindex2_0 current micro frame number - ro 13:3 frindex13_3 current frame number of the last frame transmitted -ro 31:14 - reserved - table 375. usb frame index register in host mode (frindex_h - address 0x4000 714c) bit description bit symbol description reset value access 2:0 frindex2_0 current micro frame number - r/w 12:3 frindex12_3 frame list current index for 1024 elements. -r/w 31:13 - reserved - table 376. number of bits used for the frame list index usbcmd bit 15 usbcmd bit 3 usbcmd bit 2 frame list size size of frindex12_3 bit field 0 0 0 1024 elements (4096 bytes). default value. 12 0 0 1 512 elements (2048 bytes) 11 0 1 0 256 elements (1024 bytes) 10 0 1 1 128 elements (512 bytes) 9 1 0 0 64 elements (256 bytes) 8 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 454 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.6 device address (devicea ddr) and periodic list base (periodiclistbase) registers 21.6.6.1 device mode the upper seven bits of this register repr esent the device address. after any controller reset or a usb reset, the device address is se t to the default address (0). the default address will match all incoming addresses. software shall reprogram the address after receiving a set_ad dress descriptor. the usbadra bit is used to accelerate the set_address sequence by allowing the dcd to preset the usbadr register bits be fore the status phase of the set_address descriptor. 21.6.6.2 host mode this 32-bit register contains the beginning address of the periodic frame list in the system memory. the host controlle r driver (hcd) loads this regi ster prior to starting the schedule execution by the host controller. the memory structure referenced by this 1 0 1 32 elements (128 bytes) 7 1 1 0 16 elements (64 bytes) 6 1 1 1 8 elements (32 bytes) 5 table 376. number of bits used for the frame list index usbcmd bit 15 usbcmd bit 3 usbcmd bit 2 frame list size size of frindex12_3 bit field table 377. usb device address register in device mode (deviceaddr - address 0x4000 7154) bit description bit symbol value description reset value access 23:0 - reserved 0 - 24 usbadra device address advance 0 any write to usbadr are instantaneous. 1 when the user writes a one to this bit at the same time or before usbadr is written, the write to usbadr fields is staged and held in a hidden register. after an in occurs on endpoint 0 and is acknowledged, usbadr will be loaded from the holding register. hardware will automatically clear this bit on the following conditions: ? in is acked to endpoint 0. usbadr is updated from the staging register. ? out/setup occurs on endpoint 0. usbadr is not updated. ? device reset occurs. usbadr is set to 0. remark: after the status phase of the set_address descriptor, the dcd has 2 ms to program the usbadr field. this mechanism will ensure this specification is met when the dcd can not write the device address within 2 ms from the set_address stat us phase. if the dcd writes the usbadr with usbadra=1 after the set_address data phase (before the prime of the status phase), the usbadr will be programmed instantly at the correct time and meet the 2 ms usb requirement. 31:25 usbadr usb device address 0 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 455 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller physical memory pointer is assumed to be 4 kb aligned. the contents of this register are combined with the frame index register (fri ndex) to enable the host controller to step through the periodic frame list in sequence. 21.6.7 endpoint list address re gister (endpointlistaddr) and asynchronous list address (asynclistaddr) registers 21.6.7.1 device mode in device mode, this register contains the addr ess of the top of the endpoint list in system memory. bits[10:0] of this r egister cannot be m odified by the system software and will always return a zero when read.the memory structure referenced by this physical memory pointer is assumed 64 byte aligned. 21.6.7.2 host mode this 32-bit register contains the address of the next asynchronous queue head to be executed by the host. bits [4:0] of this regist er cannot be modified by the system software and will always return a zero when read. 21.6.8 tt control register (ttctrl) 21.6.8.1 device mode this register is not used in device mode. table 378. usb periodic list base register in host mode (periodiclistbase - address 0x4000 7154) bit description bit symbol description reset value access 11:0 - reserved n/a - 31:12 perbase31_12 base address (low) these bits correspond to the memory address signals[31:12]. n/a r/w table 379. usb endpoint list address register in de vice mode (endpointlistaddr - address 0x4000 7158) bit description bit symbol description reset value access 10:0 - reserved 0 - 31:11 epbase31_11 endpoint list pointer (low) these bits correspond to memory address signals 31:11, respectively. this field will reference a list of up to 4 queue heads (qh). (i.e. one queue head per endpoint and direction.) n/a r/w table 380. usb asynchronous list address register in host mode (asynclistaddr- address 0x4000 7158) bit description bit symbol description reset value access 4:0 - reserved 0 - 31:5 asybase31_5 link pointer (low) lpl these bits correspond to memory address signals 31:5, respectively. this field may only reference a queue head (oh). -r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 456 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.8.2 host mode this register contains parameters needed for in ternal tt operations. this register is used by the host controller only. writes must be in dwords. 21.6.9 burst size register (burstsize) this register is used to control and dynami cally change the burst size used during data movement on the master interface of the usb dma controller. writes must be in dwords. the default for the length of a burst of 32-bit words for rx and tx dma data transfers is 16 words each. 21.6.10 transfer buffer fill t uning register (txfilltuning) 21.6.10.1 device controller this register is not used in device mode. 21.6.10.2 host controller the fields in this register control perf ormance tuning associated with how the host controller posts data to the tx latency fifo before moving the data onto the usb bus. the specific areas of performance include the how much data to post into the fifo and an estimate for how long that operation should take in the target system. definitions: t 0 = standard packet overhead t 1 = time to send data payload t ff = time to fetch packet into tx fifo up to specified level t s = total packet flight time (send-only) packet; t s = t 0 + t 1 t p = total packet time (fetch and send) packet; t p = t ff + t 0 + t 1 table 381. usb tt control register in host mode (ttctrl - address 0x4000 715c) bit description bit symbol description reset value access 23:0 - reserved. 0 - 30:24 ttha hub address when fs or ls device are connected directly. n/a r/w 31 - reserved. 0 table 382. usb burst size register in device/host mode (burstsize - ad dress 0x4000 7160) bit description bit symbol description reset value access 7:0 rxpburst programmable rx burst length this register represents the maximum length of a burst in 32-bit words while moving data from the usb bus to system memory. 0x10 r/w 15:8 txpburst programmable tx burst length this register represents the maximum length of a burst in 32-bit words while moving data from system memory to the usb bus. 0x10 r/w 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 457 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller upon discovery of a transmit (out/setup) pack et in the data structures, host controller checks to ensure t p remains before the end of the (micro) frame. if so it proceeds to pre-fill the tx fifo. if at an ytime during the pre-fill operati on the time remaining the [micro]frame is < t s then the packet attempt ceases and the packet is tried at a later time. although this is not an erro r condition and the host controller will ev entually recover, a mark will be made the scheduler health coun ter to note the occurr ence of a ?backoff? event. when a back-off event is detected, t he partial packet fetched may need to be discarded from the latency buff er to make room for periodic traffic that will begin after the next sof. too many back-off events can waste bandwidth and power on the system bus and thus should be minimized (not necessar ily eliminated). backoffs can be minimized with use of the tschhealth (t ff ) described below. 21.6.11 usb ulpi viewport register (ulpiviewport) the register provides indirect access to th e ulpi phy register set. although the core performs access to the ulpi phy register set, there may be extraordinary circumstances where software may need direct access. table 383. usb transfer buffer fill tuning register in host mode (txfilltuning - address 0x4000 7164) bit description bit symbol description reset value access 7:0 txschoh fifo burst threshold this register controls the number of data bursts that are posted to the tx latency fifo in host mode before the packet begins on to the bus. the minimum value is 2 and this value should be a low as possible to maximize usb performance. a higher value can be used in systems with unpredictable latency and/or insufficient bandwidth where the fifo may underrun because the data transferred from the latency fifo to usb occurs before it can be replenished from system memory. this value is ignored if the stream disable bit in usbmode register is set. 0x2 r/w 12:8 txscheatlth scheduler health counter this register increments when the host controller fails to fill the tx latency fifo to the level programmed by txfifothres before running out of time to send the packet before the next start-of-frame . this health counter measures the number of times this occurs to provide feedback to selecting a proper txschoh. writing to this register will clear the counter. the maximum value is 31. 0x0 r/w 15:13 - reserved - - 21:16 txfifothres scheduler overhead this register adds an additional fixed offset to the schedule time estimator described above as t ff . as an approximation, the value chosen for this register should limit the number of back-off events captured in the txschhealth to less than 10 per second in a highly utilized bus. choosing a value that is too high for this register is not desired as it can needlessly reduce usb utilization. the time unit represented in this register is 1.267 ? s when a device is connected in high-speed mode. the time unit represented in this register is 6.333 ? s when a device is connected in low/full speed mode. 0x0 r/w 31:22 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 458 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller remark: writes to the ulpi through th e viewport can substantially harm standard usb operations. cu rrently no usage model has been defined where software should n eed to execute writes directly to the ulpi ? see exception regarding optional features below. remark: executing read operations though the ulpi viewport should have no harmful side effects to standard usb operations. there are two operations that can be performe d with the ulpi viewport, wakeup and read /write operations. the wakeup operation is used to put the ulpi interface into normal operation mode and reenable the clock if necessary. a wakeup operation is required before accessing the registers when the ulpi interface is operating in low power mode, serial mode, or carkit mode. the ulpi state can be determined by reading the sync. state bit (ulpiss). if this bit is a one, then ulpi interface is running in normal operation mode and can accept read/write operations. if the ulpiss indicates a 0 then then read/write operations will not be able execute. undefined behavior will result if ulpiss = 0 and a read or write operation is performed. to exec ute a wakeup operation, write all 32-bits of the ulpi viewport where ulpiport is constr ucted appropriately and the ulpiwu bit is a 1 and ulpirun bit is a 0. poll the ulpi viewpor t until ulpiwu is zero for the operation to complete. to execute a read or write operation, write all 32-bits of the ulpi viewport where ulpidatwr, ulpiaddr, ulpi port, ulpirw are construc ted appropriately and the ulpirun bit is a 1. poll the ulpi viewport until ulpirun is zero for the operation to complete. once ulpirun is ze ro, the ulpidatrd will be va lid if the operation was a read. the polling method above could also be repl aced and interrupt driven using the ulpi interrupt defin ed in the usbsts and usbi ntr registers. when a wakeup or read/write operation complete, the ulpi interrupt will be set. table 384. usb ulpi viewport register (ulpiv iewport - address 0x4000 7170) bit description bit symbol value description access reset value 7:0 ulpidatwr when a write operation is commanded, the data to be sent is written to this field. r/w 0 15:8 ulpidatrd after a read operation completes, the result is placed in this field. r 0 23:16 ulpiaddr when a read or write operation is commanded, the address of the operation is written to this field. r/w 0 26:24 ulpiport for the wakeup or read/write operation to be executed, this value must be written as 0. r/w 000 27 ulpiss ulpi sync state. this bit represents the state of the ulpi interface. r 0 0 in another state (ie. carkit, serial, low power) 1 normal sync. state. 28 - - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 459 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.12 binterval register this register defines the binterval value which determines the length of the virtual frame (see section 20.7.7 ). 21.6.13 usb endpoint nak register (endptnak) 21.6.13.1 device mode this register indicates when the device se nds a nak handshake on an endpoint. each tx and rx endpoint has a bit in the eptn and eprn field respectively. a bit in this register is cleared by writing a 1 to it. 29 ulpirw ulpi read/write control. this bit selects between running a read or write operation. r/w 0 0read 1write 30 ulpirun ulpi read/write run. writing the 1 to this bit will begin the read/write operation. the bit will automatically transition to 0 after the read/write is complete. once this bit is set, the driver can not set it back to 0. remark: the driver must never executue a wakeup and a read/write operation at the same time. r/w - 31 ulpiwu ulpi wake-up. writing the 1 to this bit will begin the wakeup operation. the bit will automatically transition to 0 after the wakeup is complete. once this bit is set, the driver can not set it back to 0. remark: the driver must never executue a wakeup and a read/write operation at the same time. r/w 0 table 384. usb ulpi viewport register (ulpiv iewport - address 0x4000 7170) bit description ?continued bit symbol value description access reset value table 385. usb binterval register (binterval - addr ess 0x4000 7174) bit description in device/host mode bit symbol description reset value access 3:0 bint binterval value 0x00 r/w 31:4 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 460 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.13.2 host mode this register is not used in host mode. 21.6.14 usb endpoint nak enable register (endptnaken) 21.6.14.1 device mode each bit in this register enables the corres ponding bit in the endptnak register. each tx and rx endpoint has a bit in the eptne and eprne field respectively. table 386. usb endpoint nak register in device mode (endptnak - address 0x4000 7178) bit description bit symbol description reset value access 3:0 eprn rx endpoint nak each rx endpoint has one bit in this field. the bit is set when the device sends a nak handshake on a received out or ping token for the corresponding endpoint. bit 3 corresponds to endpoint 3. ... bit 1 corresponds to endpoint 1. bit 0 corresponds to endpoint 0. 0x00 r/wc 15:6 - reserved - - 19:16 eptn tx endpoint nak each tx endpoint has one bit in this field. the bit is set when the device sends a nak handshake on a received in token for the corresponding endpoint. bit 3 corresponds to endpoint 3. ... bit 1 corresponds to endpoint 1. bit 0 corresponds to endpoint 0. 0x00 r/wc 31:20 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 461 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.14.2 host mode this register is not used in host mode. 21.6.15 port status and c ontrol register (portsc1) 21.6.15.1 device mode the device controller implements one port regi ster, and it does not support power control. port control in device mode is used for stat us port reset, suspend, and current connect status. it is also used to initiate test mode or force signaling. this re gister allows software to put the phy into low-power suspend mode and disable the phy clock. table 387. usb endpoint nak enable register in d evice mode (endptnaken - address 0x4000 717c) bit description bit symbol description reset value access 3:0 eprne rx endpoint nak enable each bit enables the corresponding rx nak bit. if this bit is set and the corresponding rx endpoint nak bit is set, the nak interrupt bit is set. bit 3 corresponds to endpoint 3. ... bit 1 corresponds to endpoint 1. bit 0 corresponds to endpoint 0. 0x00 r/w 15:4 - reserved - - 19:16 eptne tx endpoint nak each bit enables the corresponding tx nak bit. if this bit is set and the corresponding tx endpoint nak bit is set, the nak interrupt bit is set. bit 3 corresponds to endpoint 3. ... bit 1 corresponds to endpoint 1. bit 0 corresponds to endpoint 0. 0x00 r/w 31:20 - reserved - - table 388. port status and control register in device mode (portsc1_d - address 0x4000 7184) bit description bit symbol value description reset value access 0 ccs current connect status 0 ro 0 device not attached a zero indicates that the device did no t attach successfully or was forcibly disconnected by the software writing a zero to the run bit in the usbcmd register. it does not state the device being disconnected or suspended. 1 device attached. a one indicates that the device successfully attached and is operating in either high-speed mode or full-speed mode as indicated by the high speed port bit in this register. 1 csc - not used in device mode 0 - 2 pe 1 port enable. this bit is always 1. the device port is always enabled. 1ro www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 462 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 3 pec 0 port enable/disable change this bit is always 0. the device port is always enabled. 0ro 5:4 - - reserved 0 ro 6 fpr force port resume after the device has been in suspend state for 5 ms or more, software must set this bit to one to drive resume signaling before clearing. the device controller will set this bit to one if a j-to-k transition is detected while the port is in the suspend state. the bit will be cleared when the device returns to normal operation. when this bit transitions to a one because a j-to-k transition detected, the port change detect bit in the usbsts register is set to one as well. 0r/w 0 no resume (k-state) detected/driven on port. 1 resume detected/driven on port. 7 susp suspend in device mode, this is a read-only status bit . 0ro 0 port not in suspend state 1 port in suspend state 8pr port reset in device mode, this is a read-only status bit. a device reset from the usb bus is also indicated in the usbsts register. 0ro 0 port is not in the reset state. 1 port is in the reset state. 9 hsp high-speed status remark: this bit is redundant with bits 27:26 (pspd) in this register. it is implemented for compatibility reasons. 0ro 0 host/device connected to the port is not in high-speed mode. 1 host/device connected to the port is in high-speed mode. 11:10 ls - not used in device mode. 12 pp - not used in device mode. 13 - - reserved - - 15:14 pic1_0 port indicator control writing to this field effects the value of the usb1_ind1:0 pins. 00 r/w 0x0 port indicators are off. 0x1 amber 0x2 green 0x3 undefined table 388. port status and control register in device mode (portsc1_d - address 0x4000 7184) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 463 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 19:16 ptc3_0 port test control any value other than 0000 indicates that the port is operating in test mode. the force_enable_fs and force enable_ls are extensions to the test mode support specified in the ehci specification. writing the ptc field to any of the force_enable_hs/fs/ls values will force the port into the connected and enabled state at the selected speed. writing the ptc field back to test_mode_disable will allow the port st ate machines to progress normally from that point. values 0x7 to 0xf are reserved. 0000 r/w 0x0 test_mode_disable 0x1 j_state 0x2 k_state 0x3 se0 (host)/nak (device) 0x4 packet 0x5 force_enable_hs 0x6 force_enable_fs 20 - - not used in device mode. this bit is always 0 in device mode. 0 - 21 - - not used in device mode. this bit is always 0 in device mode. 0 - 22 - not used in device mode. this bit is always 0 in device mode. 0 - 23 phcd phy low power suspe nd - clock disable (plpscd) in device mode, the phy can be put into low power suspend ? clock disable when the device is not running (usbcmd run/stop = 0) or the host has signaled suspend (portsc suspend = 1). low power suspend will be cleared automatically when the host has signaled resume. before forcing a resume from the device, the device controller driver must clear this bit. 0r/w 0 writing a 0 enables the phy clock. reading a 0 indicates the status of the phy clock (enabled). 1 writing a 1 disables the phy clock. reading a 1 indicates the status of the phy clock (disabled). 24 pfsc port force full speed connect 0 r/w 0 port connects at any speed. 1 writing this bit to a 1 will force the port to only connect at full speed. it disables the chirp sequence that allows the port to identify itself as high-speed. this is useful for testing fs configurations with a hs host, hub or device. 25 - - reserved 27:26 pspd port speed this register field indicates the speed at which the port is operating. 0ro 0x1 full-speed 0x2 invalid in device mode 0x3 high-speed 29:28 - - reserved - - 31:30 pts parallel transceiver select. all other values are reserved. r/w 0x2 ulpi 0x3 serial/ 1.1 phy (full-speed only) table 388. port status and control register in device mode (portsc1_d - address 0x4000 7184) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 464 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.15.2 host mode the host controller uses one port. the register is only reset when po wer is initially applied or in response to a cont roller reset. the initial c onditions of the port are: ? no device connected ? port disabled if the port has power control, this state remains until software applies power to the port by setting port power to one in the portsc register. table 389. port status and control register in host mode (portsc1_h - address 0x4000 7184) bit description bit symbol value description reset value access 0 ccs current connect status this value reflects the current state of the port and may not correspond directly to the event that caused the csc bit to be set. this bit is 0 if pp (port power bit) is 0. software clears this bit by writing a 1 to it. 0r/wc 0 no device is present. 1 device is present on the port. 1 csc connect status change indicates a change has occurred in the port?s current connect status. the host/device controller sets this bit for all changes to the port device connect status, even if system software has no t cleared an existing connect status change. for example, the insertion status changes twice before system software has cleared the changed condition, hub hardware will be ?setting? an already-set bit (i.e., the bit will remain set). software clears this bit by writing a one to it. this bit is 0 if pp (port power bit) is 0 0r/wc 0 no change in current status. 1 change in current status. 2 pe port enable. ports can only be enabled by the host controller as a part of the reset and enable. software cannot enable a port by writing a one to this field. ports can be disabled by either a fault condition (disconnect event or other fault condition) or by the host software. note that the bit status does not change until the port state actually changes. there may be a delay in disabling or enabling a port due to other host controller and bus events. when the port is disabled. downstream propagation of data is blocked except for reset. this bit is 0 if pp (port power bit) is 0. 0r/w 0 port disabled. 1 port enabled. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 465 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 3 pec 0 port disable/enable change for the root hub, this bit gets set to a one only when a port is disabled due to disconnect on the port or due to the appropriate conditions existing at the eof2 point (see chapter 11 of the usb specification ). software clears this by writing a one to it. this bit is 0 if pp (port power bit) is 0, 0r/wc 0 no change. 1 port enabled/disabled status has changed. 4 oca over-current active this bit will automatically transition from 1 to 0 when the over-current condition is removed. 0ro 0 the port does not have an over-current condition. 1 the port has currently an over-current condition. 5 occ over-current change this bit gets set to one when there is a change to over-current active. software clears this bit by writing a one to this bit position. 0r/wc 6 fpr force port resume software sets this bit to one to drive resume signaling. the host controller sets this bit to one if a j-to-k transition is detected while the port is in the suspend state. when this bit tran sitions to a one because a j-to-k transition is detected , the port change detect bi t in the usbsts register is also set to one. this bit will automatically change to zero after the resume sequence is complete. this behavior is different from ehci where the host controller driver is required to set this bit to a zero after the resume duration is timed in the driver. note that when the host controller owns the port, the resume sequence follows the defined sequence documented in the usb specification revision 2.0. the resume signaling (full-speed ?k?) is driven on the port as long as this bit remains a one. this bit will remain a one until the port has switched to the high-speed idle. writing a zero has no affect because the port controller will time the resume operation clear the bit the port control state switches to hs or fs idle. this bit is 0 if pp (port power bit) is 0. 0r/w 0 no resume (k-state) detected/driven on port. 1 resume detected/driven on port. table 389. port status and control register in host mode (portsc1_h - address 0x4000 7184) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 466 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 7 susp suspend together with the pe (port enabled bit), this bit describes the port states, see table 390 ? port states as described by the pe and susp bits in the portsc1 register ? . the host controller will unconditionally set this bit to zero when software sets the force port resume bit to zero. the host controller ignores a write of zero to this bit. if host software sets this bit to a one when the port is not enabled (i.e. port enabled bit is a zero) the results are undefined. this bit is 0 if pp (port power bit) is 0. 0r/w 0 port not in suspend state 1 port in suspend state when in suspend state, downstream propagation of data is blocked on this port, except for port reset. the blocking occurs at the end of the current transaction if a transaction was in progress when this bit was written to 1. in the suspend state, the port is sensitive to resume detection. note that the bit status does not change until the port is suspended and that there may be a delay in suspending a port if there is a transaction currently in progress on the usb. 8pr port reset when software writes a one to this bit the bus-reset sequence as defined in the usb specification revision 2.0 is started. this bit will automatically change to zero after the reset sequence is complete. this behavior is different from ehci where the host contro ller driver is required to set this bit to a zero after the reset duration is timed in the driver. this bit is 0 if pp (port power bit) is 0. 0r/w 0 port is not in the reset state. 1 port is in the reset state. 9 hsp high-speed status 0 ro 0 host/device connected to the port is not in high-speed mode. 1 host/device connected to the port is in high-speed mode. 11:10 ls line status these bits reflect the current logical levels of the usb_dp and usb_dm signal lines. usb_dp corresponds to bit 11 and usb_dm to bit 10. in host mode, the use of linestate by the host controller driver is not necessary for this controller (unlike ehci) because the controller hardware manages the connection of ls and fs. 0x3 ro 0x0 se0 (usb_dp and usb_dm low) 0x1 j-state (usb_dp high and usb_dm low) 0x2 k-state (usb_dp low and usb_dm high) 0x3 undefined table 389. port status and control register in host mode (portsc1_h - address 0x4000 7184) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 467 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 12 pp - port power control host controller requires port power control switches. this bit represents the current setting of the switch (0=off, 1=on). when power is not available on a port (i.e. pp equals a 0), the port is non-functional and will not report attaches, detaches, etc. when an over-current condition is detected on a powered port and ppc is a one, the pp bit in each affected port may be transitioned by the host controller driver from a one to a zero (removing power from the port). 0r/w 0 port power off. 1 port power on. 13 - - reserved 0 - 15:14 pic1_0 port indicator control writing to this field controls the value of the pins usb1_ind1 and usb1_ind0. 00 r/w 0x0 port indicators are off. 0x1 amber 0x2 green 0x3 undefined 19:16 ptc3_0 port test control any value other than 0000 indicates that the port is operating in test mode. the force_enable_fs and force enable_ls are extensions to the test mode support specified in the ehci specification. writing the ptc field to any of the force_enable_{hs/fs/ls} values will force the port into the connected and enabled state at the selected speed. writing the ptc field back to test_mode_disable will allow the port st ate machines to progress normally from that point. values 0x8 to 0xf are reserved. 0000 r/w 0x0 test_mode_disable 0x1 j_state 0x2 k_state 0x3 se0 (host)/nak (device) 0x4 packet 0x5 force_enable_hs 0x6 force_enable_fs 0x7 force_enable_ls 20 wkcn wake on connect enable (wkcnnt_e) this bit is 0 if pp (port power bit) is 0 0r/w 0 disables the port to wake up on device connects. 1 writing this bit to a one enables the port to be sensitive to device connects as wake-up events. table 389. port status and control register in host mode (portsc1_h - address 0x4000 7184) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 468 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21 wkdc wake on disconnect enable (wkdscnnt_e) this bit is 0 if pp (port power bit) is 0. 0r/w 0 disables the port to wake up on device disconnects. 1 writing this bit to a one enables the port to be sensitive to device disconnects as wake-up events. 22 wkoc wake on over-current enable (wkoc_e) 0 r/w 0 disables the port to wake up on over-current events. 1 writing a one to this bit enabled the port to be sensitive to over-current conditions as wake-up events. 23 phcd phy low power suspe nd - clock disable (plpscd) in host mode, the phy can be put into low power suspend ? clock disable when the downstream device has been put into suspend mode or when no downstream device is connected. low power suspend is completely under the control of software. 0r/w 0 writing a 0 enables the phy clock. reading a 0 indicates the status of the phy clock (enabled). 1 writing a 1 disables the phy clock. reading a 1 indicates the status of the phy clock (disabled). 24 pfsc port force full speed connect 0 r/w 0 port connects at any speed. 1 writing this bit to a 1 will force the port to only connect at full speed. it disables the chirp sequence that allows the port to identify itself as high speed. this is useful for testing fs configurations with a hs host, hub or device. 25 - - reserved 27:26 pspd port speed this register field indicates the speed at which the port is operating. for hs mode operation in the host controller and hs/fs operation in the device controller the port routing steers data to the protocol engine. for fs and ls mode operation in the host controller, the port routing steers data to the protocol engine w/ embedded transaction translator. 0ro 0x0 full-speed 0x1 low-speed 0x2 high-speed 29:28 - - reserved - - 31:30 pts parallel transceiver select. all other values are reserved. r/w 0x2 ulpi 0x3 serial/ 1.1 phy (full-speed only) table 389. port status and control register in host mode (portsc1_h - address 0x4000 7184) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 469 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.16 usb mode register (usbmode) the usbmode register sets the usb mode for the usb controller. the possible modes are device, host, and idle mode. 21.6.16.1 device mode table 390. port states as described by the pe and susp bits in the portsc1 register pe bit susp bit port state 0 0 or 1 disabled 1 0 enabled 1 1 suspend table 391. usb mode register in device mode (usbmode_d - address 0x4000 71a8) bit description bit symbol value description reset value access 1:0 cm1_0 controller mode the controller defaults to an idle state and needs to be initialized to the desired operating mode after reset. this register can only be written once after reset. if it is necessary to sw itch modes, softwa re must reset the controller by writing to the reset bit in the usbcmd register before reprogramming this register. 00 r/ wo 0x0 idle 0x1 reserved 0x2 device controller 0x3 host controller 2 es endian select this bit can change the byte ordering of the transfer buffers to match the host microprocessor bus architecture. the bit fields in the microprocessor interface and the dma data structures (including the setup buffer within the device qh) are unaffected by the value of this bit, because they are based upon 32-bit words. 0r/w 0 little endian: first byte referenced in least significant byte of 32-bit word. 1 big endian: first byte referenced in most significant byte of 32-bit word. 3 slom setup lockout mode in device mode, this bit controls behavior of the setup lock mechanism. see section 20.10.8 . 0r/w 0 setup lockouts on 1 setup lockouts off (dcd requires the use of setup buffer tripwire in usbcmd) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 470 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.16.2 host mode 4 sdis stream disable mode remark: the use of this feature substantially limits the overall usb performance that can be achieved. 0r/w 0 not disabled 1 disabled. setting this bit to one disables double priming on both rx and tx for low bandwidth systems. this mode ensures that when the rx and tx buffers are sufficient to contain an entire packet that the standard double buffering scheme is disabled to prevent overruns/underruns in bandwidth limited systems. note: in high speed mode, all packets received will be responded to with a nyet handshake when stream disable is active. 5 - not used in device mode. 0 - 31:6 - - reserved table 391. usb mode register in device mode (usbmode_d - address 0x4000 71a8) bit description ?continued bit symbol value description reset value access table 392. usb mode register in host mode (u sbmode_h - address 0x4000 71a8) bit description bit symbol value description reset value access 1:0 cm1_0 controller mode the controller defaults to an idle state and needs to be initialized to the desired operating mode after reset. this register can only be written once after reset. if it is necessary to sw itch modes, softwa re must reset the controller by writing to the reset bit in the usbcmd register before reprogramming this register. 00 r/ wo 0x0 idle 0x1 reserved 0x2 device controller 0x3 host controller 2 es endian select this bit can change the byte ordering of the transfer buffers. the bit fields in the microprocessor interface and the dma data structures (including the setup buffer within the device qh) are unaffected by the value of this bit, because they are based upon 32-bit words. 0r/w 0 little endian: first byte referenced in least significant byte of 32-bit word. 1 big endian: first byte referenced in most significant byte of 32-bit word. 3 - not used in host mode 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 471 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.17 usb endpoint setup st atus register (endpsetupstat) 21.6.18 usb endpoint prim e register (endptprime) for each endpoint, software should write a one to the corresponding bit whenever posting a new transfer descriptor to an endpoint. hardwa re will automatically us e this bit to begin parsing for a new transfer descriptor from the queue head and prepare a receive buffer. hardware will clear this bit when the associated endpoint(s) is (are) successfully primed. remark: these bits will be momentarily set by hardware during hardware endpoint re-priming operations when a dtd is retired and the dqh is updated. 4 sdis stream disable mode remark: the use of this feature substantially limits the overall usb performance that can be achieved. 0r/w 0 not disabled 1 disabled. setting to a 1 ensures that overruns/underruns of the latency fifo are eliminated for low bandwidth systems where the rx and tx buffers are sufficient to contain the entire packet. enabling stream disable also has the effect of ensuring the the tx latency is filled to capacity before the packet is launched onto the usb. note: time duration to pre-fill the fi fo becomes significant when stream disable is active. see txfilltuning to characterize the adjustments needed for the scheduler when using this feature. 5 vbps vbus power select 0 r/wo 0 vbus_pwr_select is set low. 1 vbus_pwr_select is set high 31:6 - - reserved - - table 392. usb mode register in host mode (u sbmode_h - address 0x4000 71a8) bit description ?continued bit symbol value description reset value access table 393. usb endpoint setup status register (endp tsetupstat - address 0x4000 71ac) bit description bit symbol description reset value access 3:0 endpt setup stat setup endpoint status for logical endpoints. for every setup transaction that is received, a corresponding bit in this register is set to one. software must clear or acknowledge the setup transfer by writing a one to a respective bit after it has read the setup data from queue head. the response to a setup packet as in the order of operations and total response time is crucial to limit bus time outs while the setup lockout mechanism is engaged. 0r/wc 31:4 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 472 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.19 usb endpoint flus h register (endptflush) writing a one to a bit(s) in this register wi ll cause the associated endpoint(s) to clear any primed buffers. if a packet is in progress for one of the associated endpoints, then that transfer will continue until completion. hardware will clear this register after the endpoint flush operation is successful. table 394. usb endpoint prime register (endptprime - address 0x4000 71b0) bit description bit symbol description reset value access 3:0 perb prime endpoint receive buffer for physical out endpoints. for each out endpoint, a corresponding bit is set to 1 by software to request a buffer be prepared for a receive operation for when a usb host initiates a usb out transaction. software should write a one to the corresponding bit whenever posting a new transfer descriptor to an endpoint. hardware will automatically use this bit to begin parsing for a new transfer descriptor from the queue head and prepare a receive buffer. hardware will clear this bit when the associated endpoint(s) is (are) successfully primed. perb0 = endpoint 0 ... perb3 = endpoint 3 0r/ws 15:4 - reserved - - 19:16 petb prime endpoint transmit buffer for physical in endpoints. for each in endpoint a corresponding bit is set to one by software to request a buffer be prepared for a transmit operation in order to respond to a usb in/interrupt transaction. software shoul d write a one to the corresponding bit when posting a new transfer descriptor to an endpoint. hardware will automatically use this bit to begin parsing for a new transfer descriptor from the queue head and prepare a transmit buffer. hardware will clear this bit when the associated endpoint(s) is (are) successfully primed. petb0 = endpoint 0 ... petb3 = endpoint 3 0r/ws 31:20 - reserved - - table 395. usb endpoint flush register (endptf lush - address 0x4000 71b4) bit description bit symbol description reset value access 3:0 ferb flush endpoint receive buffer for physical out endpoints. writing a one to a bit(s) will clear any primed buffers. ferb0 = endpoint 0 ... ferb3 = endpoint 3 0r/ws www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 473 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 21.6.20 usb endpoint stat us register (endptstat) one bit for each endpoint indicates status of th e respective endpoint buffer. this bit is set by hardware as a response to receiving a command from a corresponding bit in the endptprime register. there will always be a delay between sett ing a bit in the endptprime register and endpoint indicating ready. this delay time varies based upon the current usb traffic and the number of bi ts set in the endptprime register. buffer ready is cleared by usb reset, by the u sb dma system, or through the endptflush register. remark: these bits will be momentarily cleared by hardware during hardware endpoint re-priming operations when a dtd is retired and the dqh is updated. 21.6.21 usb endpoint comple te register (endptcomplete) each bit in this register indicates that a received/transmit event occurred and software should read the corresponding endpoint queue to determine the transfer status. if the corresponding ioc bit is set in the transfer descriptor, then this bit will be set simultaneously with the usbint. 15:4 - reserved - - 19:16 fetb flush endpoint transmit buffer for physical in endpoints. writing a one to a bit(s) will clear any primed buffers. fetb0 = endpoint 0 ... fetb3 = endpoint 3 0r/ws 31:20 - reserved - - table 395. usb endpoint flush register (endptf lush - address 0x4000 71b4) bit description bit symbol description reset value access table 396. usb endpoint status register (e ndptstat - address 0x4000 71b8) bit description bit symbol description reset value access 3:0 erbr endpoint receive buffer ready for physical out endpoints. this bit is set to 1 by hardware as a response to receiving a command from a corresponding bit in the endptprime register. erbr0 = endpoint 0 ... erbr3 = endpoint 3 0ro 15:4 - reserved - - 19:16 etbr endpoint transmit buffer ready for physical in endpoints 3 to 0. this bit is set to 1 by hardware as a response to receiving a command from a corresponding bit in the endptprime register. etbr0 = endpoint 0 ... etbr3 = endpoint 3 0ro 31:20 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 474 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller writing a one will clear the correspond ing bit in this register. 21.6.22 usb endpoint 0 control register (endptctrl0) this register initializes endpoint 0 for contro l transfer. endpoint 0 is always a control endpoint. table 397. usb endpoint complete register (endptcomplete - address 0x4000 71bc) bit description bit symbol description reset value access 3:0 erce endpoint receive complete event for physical out endpoints. this bit is set to 1 by hardware when receive event (out/setup) occurred. erce0 = endpoint 0 ... erce3 = endpoint 3 0r/wc 15:4 - reserved - - 19:16 etce endpoint transmit complete event for physical in endpoints. this bit is set to 1 by hardware w hen a transmit event (in/interrupt) occurred. etce0 = endpoint 0 ... etce3 = endpoint 3 0r/wc 31:20 - reserved - - table 398. usb endpoint 0 control register (endptctrl0 - address 0x4000 71c0) bit description bit symbol value description reset value access 0 rxs rx endpoint stall 0 r/w 0 endpoint ok. 1 endpoint stalled software can write a one to this bit to force the endpoint to return a stall handshake to the host. it will continue returning stall until the bit is cleared by software, or it will automatically be cleared upon receipt of a new setup request. after receiving a setup request, this bit will continue to be cleared by hardware until the associated endsetupstat bit is cleared. [1] 1- - reserved 3:2 rxt 0x0 endpoint type endpoint 0 is always a control endpoint. 0r/w 6:4 - - reserved - - 7 rxe 1 rx endpoint enable endpoint enabled. control endpoint 0 is always enabled. this bit is always 1. 1ro 15:8 - - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 475 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller [1] there is a slight delay (50 clocks max) between the enptsetu pstat being cleared and hardware continuing to clear this bit. i n most systems it is unlikely that the dcd software will observe this delay. however, should the dcd notice that the stall bit is not set after writing a one to it, software should continually write this st all bit until it is set or until a new setup has been received by checking the associated endptsetupstat bit. 21.6.23 endpoint 1 to 3 control registers each endpoint that is not a control endpoint has its own register to set the endpoint type and enable or disable the endpoint. remark: the reset value for all endpoint types is the control endpoint. if one endpoint direction is enabled and the paired endpoint of opposite direction is disabled, then the endpoint type of the unused direction must be changed from the cont rol type to any other type (e.g. bulk). leaving an unconfigured en dpoint control will cause undefined behavior for the data pid tracking on the active endpoint. 16 txs tx endpoint stall r/w 0 endpoint ok. 1 endpoint stalled software can write a one to this bit to force the endpoint to return a stall handshake to the host. it will continue returning stall until the bit is cleared by software, or it will automatically be cleared upon receipt of a new setup request. after receiving a setup request, this bit will continue to be cleared by hardware until the associated endsetupstat bit is cleared. [1] 17 - - reserved 19:18 txt 0x0 endpoint type endpoint 0 is always a control endpoint. 0ro 22:20 - - reserved 23 txe 1 tx endpoint enable endpoint enabled. control endpoint 0 is always enabled. this bit is always 1. 1ro 31:24 - - reserved table 398. usb endpoint 0 control register (endptctrl0 - address 0x4000 71c0) bit description ?continued bit symbol value description reset value access table 399. usb endpoint 1 to 3 control registers (endptctrl - address 0x4000 71c4 (endptctrl1) to 0x4000 71cc (endptctrl3)) bit description bit symbol value description reset value access 0 rxs rx endpoint stall 0 r/w 0 endpoint ok. this bit will be cleared automatically upon receipt of a setup request if this endpoint is configured as a control endpoint and this bit will continue to be cleared by hardware until the associated endptsetupstat bit is cleared. 1 endpoint stalled software can write a one to this bit to force the endpoint to return a stall handshake to the host. it will continue returning stall until the bit is cleared by software, or it will automatically be cleared upon receipt of a new setup request. [1] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 476 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller 1- reserved 0 r/w 3:2 rxt endpoint type 00 r/w 0x0 control 0x1 isochronous 0x2 bulk 0x3 reserved 4- - reserved 5 rxi rx data toggle inhibit this bit is only used for test and should always be written as zero. writing a one to this bit will cause this endpoint to ignore the data toggle sequence and always accept data packets regardless of their data pid. 0r/w 0 disabled 1 enabled 6 rxr rx data toggle reset write 1 to reset the pid sequence. whenever a configuration event is received for this endpoint, software must write a one to this bi t in order to synchronize the data pids between the host and device. 0ws 7 rxe rx endpoint enable remark: an endpoint should be enabled only after it has been configured. 0r/w 0 endpoint disabled. 1 endpoint enabled. 15:8 - - reserved 16 txs tx endpoint stall 0 r/w 0 endpoint ok. this bit will be cleared automatically upon receipt of a setup request if this endpoint is configured as a control endpoint, and this bit will continue to be cleared by hardware until the associated endptsetupstat bit is cleared. 1 endpoint stalled software can write a one to this bit to force the endpoint to return a stall handshake to the host. it will continue returning stall until the bit is cleared by software, or it will automatically be cleared upon receipt of a new setup request. [1] 17 - - reserved 0 - 19:18 txt tx endpoint type 00 r/w 0x0 control 0x1 isochronous 0x2 bulk 0x3 interrupt 20 - - reserved table 399. usb endpoint 1 to 3 control registers (endptctrl - address 0x4000 71c4 (endptctrl1) to 0x4000 71cc (endptctrl3)) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 477 of 1164 nxp semiconductors UM10430 chapter 21: lpc18xx usb1 host/device controller [1] for control endpoints only: there is a slight delay (50 clocks max) between the enptsetu pstat being cleared and hardware continuing to clear this bit. in most syst ems it is unlikely that the dcd software will observe this delay. however, should the dcd notice that the stall bit is not set after writing a one to it, software should continually write this st all bit until it is set or un til a new setup has been received by checking the asso ciated endptsetupstat bit. 21.7 functional description for details on the device data structures, see section 20.9 . for the device operational model, see section 20.10 . 21 txi tx data toggle inhibit this bit is only used for test and should always be written as zero. writing a one to this bit will cause this endpoint to ignore the data toggle sequence and always accept data packets regardless of their data pid. 0r/w 0 enabled 1 disabled 22 txr tx data toggle reset write 1 to reset the pid sequence. whenever a configuration event is received for this endpoint, software must write a one to this bi t in order to synchronize the data pid?s between the host and device. 1ws 23 txe tx endpoint enable remark: an endpoint should be enabled only after it has been configured 0r/w 0 endpoint disabled. 1 endpoint enabled. 31:24 - - reserved 0 table 399. usb endpoint 1 to 3 control registers (endptctrl - address 0x4000 71c4 (endptctrl1) to 0x4000 71cc (endptctrl3)) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 478 of 1164 22.1 how to read this chapter the ethernet controller is available on parts lpc1850 and lpc1830. 22.2 basic configuration the ethernet controller is configured as follows: ? see ta b l e 4 0 0 for clocking and power control. ? the ethernet is reset by the ethernet_rst (reset # 22). ? the ethernet interrupt is connected to inte rrupt slot # 5 in the nvic, and the is connected to slot # 8 in the event router. ? set the ethernet mode to rmii or mii in the creg6 register in the creg block (see ta b l e 3 7 ). 22.3 features ? 10/100 mbit/s ? tcp/ip hardware checksum ? ip checksum ? dma support ? ieee 1588 time stamping block ? ieee 1588 advanced time stamp support (ieee 1588-2008 v2) ? power management remote wake-up frame and magic packet detection ? supports both full-duplex and half-duplex operation ? supports csma/cd protocol for half-duplex operation. UM10430 chapter 22: lpc18xx ethernet rev. 00.13 ? 20 july 2011 user manual table 400. ethernet clocking and power control base clock branch clock maximum frequency notes ethernet register interface clock base_m3_clk clk_m3_ ethernet 150 mhz - ethernet phy clock base_phy_ rx_clk - 75 mhz select the clock pin enet_rx_clk as clock source for this base clock in the outclk_7_ctrl register in the cgu. ethernet phy clock base_phy_ tx_clk - 75 mhz select the clock pin enet_tx_clk as clock source for this base clock in the outclk_8_ctrl register in the cgu. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 479 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet ? supports ieee 802.3x flow control for full-duplex operation. ? optional forwarding of received pause co ntrol frames to the user application in full-duplex operation. ? back-pressure support for half-duplex operation. ? automatic transmission of zero-quanta p ause frame on deassertion of flow control input in full-dup lex operation. 22.4 general description 22.5 pin description table 401. ethernet pin description function name direction description miim interface enet_mdio i/o ethernet miim data input and iutput. enet_mdc o ethernet miim clock. rmii interface (also used for mii interface) enet_rxd[1:0] i ethernet receive data. enet_txd[1:0] o ethernet transmit tata. enet_rx_dv i ethernet receive data valid. enet_ref_clk i ethernet reference clock. enet_tx_en o ethernet transmit data enable. mii interface enet_rxd[3:2] i ethernet receive data. enet_txd[3:2] o ethernet transmit tata. enet_col i ethernet collision detect. enet_crs i ethernet carrier sense. enet_tx_er o ethernet transmit error. enet_tx_clk i ethernet transmit clock. enet_rx_clk i/o ethernet receive clock. enet_rx_dv i ethernet receive data valid. enet_rx_er i ethernet receive error. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 480 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6 register description table 402. register overview: ethernet mac and dma (base address 0x4001 0000) name access address offset description reset value mac_config 0x0000 mac configuration register 0x0000 8000 mac_frame_filter 0x0004 mac frame filter 0x0000 0000 mac_hashtable_high 0x0008 hash table high register 0x0000 0000 mac_hashtable_low 0x000c hash table low register 0x0000 0000 mac_mii_addr 0x0010 mii address register 0x0000 0000 mac_mii_data 0x0014 mii data register 0x0000 0000 mac_flow_ctrl 0x0018 flow control register 0x0000 0000 mac_vlan_tag 0x001c vlan tag register 0x0000 0000 mac_ver 0x0020 version register 0x0000 1036 mac_debug 0x0024 debug register 0x0000 0000 mac_rwake_frflt 0x0028 remote wa ke-up frame filter 0x0000 0000 mac_pmt_ctrl_stat 0x002c pmt control and status 0x0000 0000 - - 0x0030 - 0x0034 reserved mac_intr 0x0038 interrupt status register 0x0000 0000 mac_intr_mask 0x003c interrupt mask register 0x0000 0000 mac_addr0_high 0x0040 mac address 0 high register 0x8000 ffff mac_addr0_low 0x0044 mac address 0 low register 0xffff ffff - - 0x0048 - 0x06fc reserved - mac_timestp_ctrl 0x0700 time stamp control register 0x0000 2000 - 0x0704 - 0x0ffc reserved dma_bus_mode 0x1000 bus mode register 0x0002 0100 dma_trans_poll_demand 0x1004 transmit poll demand register 0x0000 0000 dma_rec_poll_demand 0x1008 receive poll demand register 0x0000 0000 dma_rec_des_addr 0x100c receive descriptor list address register 0x0000 0000 dma_trans_des_addr 0x1010 transmit descriptor list address register 0x0000 0000 dma_stat 0x1014 status register 0x0000 0000 dma_op_mode 0x1018 operation mode register 0x0000 0000 dma_int_en 0x101c interrupt enable register 0x0000 0000 dma_mfrm_bufof 0x1020 missed frame and buffer overflow register 0x0000 0000 dma_rec_int_wdt 0x1024 receive interrupt watchdog timer register 0x0000 0000 - - 0x1028 - 0x1044 reserved dma_curhost_trans_des 0x1048 current host tr ansmit descriptor register 0x0000 0000 dma_curhost_rec_des 0x104c current host receive descriptor register 0x0000 0000 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 481 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.1 mac configuration register the mac configuration register establishes receive and transmit operating modes. dma_curhost_trans_buf 0x1050 current host transmit buffer address register 0x0000 0000 dma_curhost_rec_buf 0x1054 current host receive buffer address register 0x0000 0000 dma_hw_feature 0x1058 hw feature register 0x0105 2715 table 402. register overview: ethernet mac and dma (base address 0x4001 0000) name access address offset description reset value table 403. mac configuration register (mac_c onfig, address 0x4001 0000) bit description bit symbol description reset value access 1:0 - reserved 00 ro 2 re receiver enable when this bit is set, the receiver state machine of the mac is enabled for receiving frames from the mii. when this bit is reset, the mac receive state machine is disabled after the completion of the reception of the current frame, and will not receive any further frames from the mii. 0r/w 3 te transmitter enable when this bit is set, the transmit state machine of the mac is enabled for transmission on the mii. when this bit is reset, the mac transmit state machine is disabled after the completion of the transmission of the current frame, and will not transmit any further frames. 0r/w 4 df deferral check when this bit is set, the deferral check function is enabled in the mac. the mac will issue a frame abort status, along with the excessive deferral error bit set in the transmit frame status when the transmit state machine is deferred for more than 24,288 bit times in 10/100-mbps mode. if the core is configured for 1000 mbps operation, or if the jumbo frame mode is enabled in 10/100-mbps mode, the threshold for deferral is 155,680 bits times. deferral begins when the transmitter is ready to transmit, but is prevented because of an active crs (carrier sense) signal on the mii. defer time is not cumulative. if the transmitter defers for 10,000 bit times, then transmits, collides, backs off, and then has to defer again after completion of back-off, the deferral timer resets to 0 and restarts. when this bit is reset, the deferral check function is disabled and the mac defers until the crs signal goes inactive. this bit is applicable only in half-duplex mode and is reserved (ro) in full-duplex-only configuration. 0r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 482 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 6:5 bl back-off limit the back-off limit determines the random integer number (r) of slot time delays (4,096 bit times for 1000 mbps and 512 bit times for 10/100 mbps) the mac waits before rescheduling a transmission attempt during retries after a collision. this bit is applicable only to half-duplex mode and is reserved (ro) in full-duplex-only configuration. ? 00: k = min (n, 10) ? 01: k = min (n, 8) ? 10: k = min (n, 4) ? 11: k = min (n, 1) where n = retransmission attempt. the random integer r takes the value in the range 0 ? r ? 2 k . 0r/w 7 acs automatic pad/crc stripping when this bit is set, the mac strips the pad/fcs field on incoming frames only if the length?s field value is less than or equal to 1,500 bytes. all received frames with length field greater than or equal to 1,501 bytes are passed to the application without stripping the pad/fcs field. when this bit is reset, the mac will pass al l incoming frames to the host unmodified. 0r/w 8 - link up/down indicates whether the link is up or down during the transmission of configuration in smii interface: 0 = link down 1 = link up 0r/w 9 dr disable retry when this bit is set, the mac will attempt only 1 transmission. when a collision occurs on the mii, the mac will ignore the current frame transmission and report a frame abort with excessive collision error in the transmit frame status. when this bit is reset, the mac will attemp t retries based on the settings of bl. this bit is applicable only to half-duplex mode and is reserved (ro with default value) in full- duplex-only configuration. 0r/w 10 ipc checksum offload when this bit is set, the mac calculates the 16-bit one?s complement of the one?s complement sum of all rece ived ethernet frame payloads . it also checks whether the ipv4 header checksum (assumed to be byte s 25?26 or 29?30 (vlan-tagged) of the received ethernet frame) is correct for the received frame and gives the status in the receive status word. the mac core also appends the 16-bit checksum calculated for the ip header datagram payload (bytes after the ipv4 header) and appends it to the ethernet frame transferred to the application (when type 2 coe is deselected). when this bit is reset, this function is disabled. when type 2 coe is selected, this bit, when set, enables ipv4 checksum checking for received frame payload?s tcp/udp/icmp headers. when this bit is reset, the coe function in the receiver is disabled and the corresponding pce and ip hce status bits (see ) are always cleared. 0r/w 11 dm duplex mode when this bit is set, the mac operates in a full-duplex mode where it can transmit and receive simultaneously. 0r/w table 403. mac configuration register (mac_c onfig, address 0x4001 0000) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 483 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 12 lm loopback mode when this bit is set, the mac operates in loopback mode at mii. the (g)mii receive clock input is required for the loopback to work properly, as the transmit clock is not looped-back internally. 0r/w 13 do disable receive own when this bit is set, the mac disables the reception of frames in half-duplex mode. when this bit is reset, the mac receives all packets that are given by the phy while transmitting. this bit is not applicable if the mac is operating in full-duplex mode. 0r/w 14 fes speed indicates the speed in fast ethernet (mii) mode: 0 = 10 mbps 1 = 100 mbps . 0 15 ps port select 1 = mii (100 mbp) - this is the only allowed value. 1ro 16 dcrs disable carrier sense during transmission when set high, this bit makes the mac transmitter ignore the (g)mii crs signal during frame transmission in half-duplex mode. this request results in no errors generated due to loss of carrier or no carrier during such transmission. when this bit is low, the mac transmitter generates such errors due to carrier sense and will even abort the transmissions. 0r/w 19:17 ifg inter-frame gap these bits control the minimum ifg between frames during transmission. 000 = 96 bit times 001 = 88 bit times 010 = 80 bit times ... 000 = 40 bit times note that in half-duplex mode, the minimum ifg can be configured for 64 bit times (ifg = 100) only. lower values are not considered 000 r//w 20 je jumbo frame enable when this bit is set, mac allows jumbo frames of 9,018 bytes (9,022 bytes for vlan tagged frames) without reporting a giant frame error in the receive frame status. 0r/w 21 - reserved. 0ro table 403. mac configuration register (mac_c onfig, address 0x4001 0000) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 484 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.2 mac frame filter register the mac frame filter register contains the f ilter controls for rece iving frames. some of the controls from this register go to the address check bloc k of the mac, which performs the first level of address filt ering. the second level of filtering is performed on the incoming frame, based on other controls such as pass bad frames and pass control frames. 22 jd jabber disable when this bit is set, the mac disables the jabber timer on the transmitter, and can transfer frames of up to 16,384 bytes. when this bit is reset, the mac cuts off the transmitter if the application sends out more than 2,048 bytes of data (10,240 if je is set high) during transmission. 0r/w 23 wd watchdog disable when this bit is set, the mac disables the watchdog timer on the receiver, and can receive frames of up to 16,384 bytes. when this bit is reset, the mac allows no more than 2,048 bytes (10,240 if je is set high) of the frame being received and cuts off any bytes received after that. 0r/w 31:24 - reserved. 0x00 ro table 403. mac configuration register (mac_c onfig, address 0x4001 0000) bit description ?continued bit symbol description reset value access table 404. mac frame filter re gister (mac_frame_filter, address 0x4001 0004) bit description bit symbol description reset value access 0 pr promiscuous mode when this bit is set, the address filter module passes all incoming frames regardless of its destination or source address. the sa/da filter fails status bits of the receive status word will always be cleared when pr is set. 0r/w 1 - reserved 0ro 2 - reserved 0ro 3 daif da inverse filtering when this bit is set, the address check block operates in inverse filtering mode for the da address comparison for both unicast and multicast frames. when reset, normal filtering of frames is performed. 0r/w 4 pm pass all multicast when set, this bit indicates that all received frames with a multicast destination address (first bit in the destination address field is '1') are passed. when reset, filtering of multicast frame depends on hmc bit. 0r/w 5 dbf disable broadcast frames when this bit is set, the afm module filters all incoming broadcast frames. when this bit is reset, the afm module passes all received broadcast frames. 0r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 485 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.3 mac hash table high register the 64-bit hash table is used for group address fi ltering. for hash filter ing, the contents of the destination address in the incoming frame is passed through the crc logic, and the upper 6 bits of the crc register are used to index the contents of the hash table. the most significant bit determines the register to be used (hash table high/hash table low), and the other 5 bits determine which bit within the register. a hash value of 00000 selects bit 0 of the selected register, and a value of 11111 selects bit 31 of the selected register. for example, if the da of the incoming fr ame is received as 0x1f52419cb6af (0x1f is the first byte received on mii interface), then the internally calculated 6-bit hash value is 0x2c and the hth register bit[12] is checked fo r filtering. if the da of the incoming frame is received as 0xa00a98000045, then the calc ulated 6- bit hash value is 0x07 and the htl register bit[7] is checked for filtering. if the corresponding bit value of the register is 1, the frame is acce pted. otherwise, it is rejected. if the pm (pass all multicast) bit is set in the mac_config register, then all multicast frames are accepted regardless of the multicast hash values. 7:6 pcf pass control frames these bits control the forwarding of all control frames (including unicast and multicast pause frames). note that the processing of pause control frames depends only on rfe of flow control register[2]. 00 = mac filters all control frames from reaching the application. 01 = mac forwards all control frames except pause control frames to application even if they fail the address filter. 10 = mac forwards all control frames to application even if they fail the address filter. 11 = mac forwards control frames that pass the address filter. 00 r/w 8 saif sa inverse filtering when this bit is set, the address check block operates in inverse filtering mode for the sa address comparison. the frames whose sa matches the sa registers will be marked as failing the sa address filter. when this bit is reset, frames whose sa does not match the sa registers will be marked as failing the sa address filter. 0r/w 9 saf source address filter enable the mac core compares the sa field of the received frames with the values programmed in the enabled sa registers. if the comparison matches, then the samatch bit of rxstatus word is set high. when this bit is set high and the sa filter fails, the mac drops the frame. when this bit is reset, then the mac core forwards the received frame to the application and with the updated sa match bit of the rxstatus depending on the sa address comparison. 0r/w 30:10 - reserved 0ro 31 ra receive all when this bit is set, the mac receiver module passes to the application all frames received irrespective of whether they pass the address filter. the result of the sa/da filtering is updated (pass or fail) in the corresponding bits in the receive status word. when this bit is reset, the receiver module passes to the application only those frames that pass the sa/da address filter. 0r/w table 404. mac frame filter re gister (mac_frame_filter, address 0x4001 0004) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 486 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet if the hash table register is configured to be double-synchronized to the (g)mii clock domain, the synchronization is triggered only when bits[31:24] (in little-endian mode) or bits[7:0] (in big-endian mode) of the hash table high/low registers are written to. please note that consecutive writes to these register should be performed only after at least 4 clock cycles in the destination clock domain when double synchronization is enabled. the hash table high register contains the higher 32 bits of the hash table. 22.6.4 mac hash table low register the hash table low register contains the lower 32 bits of the hash table. 22.6.5 mac mii address register the mii address register controls the managem ent cycles to the exte rnal phy through the management interface. table 405. mac hash table high register (m ac_hashtable_high, address 0x4001 0008) bit description bit symbol description reset value access 31:0 hth hash table high this field contains the upper 32 bits of hash table. 0r/w table 406. mac hash table low register (mac_hashtable_low, address 0x4001 0008) bit description bit symbol description reset value access 31:0 htl hash table low this field contains the upper 32 bits of hash table. 0r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 487 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet table 407. mac mii address register (mac_mii _addr, address 0x4001 0010) bit description bit symbol description reset value access 0 gb mii busy this bit should read a logic 0 before writing to this register and the mac_mii_data register. this bit must also be set to 0 during a write to this register. during a phy register access, this bit will be set to 1 by the application to indicate that a read or write access is in progress. the mac_mii_data register should be kept valid until this bit is cleared by the mac during a phy write operation. the mac_mii_data register is invalid until this bit is cleared by the mac during a phy read operation. this register should not be written to until this bit is cleared. 0r_ws_ sc 1 w mii write when set, this bit tells the phy that this will be a write operation using the mii data register. if this bit is not set, this will be a read operation, placing the data in the mii data register. 0r/w 5:2 cr csr clock range the csr clock range selection determines the frequency of the mdc clock . the suggested range of clk_csr_i frequency applicable for each value below (when bit[5] = 0) ensures that the mdc clock is approximately between the frequency range 1.0 mhz - 2.5 mhz. when bit 5 is set, you can achieve m dc clock of frequency higher than the ieee 802.3 specified frequency limit of 2.5 mhz and program a clock divider of lower value. for example, when clk_csr_i is of frequency 100 mhz and you program these bits as 1010, then the resultant mdc clock will be of 12.5 mhz which is outside the limit of ieee 802.3 specified range. please program the values given below only if the interfacing chips suppor ts faster mdc clocks. see table 408 for bit values. 0r/w 10:6 gr mii register these bits select the desired mii register in the selected phy device. 0r/w 15:11 pa physical layer address this field tells which of the 32 possible phy devices are being accessed. 0r/w 31:16 - reserved 0ro table 408. csr clock range values bits 5:2 clk_csr_i mdc clock 0000 60 - 100 mhz clk_csr_i/42 0001 100 - 150 mhz clk_csr_i/62 0010 20 - 35 mhz clk_csr_i/16 0011 35 - 60 mhz clk_csr_i/26 0100 150 - 250 mhz clk_csr_i/102 0101 250 - 300 mhz clk_csr_i/124 0110, 0111 reserved - 1000 - clk_csr_i/42 1001 - clk_csr_i/62 1010 - clk_csr_i/16 1011 - clk_csr_i/26 1100 - clk_csr_i/102 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 488 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.6 mac mii data register the mii data register stores write data to be written to the phy register located at the address specified in the mac_mii_addr regist er. this register also stores read data from the phy register locate d at the address specified by the mac_mii_addr register. 22.6.7 mac flow control register the flow control register controls the gen eration and reception of the control (pause command) frames by the mac?s flow control m odule. a write to a register with the busy bit set to 1 triggers the flow control block to generate a pause control frame. the fields of the control frame are selected as specified in the 802.3x specification, and the pause time value from this register is used in the pause time field of the control frame. the busy bit remains set until the control frame is transferred onto the cable. the host must make sure that the busy bit is cleared before writing to the register. 1101 - clk_csr_i/124 1110 - clk_csr_i/42 1111 - clk_csr_i/62 table 408. csr clock range values bits 5:2 clk_csr_i mdc clock table 409. mii data register (mac_mii_d ata, address 0x4001 0014) bit description bit symbol description reset value access 15:0 gd mii data this contains the 16-bit data value read from the phy after a management read operation or the 16-bit data value to be written to the phy before a management write operation. 0r/w 31:16 - reserved 0 ro www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 489 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet table 410. mac flow control re gister (mac_flow_ctrl, address 0x4001 0018) bit description bit symbol description reset value access 0 fcb flow control busy/ba ckpressure activate this bit initiates a pause control frame in full-duplex mode. in full-duplex mode, this bit should be r ead as 0 before writing to the flow control register. to initiate a pause control frame, the application must set this bit to 1. during a transfer of the control frame, this bit wi ll continue to be set to signify that a frame transmission is in progress. after the completion of pause control frame transmission, the mac will reset this bit to 0. the flow control register should not be written to until this bit is cleared. in half-duplex mode, when this bit is set (and tfe is set), then backpressure is asserted by the mac core. during backpressure, when the mac receives a new frame, the transmitter starts sending a jam pattern resulting in a collision. this control register bit is logically or?ed with the mti_flowctrl_i input signal for the backpressure function. when the mac is configured to full- duplex mode, the bpa is automatically disabled. 0r/ws/ sc 1 tfe transmit flow control enable in full-duplex mode, when this bit is set, the mac enables the flow control operation to transmit pause frames. when this bit is re set, the flow control operation in the mac is disabled, and the mac will not transmit any pause frames. in half-duplex mode, when this bit is set, the mac enables the back-pressure operation. when this bit is reset, the backpressure feature is disabled. 0r/w 2 rfe receive flow control enable when this bit is set, the mac will decode the received pause frame and disable its transmitter for a specified (pause time) time. when this bit is reset, the decode function of the pause frame is disabled. 0r/w 3 up unicast pause frame detect when this bit is set, the mac will detect the pause frames with the station?s unicast address specified in mac address0 high register and mac address0 low register, in addition to the detecting pause frames with the unique multicast address. when this bit is reset, the mac will detect only a pause frame with the unique multicast address specified in the 802.3x standard. 0r/w 5:4 plt pause low threshold this field configures the threshold of the pause timer at which the input flow control is checked for automatic retransmission of pause frame. the threshold values should be always less than the pause time configured in bits[31:16]. for example, if pt = ox100 (256 slot-times), and plt = 01, then a second pause frame is automatically transmitted if the flow control signal is asserted at 228 (256 ? 28) slot-times after the first pause frame is transmitted. 00 r/w 6- reserved 0x000 ro 7 dzpq disable zero-quanta pause when set, this bit disables the automatic generation of zero-quanta pause control frames on the deassertion of the flow-control signal from the fifo layer . when this bit is reset, normal operation with automatic zero-quanta pause control frame generation is enabled. 0r/w 15:8 - reserved 0ro 31:16 pt pause time this field holds the value to be used in the pause time field in the transmit control frame. if the pause time bits is configured to be double-synchronized to the (g)mii clock domain, then consecutive writes to th is register should be performed only after at least 4 clock cycles in the destination clock domain. 0x000 0 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 490 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.8 mac vlan tag register the vlan tag register contains the ieee 802. 1q vlan tag to identi fy the vlan frames. the mac compares the 13th and 14th bytes of the receiving frame (length/type) with 0x8100, and the following 2 bytes are compared with the vlan tag; if a match occurs, it sets the received vlan bit in the receive fram e status. the legal length of the frame is increased from 1518 bytes to 1522 bytes. if the vlan tag register is configured to be double-synchronized to the mii clock domain, then consecutive writes to these register shou ld be performed only after at least 4 clock cycles in the destination clock domain. 22.6.9 mac debug register this debug register gives the status of all the main modules of the transmit and receive data-paths and the fifos. an all-zero status indicates that the mac core is in idle state (and fifos are empty) and no activity is going on in the data-paths. table 411. mac vlan tag register (mac_vlan_tag, address 0x4001 01c) bit description bit symbol description reset value access 15:0 vl vlan tag identifier for receive frames this contains the 802.1q vlan tag to iden tify vlan frames, and is compared to the fifteenth and sixteenth bytes of the frames being received for vlan frames. bits[15:13] are the user priority, bit[12] is the canonical format indicator (cfi) and bits[11:0] are the vlan tag?s vlan identifier (vid) field. when the etv bit is set, only the vid (bits[11:0]) is used for comparison. if vl (vl[11:0] if etv is set) is all zeros, the mac does not check the fifteenth and sixteenth bytes for vlan tag comparison, and declares all frames with a type field value of 0x8100 to be vlan frames. 0x000 0 r/w 16 etv enable 12-bit vlan tag comparison when this bit is set, a 12-bit vlan identifier, rather than the complete 16-bit vlan tag, is used for comparison and filtering. bits[11:0] of the vlan tag are compared with the corresponding field in the received vlan-tagged frame. when this bit is reset, all 16 bits of the received vlan frame?s fifteenth and sixteenth bytes are used for comparison. 0r/w 31:17 - reserved 0x000 0 ro table 412. mac debug register (mac_debug, address 0x4001 0024) bit description bit symbol description reset value access 0 rxidles tat when high, it indicates that the mac mii receive protocol engine is actively receiving data and not in idle state. 2:1 fifosta t0 when high, it indicates the active state of the small fifo read and write controllers respectively of the mac receive frame controller module. 3- reserved 4rxfifo stat1 when high, it indicates that the mtl rxfifo write controller is active and transferring a received frame to the fifo. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 491 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.10 mac remote wake- up frame filter register this is the address through which the remote wake-up frame filter registers (wkupfmfilter) are written/read by the ap plication. wkupfmfilter is actually a pointer to eight (not transparent) such wkupfmfilter registers. eight sequential writes to this address (0x028) will write all wkupfmfilter regist ers. eight sequential reads from this address (0x028) will read all wkupfmfilter registers. see section 22.7.1.1 for details. remark: do not use bit-banding for this register. 6:5 rxfifo stat state of the rxfifo read controller: 00 = idle state 01 = reading frame data 10 = reading frame status (or time stamp) 11 = flushing the frame data and status 7- reserved 9:8 rxfifol vl status of the rxfifo fill-level 00 = rxfifo empty 01 = rxfifo fill-level below flow-control de-activate threshold 10 = rxfifo fill-level above flow-control activate threshold 11 = rxfifo full 15:10 - reserved -ro 16 txidles tat when high, it indicates that the mac mii transmit protocol engine is actively transmitting data and not in idle state. 18:17 txstat state of the mac transmit frame controller module: 00 = idle 01 = waiting for status of previous frame or ifg/backoff period to be over 10 = generating and transmitting a pause control frame (in full duplex mode) 11 = transferring input frame for transmission 19 pause when high, it indicates that the mac transmitter is in pause condition (in full-duplex only) and hence will not schedule any frame for transmission. 21:20 txfifos tat state of the txfifo read controller 00 = idle state 01 = read state (transferring data to mac transmitter) 10 = waiting for txstatus from mac transmitter 11 = writing the received txstatus or flushing the txfifo 22 txfifos tat1 when high, it indicates that the mtl txfifo write controller is active and transferring data to the txfifo. 23 - reserved 24 txfifol vl when high, it indicates that the mtl txfifo is not empty and has some data left for transmission. 25 txfifof ull when high, it indicates that the mtl txstat us fifo is full and hence the mtl will not be accepting any more frames for transmission. 31:26 table 412. mac debug register (mac_debug, address 0x4001 0024) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 492 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.11 mac pmt contro l and status register the pmt control and status registers programs the request wake-up events and monitors the wake-up events. see section 22.7.1 for details. 22.6.12 mac interrupt status register the interrupt status register contents iden tify the events in t he mac-core that can generate interrupt. table 413. mac remote wake-up frame filter register (mac_rwake_frflt, address 0x4001 0028) bit description bit symbol description reset value access 31:0 addr wkupfmfilter address - r/w table 414. mac pmt control and status register (m ac_pmt_ctrl_stat, address 0x4001 002c) bit description bit symbol description reset value access 0 pd power-down when set, all received frames will be drop ped. this bit is cleared automatically when a magic packet or wake-up frame is received, and power-down mode is disabled. frames received after this bit is cleared are forwarded to the application.this bit must only be set when either the magic packet enable or wake- up frame enable bit is set high. 0r/ws/ sc 1 mpe magic packet enable when set, enables generation of a power management event due to magic packet reception. 0r/w 2 wfe wake-up frame enable when set, enables generation of a power management event due to wake-up frame reception. 0r/w 4:3 - reserved 00 ro 5 mpr magic packet received when set, this bit indicates the power management event was generated by the reception of a magic packet. this bit is cleared by a read into this register. 0r/ss/r c 6 wfr wake-up frame received when set, this bit indicates the power management event was generated due to reception of a wake-up frame. this bit is cleared by a read into this register. 0r/ss/r c 8:7 - reserved 0ro 9 gu global unicast when set, enables any unicast packet filtered by the mac (daf) address recognition to be a wake-up frame. 0r/w 30:10 - reserved 0x00 0000 ro 31 wffrpr wake-up frame filter register pointer reset when set, resets the remote wake-up frame filter register pointer to 000. it is automatically cleared after 1 clock cycle. 0r/ws/ sc www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 493 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.13 mac interrupt mask register the interrupt mask register bits enables the us er to mask the interrupt signal due to the corresponding event in the interrupt status register. 22.6.14 mac address 0 high register the mac address 0 high register holds the upper 16 bits of the 6-byte first mac address of the station. note that the first da byte that is received on the (g)mii interface corresponds to the ls byte (bits [7:0]) of the mac address low register. for example, if 0x112233445566 is received (0x11 is the fi rst byte) on the (g)mii as the destination address, then the macaddress0 register [47:0] is compared with 0x665544332211. if the mac address registers are configured to be double-synchronized to the (g)mii clock domains, then the synchronization is trigge red only when bits[31:24] (in little-endian mode) or bits[7:0] (in big-endian mode) of the mac address low register (register 17) are written to. please note that consecutive writes to this address low register should be performed only after at least 4 clock cycles in the destination clock domain for proper synchronization updates. 22.6.15 mac address 0 low register the mac address 0 low register holds the lowe r 32 bits of the 6-byte first mac address of the station. table 415. mac interrupt status register (mac _intr, address 0x4001 0038) bit description bit symbol description reset value access 31:0 - reserved 0 ro table 416. mac interrupt mask register (mac_intr_mask, address 0x4001 003c) bit description bit symbol description reset value access 2:0 - reserved 0 ro 3 pmtmsk pmt interrupt mask this bit when set, will disable the assertion of the interrupt signal due to the setting of pmt interrupt status bit in table 415 . 0r/w 31:4 reserved 0 r/w table 417. mac address 0 high register (mac_addr0_high, address 0x4001 0040) bit description bit symbol description reset value access 15:0 a47_32 mac address0 [47:32] this field contains the upper 16 bits (47:32) of the 6-byte first mac address. this is used by the mac for filtering for received frames and for inserting the mac address in the transmit flow control (pause) frames. 0xffff r/w 30:16 - reserved 0x0000 ro 31 mo always 1 1 ro www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 494 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.16 mac ieee1588 time stamp control register this register controls the operation of the system time generator and the snooping of ptp packets for time-stamping in the receiver. table 418. mac address 0 low register (mac_addr0_low, address 0x4001 0044) bit description bit symbol description reset value access 31:0 a31_0 mac address0 [31:0] this field contains the lower 32 bits of the 6-byte first mac address. this is used by the mac for filtering for received frames and for inserting the mac address in the transmit flow control (pause) frames. 0xffff ffff r/w table 419. mac ieee1588 time stamp control register (mac_timestp_ctrl, address 0x4001 0700) bit description bit symbol description reset value access 0 tsena time stamp enable when this bit, is set the timestamping is enabled for transmit and receive frames. when disabled timestamp is not added for transmit and receive frames and the timestamp generator is also suspended. user has to always initialize the timestamp (system time) after enabling this mode. 0r/w 1tscfup dt time stamp fine or coarse update when set, indicates that the system times update to be done using fine update method. when reset it indicates the system time stamp update to be done using coarse method. this bit is reserved if the fine correction option is not enabled. 0r/w 2 tsinit time stamp initialize when set, the system time is initialized (over-wri tten) with t he value specif ied in the time stamp high update and time stamp low update registers. this register bit should be read zero before updating it. this bit is reset once the initialize is complete. 0 r/w/s c 3 tsupdt time stamp update when set, the system time is updated (added/ subtracted) with the value specified in the time stamp high update and time stamp low update registers. this register bit should be read zero before updating it. this bit is reset once the update is completed in hardware. 0 r/w/s c 4 tstrig time stamp interrupt trigger enable when set, the time stamp interrupt is generated when the system time becomes greater than the value written in target time register. this bit is reset after the generation of time stamp trigger interrupt. 0r/wsc 5 tsaddr eg addend reg update when set, the contents of the time stamp addend register is updated in the ptp block for fine correction. this is cleared when the update is completed. this register bit should be zero before setting it. this is a reserved bit when only coarse correction option is selected. 7:6 - reserved 8 tsenal l enable time stamp for all frames when set, the time stamp snapshot is enabled for all frames received by the core. 0r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 495 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet table 420 indicates the messages, for which a snap shot is taken depending on the clock, enable master and enable snapshot for event message register settings. 9tsctrl ssr time stamp digital or binary rollover control when set, the time stamp low register rolls over after 0x3b9a_c9ff value (i.e., 1 nanosecond accuracy) and increments the time stamp (high) seconds. when reset, the rollover value of sub-second register is 0x7fff_ffff. the sub-second increment has to be programmed correctly depending on the ptp reference clock frequency and this bit value. 0r/w 10 tsver2 ena enable ptp packet snooping for version 2 format when set, the ptp packets are snooped using the 1588 version 2 format else snooped using the version 1 format. 0r/w 11 tsipena enable time stamp snapshot for ptp over ethernet frames when set, the time stamp snapshot is taken for frames which have ptp messages in ethernet frames (ptp over ethernet) also. by default snapshots are taken for udp-ip-ethernet ptp packets. 0r/w 12 tsipv6e na enable time stamp snapshot for ipv6 frames when set, the time stamp snapshot is taken for ipv6 frames. 0r/w 13 tsipv4e na enable time stamp snapshot for ipv4 frames when set, the time stamp snapshot is taken for ipv4 frames. 1r/w 14 tsevnt ena enable time stamp snapshot for event messages when set, the time stamp snapshot is taken for event messages only . when reset snapshot is taken for all other messages except announce, management and signaling. 0r/w 15 tsmstr ena enable snapshot for messages relevant to master when set, the snapshot is taken for messages relevant to master node only else snapshot is taken for messages relevant to slave node. this is valid only for ordinary clock and boundary clock node. 0r/w 17:16 tsclkt ype select the type of clock node the following are the options to select the type of clock node: 00 = ordinary clock 01 = boundary clock 10 = end-to-end transparent clock 11 = peer-to-peer transparent clock 00 r/w 18 tsenma caddr enable mac address for ptp frame filtering when set, uses the da mac address (that matches any mac address register except the default mac address 0) to filter the ptp frames when ptp is sent directly over ethernet. 0r/w 31:19 table 419. mac ieee1588 time stamp control register (m ac_timestp_ctrl, address 0x4001 0700) bit description bit symbol description reset value access table 420. time stamp snapshot dependency on register bits tsclktype tsmstrena tsevntena messages for which snapshot is taken 00 or 01 x 0 sync, follow_up, delay_req, delay_resp 00 or 01 1 1 delay_req 00 or 01 0 1 sync 10 n/a 0 sync, follow_up, delay_req, delay_resp www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 496 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.17 dma bus mode register the bus mode register establishes the bus operating modes for the dma. 10 n/a 1 sync, follow_up 11 n/a 0 sync, follow_up, delay_req, delay_resp, pdelay_req, pdelay_resp 11 n/a 1 sync, pdelay_req, pdelay_resp table 420. time stamp snapshot dependency on register bits tsclktype tsmstrena tsevntena messages for which snapshot is taken table 421. dma bus mode register (dma_bus_mode, address 0x4001 1000) bit description bit symbol description reset value access 0 swr software reset when this bit is set, the mac dma contro ller resets all mac subsystem internal registers and logic. it is cleared automatically after the reset operation has completed in all of the core clock domains. read a 0 value in this bit before re-programming any register of the core. remark: the reset operation is completed only when all the resets in all the active clock domains are de-asserted. hence it is essential that all the phy inputs clocks (applicable for the selected phy interface) are present for software reset completion. 0r/ws/ sc 1 da dma arbitration scheme 0 = round-robin with rx:tx priority given in bits [15:14] 1 = rx has priority over tx 0r/w 6:2 dsl descriptor skip length this bit specifies the number of word/dword/lword (depending on 32/64/128-bit bus) to skip between two unchained descriptors. the address skipping starts from the end of current descriptor to the start of next descriptor. when dsl value equals zero, then the descriptor table is taken as contiguous by the dma, in ring mode. 0r/w 7 atds alternate (enhanced) descriptor size when set, the alternate (enhanced) descriptor (see section 22.9 ) size is increased to 32 bytes (8 dwords). this is required when the advanced time-stamp feature or full ipc offload engine is enabled in the receiver. when reset, the descriptor size reverts back to 4 dwords (16 bytes). this bit is present only when alternate descriptor feature is selected and either advanced time stamp or ipc full checksu m offload (type 2) feature is selected during configuration. otherwise, this bit is reserved and read-only. 0r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 497 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 13:8 pbl programmable burst length these bits indicate the maximum number of beats to be transferred in one dma transaction. this will be the maximum value that is used in a single block read/write. the dma will always attempt to burst as specified in pbl each time it starts a burst transfer on the host bus. pbl can be programme d with permissible values of 1, 2, 4, 8, 16, and 32. any other value will result in undefined behavior. when usp is set high, this pbl value is applicable for txdma transactions only. the pbl values have the following limitations. the maximum number of beats (pbl) possible is limited by the size of the tx fifo and rx fifo in the mtl layer and the da ta bus width on the dma. the fifo has a constraint that the maximum beat supported is half the depth of the fifo, except when specified (as given below). for different data bus widths and fifo sizes, the valid pbl range (including x8 mode) is provided in the following table. if the pbl is common for both transmit and receive dma, the minimum rx fifo and tx fifo depths must be considered. do not program out-of-range pbl values, because the system may not be have properly. 1r/w 15:14 pr rx-to-tx priority ratio rxdma requests given priority over txdma requests in the following ratio. this is valid only when the da bit is reset. 00 = 1-to-1 01 = 2-to-1 10 = 3-to-1 11 = 4-to-1 00 r/w 16 fb fixed burst this bit controls whether the ahb master interface performs fixed burst transfers or not. when set, the ahb will use only single, incr4, incr8 or incr16 during start of normal burst transfers. when reset, the ahb will use single and incr burst transfer operations. 0r/w 22:17 rpbl rxdma pbl these bits indicate the maximum number of beats to be transferred in one rxdma transaction. this will be the maximum value that is used in a single block read/write. the rxdma will always attempt to burst as specified in rpbl each time it starts a burst transfer on the host bus. rpbl can be programmed with permissible values of 1, 2, 4, 8, 16, and 32. any other value will result in undefined behavior. these bits are valid and applicable only when usp is set high. 1r/w 23 usp use separate pbl when set high, it configures the rxdma to us e the value configured in bits [22:17] as pbl while the pbl value in bits [13:8] is applicable to txdma operations only. when reset to low, the pbl value in bits [13:8] is applicable for both dma engines. 0r/w 24 pbl8x 8 x pbl mode when set high, this bit multiplies the pbl value programmed (bits [22:17] and bits [13:8]) eight times. thus the dma will transfer data in to a maximum of 8, 16, 32, 64, 128, and 256 beats depending on the pbl value. remark: this bit function is not backward compatible. before version 3.50a, this bit was 4xpbl. 0r/w table 421. dma bus mode register (dma_bus_mode, address 0x4001 1000) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 498 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.18 dma transmit poll demand register the transmit poll demand register enables the transmit dma to check whether or not the current descriptor is owned by dma. the transmit poll demand command is given to wake up the txdma if it is in suspend mode. the txdma can go into suspend mode due to an underflow error in a transmitted frame or due to the unavailability of descriptors owned by transmit dma. you can give th is command anytime an d the txdma will reset this command once it starts re-fetching the current descriptor from host memory. 25 aal address-aligned beats when this bit is set high and the fb bit equals 1, the ahb interface generates all bursts aligned to the start address ls bits. if the fb bit equals 0, the first burst (accessing the data buffer?s start address) is not aligned, but subsequent bursts are aligned to the address. 0r/w 26 mb mixed burst when this bit is set high and fb bit is low, the ahb master interface will start all bursts of length more than 16 with incr (undefined burst) whereas it will revert to fixed burst transfers (incrx and single) for burst-length of 16 and below. 0r/w 27 txpr when set, this bit indicates that the tran smit dma has higher priority than the receive dma during arbitration for the system-side bus. 0r/w 29:28 - 0ro 31:30 - reserved 0ro table 421. dma bus mode register (dma_bus_mode, address 0x4001 1000) bit description ?continued bit symbol description reset value access table 422. programmable burst length settings data bus width fifo depth valid pbl range in full duplex mode 32 bit 128 bytes 8 or less 256 bytes 32 or less 512 bytes 64 or less 1 kb 128 or less 2 kb and above all table 423. dma transmit poll demand re gister (dma_trans_poll_demand, address 0x4001 1004) bit description bit symbol description reset value access 31:0 tpd transmit poll demand when these bits are written with any value, the dma reads the current descriptor pointed to by the current host transmit descriptor register ( section 22.6.27 ). if that descriptor is not available (owned by host), transmission returns to the suspend state and bit 2 in the dma_stat register is asserted. if the descriptor is available, transmission resumes. 0ro/wt www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 499 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.19 dma receive poll demand register the receive poll demand register enables t he receive dma to check for new descriptors. this command is given to wa ke up the rxdma from suspen d state. the rxdma can go into suspend state only due to the unavailability of de scriptors owned by it. 22.6.20 dma receive descripto r list address register the receive descriptor list address register po ints to the start of the receive descriptor list. the descriptor lists reside in the host?s physical memory space and must be word/dword/lword-aligned (for 32/64/128- bit dat a bus). the dma interna lly converts it to bus width aligned address by making the corresponding ls bits low. writing to this register is permitted only when reception is st opped. when stopped, th is register must be written to before the receive start command is given. 22.6.21 dma transmit descr iptor list address register the transmit descriptor list address register po ints to the start of the transmit descriptor list. the descriptor lists reside in the host?s physical memory space and must be word/dword/lword-aligned (for 32/64/128-bit data bus). the dma internally converts it to bus width aligned address by making the corresponding lsb to low. writing to this register is permitted only when transmission has stopped. when stopped, this register can be written before the transmission start command is given. table 424. dma receive poll demand register (dma_rec_poll_demand, address 0x4001 1008) bit description bit symbol description reset value access 31:0 rpd receive poll demand when these bits are written with any value, the dma reads the current descriptor pointed to by the current host receive descriptor register ( section 22.6.28 ). if that descriptor is not available (owned by host), reception returns to the suspended state and bit 7 in the dma_stat register is not asserted. if the descriptor is available, the receive dma returns to active state. 0ro/wt table 425. dma receive descriptor list ad dress register (dma_rec_des_addr, address 0x4001 100c) bit description bit symbol description reset value access 31:0 srl start of receive list this field contains the base address of the first descriptor in the receive descriptor list. the lsb bits [1/2/3:0] for 32/64/128-bit bus width) w ill be ignored and taken as all-zero by the dma internally. hence these lsb bits are read only. 0r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 500 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.22 dma status register the status register contains all the status bits that the dma reports to the host. this register is usually read by t he software driver during an inte rrupt service rout ine or polling. most of the fields in this regi ster cause the host to be interrupt ed. the bits in this register are not cleared when read. writing 1 to (unreserve d) bits in this register (bits [16:0]) clears them and writing 0 has no effect. each field (bits[16:0]) can be masked by masking the appropriate bit in the dma_int_en register. table 426. dma transmit descriptor list address register (dma_trans_des_addr, address 0x4001 1010) bit description bit symbol description reset value access 31:0 srl start of transmit list this field contains the base address of the first descriptor in the transmit descriptor list. the lsb bits [1/2/3:0] for 32/64/128-bit bus width) w ill be ignored and taken as all-zero by the dma internally. hence these lsb bits are read only. 0r/w table 427. dma status register (dma_sta t, address 0x4001 1014) bit description bit symbol description reset value access 0 ti transmit interrupt this bit indicates that frame transmission is finished and tdes1[31] is set in the first descriptor. 0r/ss/ wc 1 tps transmit process stopped this bit is set when the transmission is stopped. 0r/ss/ wc 2 tu transmit buffer unavailable this bit indicates that the next descriptor in the transmit list is owned by the host and cannot be acquired by the dma. transmission is suspended. bits[22:20] explain the transmit process state transitions. to resume processing transmit descriptors, the host should change the ownership of the bit of the descriptor and then issue a transmit poll demand command. 0r/ss/ wc 3 tjt transmit jabber timeout this bit indicates that the transmit jabber timer expired, meaning that the transmitter had been excessively active. the transmission process is aborted and placed in the stopped state. this causes the transmit jabber timeout tdes0[14] flag to assert. 0r/ss/ wc 4 ovf receive overflow this bit indicates that the receive buffer had an overflow during frame reception. if the partial frame is transferred to application, the overflow status is set in rdes0[11]. 0r/ss/ wc 5 unf transmit underflow this bit indicates that the transmit buffer had an underflow during frame transmission. transmission is suspended and an underflow error tdes0[1] is set. 0r/ss/ wc 6 ri receive interrupt this bit indicates the completion of frame reception. specific frame status information has been posted in the descriptor. reception remains in the running state. 0r/ss/ wc www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 501 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 7 ru receive buffer unavailable this bit indicates that the next descriptor in the receive list is owned by the host and cannot be acquired by the dma. receive process is suspended. to resume processing receive descriptors, the host should change the ownership of the descriptor and issue a receive poll demand command. if no receive poll demand is issued, receive process resumes when the next recognized incoming frame is received. this bit is set only when the previous receive descriptor was owned by the dma. 0r/ss/ wc 8 rps received process stopped this bit is asserted when the receive process enters the stopped state. 0r/ss/ wc 9 rwt receive watchdog timeout this bit is asserted when a frame with a length greater than 2,048 bytes is received (10,240 when jumbo frame mode is enabled). 0r/ss/ wc 10 eti early transmit interrupt this bit indicates that the frame to be transmitted was fully transferred to the mtl transmit fifo. 0r/ss/ wc 12:11 - reserved 0 ro 13 fbi fatal bus error interrupt this bit indicates that a bus error occurred, as detailed in bits [25:23]. when this bit is set, the corresponding dma engine disables all its bus accesses. 0r/ss/ wc 14 eri early receive interrupt this bit indicates that the dma had filled the first data buffer of the packet. receive interrupt bit 6 in this register automatically clears this bit. 0r/ss/ wc table 427. dma status register (dma_sta t, address 0x4001 1014) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 502 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.23 dma operation mode register the operation mode register establishes t he transmit and receive operating modes and commands. this register should be the last csr to be written as part of dma initialization. 15 aie abnormal interrupt summary abnormal interrupt summary bit value is the logical or of the following when the corresponding interrupt bits are enabled in the dma_int_en register: dma_stat register, bit 1: transmit process stopped dma_stat register, bit 3: transmit jabber timeout dma_stat register, bit 4: receive overflow dma_stat register, bit 5: transmit underflow dma_stat register, bit 7: receiver buffer unavailable dma_stat register, bit 8: receive process stopped dma_stat register, bit 9: receive watchdog timeout dma_stat register, bit 10: early transmit interrupt dma_stat register, bit 13: fatal bus error only unmasked bits affect the abnormal interrupt summary bit. this is a sticky bit and must be cleared each time a corresponding bit that causes ais to be set is cleared. 0r/ss/ wc 16 nis normal interrupt summary normal interrupt summary bit value is the logical or of the following when the corresponding interrupt bits are enabled in the dma_int_en register: dma_stat register, bit 0: transmit interrupt dma_stat register, bit 2: transmit buffer unavailable dma_stat register, bit 6: receive interrupt dma_stat register, bit 14: early receive interrupt only unmasked bits affect the normal interrupt summary bit. this is a sticky bit and must be cleared (by writing a 1 to this bit) each time a corresponding bit that causes nis to be set is cleared. 0r/ss/ wc 31:17 - reserved 0ro table 427. dma status register (dma_sta t, address 0x4001 1014) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 503 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet table 428. dma operation mode register (dma _op_mode, address 0x4001 1018) bit description bit symbol description reset value access 0- reserved 0ro 1 sr start/stop receive when this bit is set, the receive process is placed in the running state. the dma attempts to acquire the descriptor from the receive list and processes incoming frames. descriptor acquisition is attempted from the current position in the list, which is the address set by the dma_rec_des_ addr register or the position retained when the receive process was previously stopped. if no descriptor is owned by the dma, reception is suspended and receive buffer unavailable bit (bit 7 in dma_stat register) is set. the start receive command is effective only when reception has stopped. if the command was issued before setting the dma_rec_des_addr, dma behavior is unpredictable. 0r/w 2 osf operate on second frame when this bit is set, this bit instructs the dma to process a second frame of transmit data even before status for first frame is obtained. 0r/w 4:3 rtc receive threshold control these two bits control the threshold level of the mtl receive fifo. transfer (request) to dma starts when the frame size within the mtl receive fifo is larger than the threshold. in addition, full frames with a length less than the threshold are transferred automatically. note that value of 11 is not applicable if the configured receive fifo size is 128 bytes. these bits are valid only when the rsf bit is zero, and are ignored when the rsf bit is set to 1. 00 = 64 01 = 32 10 = 96 11 = 128 0r/w 5- reserved 0ro 6 fuf forward undersized good frames when set, the rx fifo will forward undersized frames (frames with no error and length less than 64 bytes) including pad-bytes and crc). when reset, the rx fifo will drop all frames of less than 64 bytes, unless it is already transferred due to lower value of receive threshold (e.g., rtc = 01). 0r/w 7 fef forward error frames when this bit is reset, the rx fifo drops frames with error status (crc error, collision error, gmii_er, giant frame, watchdog timeout, overflow). however, if the frame?s start byte (write) pointer is already transferred to the read controller side (in threshold mode), then the frames are not dropped. . w hen fef is set, all frames except runt error frames are forwarded to the dma. but when rxfifo overflows when a partial frame is written, then such frames are dropped even when fef is set. 0r/w 12:8 - reserved 0ro www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 504 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 13 st start/stop transmission command when this bit is set, transmission is plac ed in the running stat e, and the dma checks the transmit list at the current position for a frame to be transmitted. descriptor acquisition is attempted either from the current position in the list, which is the transmit list base addres s set by the dma_trans_des_addr register or from the position retained when transmission was stopped previously. if the current descriptor is not owned by the dma, transmission enters the suspended state and transmit buffer unavailable (dma_stat register, bit 2) is set. the start transmission command is effective only when transmissi on is stopped. if the command is issued before setting the dma_trans_des_addr register, then the dma behavior is unpredictable. when this bit is reset, the transmission process is placed in the stopped state after completing the transmission of the current frame. the next descriptor position in the transmit list is saved, and becomes the current position when transmission is restarted. the stop transmission command is effective only the transmission of the current frame is complete or when the transmission is in the suspended state. 0r/w 16:14 ttc transmit threshold control these three bits control the threshold level of the mtl transmit fifo. transmission starts when the frame size within the mtl transmit fifo is larger than the threshold. in addition, full frames with a length less than the threshold are also transmitted. these bits are used only when the tsf bit (bit 21) is reset. 000 = 64 001 = 128 010 = 192 011 = 256 100 = 40 101 = 32 110 = 24 111 = 16 0r/w 19:17 - reserved 0ro 20 ftf flush transmit fifo when this bit is set, the transmit fifo controller logic is reset to its default values and thus all data in the tx fifo is lost/flushed. this bit is cleared internally when the flushing operation is completed fully. the operation mode register should not be written to until this bit is cleared. the data which is already accepted by the mac transmitter will not be flushed. it will be scheduled for transmission and will result in underflow and runt frame transmission. remark: the flush operation completes only after emptying the txfifo of its contents and all the pending transmit status of the transmitted frames are accepted by the host. in order to complete this flush operation, the phy transmit clock is required to be active. 0r/ws/ sc 21 tsf transmit store and forward when this bit is set, transmission starts when a full frame resides in the mtl transmit fifo. when this bit is set, the ttc values specified in this register (bits [16:14]) are ignored. this bit should be changed only when transmission is stopped. 0r/w 23:22 - reserved 0ro table 428. dma operation mode register (dma _op_mode, address 0x4001 1018) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 505 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.24 dma interrupt enable register the interrupt enable register enables the in terrupts reported by the dma_stat register. setting a bit to 1 enables a corresponding interrupt. after a hardware or software reset, all interrupts are disabled. 24 dff disable flushing of received frames when this bit is set, the rxdma does not flush any frames due to the unavailability of receive descriptors/buffers as it does normally when this bit is reset. (see ). 0r/w 25 rsf receive store and forward when this bit is set, the mtl only reads a frame from the rx fifo after the complete frame has been written to it, ignoring rtc bits. when this bit is reset, the rx fifo operates in cut-through mode, subject to the threshold specified by the rtc bits. 0r/w 26 dt disable dropping of tcp/ip checksum error frames when this bit is set, the core does not drop frames that only have errors detected by the receive checksum offload engine. such frames do not have any errors (including fcs error) in the ethernet frame received by the mac but have errors in the encapsulated payload only. when this bit is reset, all error frames are dropped if the fef bit is reset. 0r/w 31:27 - reserved 0ro table 428. dma operation mode register (dma _op_mode, address 0x4001 1018) bit description ?continued bit symbol description reset value access table 429. dma interrupt enable register (dma _int_en, address 0x4001 101c) bit description bit symbol description reset value access 0 tie transmit interrupt enable when this bit is set with normal interrupt summary enable (bit 16 in this register), transmit interrupt is enabled. when this bit is reset, transmit interrupt is disabled. 0r/w 1 tse transmit stopped enable when this bit is set with abnormal interrupt summary enable (bit 15 in this register), transmission stopped interrupt is enabled. when this bit is reset, transmission stopped interrupt is disabled. 0r/w 2 tue transmit buffer unavailable enable when this bit is set with normal interrupt summary enable (bit 16 in this register), transmit buffer unavailable interrupt is enabled. when this bit is reset, transmit buffer unavailable interrupt is disabled. 0r/w 3 tje transmit jabber timeout enable when this bit is set with abnormal interrupt summary enable (bit 15 in this register), transmit jabber timeout interrupt is enabled. when this bit is reset, transmit jabber timeout interrupt is disabled. 0r/w 4 ove overflow interrupt enable when this bit is set with abnormal interrupt summary enable (bit 15 in this register), receive overflow interrupt is enabled. when this bit is reset, overflow interrupt is disabled. 0r/w 5 une underflow interrupt enable when this bit is set with abnormal interrupt summary enable (bit 15 in this register), transmit underflow interrupt is enabled. when this bit is reset, underflow interrupt is disabled. 0r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 506 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 6 rie receive interrupt enable when this bit is set with normal interrupt summary enable (bit 16 in this register), receive interrupt is enabled. when this bit is reset, receive interrupt is disabled. 0r/w 7 rue receive buffer unavailable enable when this bit is set with abnormal interrupt summary enable (bit 15 in this register), receive buffer unavailable interrupt is enabled. when this bit is reset, the receive buffer unavailable interrupt is disabled. 0r/w 8 rse received stopped enable when this bit is set with abnormal interrupt summary enable (bit 15 in this register), receive stopped interrupt is enabled. when this bit is reset, receive stopped interrupt is disabled. 0r/w 9 rwe receive watchdog timeout enable when this bit is set with abnormal interrupt summary enable (bit 15 in this register), the receive watchdog timeout interrupt is enabled. when this bit is reset, receive watchdog timeout interrupt is disabled. 0r/w 10 ete early transmit interrupt enable when this bit is set with an abnormal interrupt summary enable (bit 15 in this register), early transmit interrupt is enabled. when this bit is reset, early transmit interrupt is disabled. 0r/w 12:11 - reserved 0 ro 13 fbe fatal bus error enable when this bit is set with abnormal interrupt summary enable (bit 15 in this register), the fatal bus error interrupt is enabled. when this bit is reset, fatal bus error enable interrupt is disabled. 0r/w 14 ere early receive interrupt enable when this bit is set with normal interrupt summary enable (bit 16 in this register), early receive interrupt is enabled. when this bit is reset, early receive interrupt is disabled. 0r/w table 429. dma interrupt enable register (dma _int_en, address 0x4001 101c) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 507 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet the interrupt (sbd_intr_o_interrupt) is generated as shown in figure 44 . it is asserted when the nis/ais status bit is asserted and the corresponding interrupt enable bits (nie/aie) are enabled. 15 aie abnormal interrupt summary enable when this bit is set, an abnormal interrupt is enabled. when this bit is reset, an abnormal interrupt is disabled. this bit enables the following bits dma_stat register, bit 1: transmit process stopped dma_stat register, bit 3: transmit jabber timeout dma_stat register, bit 4: receive overflow dma_stat register, bit 5: transmit underflow dma_stat register, bit 7: receiver buffer unavailable dma_stat register, bit 8: receive process stopped dma_stat register, bit 9: receive watchdog timeout dma_stat register, bit 10: early transmit interrupt dma_stat register, bit 13: fatal bus error 0r/w 16 nie normal interrupt summary enable when this bit is set, a normal interrupt is enabled. when this bit is reset, a normal interrupt is disabled. this bit enables the following bits: dma_stat register, bit 0: transmit interrupt dma_stat register, bit 2: transmit buffer unavailable dma_stat register, bit 6: receive interrupt dma_stat register, bit 14: early receive interrupt 0r/w 31:17 - reserved 0 ro table 429. dma interrupt enable register (dma _int_en, address 0x4001 101c) bit description ?continued bit symbol description reset value access fig 44. interrupt generation or sbd _intr_o and and and and and and or nis or ais nie aie ti tie eri ere tps tse fbi fbe www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 508 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.25 dma missed frame and buf fer overflow counter register the dma maintains two counters to track the number of missed frames during reception. this register reports the current value of the counter. the counter is used for diagnostic purposes. bits[15:0] indicate missed frames due to the host buffer being unavailable. bits[27:17] indicate missed frames due to buffer overflow conditions (mtl and mac) and runt frames (good frames of less than 64 bytes) dropped by the mtl. 22.6.26 dma receive interr upt watchdog ti mer register this register, when written with non-zero valu e, will enable the watchdog timer for ri (bit 6 in the dma_stat register). 22.6.27 dma current host transmit descriptor register the current host transmit descr iptor register points to the start address of the current transmit descriptor read by the dma. table 430. dma missed frame and buffer ov erflow counter regist er (dma_mfrm_bufof, address 0x4001 1020) bit description bit symbol description reset value access 15:0 fmc number of frames missed indicates the number of frames missed by the controller due to the host receive buffer being unavailable. this counter is incremented each time the dma discards an incoming frame. the counter is cleared when this register is read with . 0 r/ss/rc 16 oc overflow bit for missed frame counter 0 r/ss/rc 27:17 fma number of frames missed by the application indicates the number of frames missed by the application. this counter is incremented each time the mtl asserts the sideband signal mtl_rxoverflow_o. the counter is cleared when this register is read with . 0 r/ss/rc 28 of overflow bit for fifo overflow counter 0 r/ss/rc 31:29 - reserved 0 ro table 431. dma receive interrupt watchdog timer register (dma_rec_int_wdt, address 0x4001 1024) bit description bit symbol description reset value access 7:0 riwt ri watchdog timeout indicates the number of system clock cycles multiplied by 256 for which the watchdog timer is set. the watchdog timer gets triggered with the programmed value after the rxdma completes the transfer of a frame for which the ri status bit is not set due to the setting in the corresponding descriptor rdes1[31]. when the watch-dog timer runs out, the ri bit is set and the timer is stopped. the watchdog timer is reset when ri bit is set high due to automatic setting of ri as per rdes1[31] of any received frame. 0r/w 31:8 - reserved 0 ro www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 509 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.6.28 dma current host re ceive descriptor register the current host receive descriptor register points to the start address of the current receive descriptor re ad by the dma. 22.6.29 dma current host transmit buffer address register the current host transmit buffer address register points to the current transmit buffer address being read by the dma. 22.6.30 dma current host rece ive buffer address register the current host receive buffer address register points to the current receive buffer address being read by the dma. 22.7 functional description table 432. dma current host transmit desc riptor register (dma_curhost_trans_des, address 0x4001 1048) bit description bit symbol description reset value access 31:0 htd host transmit descriptor address pointer cleared on reset. pointer updated by dma during operation. 0ro table 433. dma current host receive descr iptor register (dma_curhost_rec_des, address 0x4001 104c) bit description bit symbol description reset value access 31:0 hrd host receive descriptor address pointer cleared on reset. pointer updated by dma during operation. 0ro table 434. dma current host transmit buffer address register (dma_curhost_trans_buf, address 0x4001 1050) bit description bit symbol description reset value access 31:0 htb host transmit buffer address pointer cleared on reset. pointer updated by dma during operation. 0ro table 435. dma current host receive buffer address register (dma_curhost_rec_buf, address 0x4001 1054) bit description bit symbol description reset value access 31:0 hrb host receive buffer address pointer cleared on reset. pointer updated by dma during operation. 0ro www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 510 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.7.1 power management block this section describes the power management (pmt) mechanisms supported by the mac. pmt supports the reception of networ k (remote) wake-up frames and magic packet frames. pmt does not perform the clock gate function, but generates interrupts for wake-up frames and magic packets received by the mac. the pmt block sits on the receiver path of the mac and is enabled with remote wake-up frame enable and magic packet enable. these enables are in the pmt control and status register and are programmed by the application. when the power-down mode is enabled in the pmt, then all received frames are dropped by the core and they are not forwarded to the application. the core comes out of the power down mode only when either a ma gic packet or a remote wake-up frame is received and the corresponding detection is enabled. 22.7.1.1 remote wake-up frame registers the register wkupfmfilter_reg, address (0x028), loads the wake-up frame filter register. to load values in a wake-up frame filter register, the entire register (wkupfmfilter_reg) must be written. th e wkupfmfilter_reg register is loaded by sequentially loading the eight register values in address (0x028) for wkupfmfilter_reg0, wkupfmfilter _reg1,... wkupfmfilter_reg7, respectively. wkupfmfilter_reg is read in the same way. remark: the internal counter to access th e appropriate wkupfmfilter_reg is incremented when lane 3 (or lane 0 in big-endi an) is accessed by the cpu. this should be kept in mind if you are accessing these registers in byte or half-word mode. filter i byte mask fig 45. wake-up frame filter register filter 0 byte mask filter 1 byte mask filter 2 byte mask filter 3 byte mask rsvd filter 3 command rsvd filter 2 command rsvd filter 1 command rsvd filter 0 command filter 3 offset filter 2 offset filter 1 offset filter 0 offset filter 1 crc - 16 filter 0 crc - 16 filter 3 crc - 16 filter 2 crc - 16 wkupfmfilter0 wkupfmfilter1 wkupfmfilter2 wkupfmfilter3 wkupfmfilter4 wkupfmfilter5 wkupfmfilter6 wkupfmfilter7 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 511 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet this register defines which bytes of the frame ar e examined by filter i (0, 1, 2, and 3) in order to determine whether or not the frame is a wake-up frame. the msb (thirty-first bit) must be zero. bit j [30:0] is the byte mask. if bit j (byte number) of the byte mask is set, then filter i offset + j of the incoming frame is processed by the crc block; otherwise filter i offset + j is ignored. filter i command this 4-bit command controls the filter i operat ion. bit 3 specifies the address type, defining the pattern?s destination address type. when the bit is set, the pattern applies to only multicast frames; when the bit is reset, the pattern applies only to unicast frame. bit 2 and bit 1 are reserved. bit 0 is the enable for filter i; if bit 0 is not set, filter i is disabled. filter i offset this register defines the offset (within the fr ame) from which filter i examines the frames. this 8-bit pattern offset is the offset for the filter i first byte to be examined. the minimum allowed is 12, which refers to the 13th byte of the frame. the offset value 0 refers to the first byte of the frame. filter i crc-16 this register contains the crc_16 value calcul ated from the pattern, as well as the byte mask programmed to the wake-up filter register block. 22.7.1.2 remote wake-up detection when the mac is in sleep mode and the remote wake-up bit is enabled in pmt control and status register (0x002c), normal oper ation is resumed after receiving a remote wake-up frame. the application writes all eight wake-up filter registers by performing a sequential write to address (0x0028). the ap plication enables remote wake-up by writing a 1 to bit 2 of the pmt control and status register. pmt supports four programmable filters that allow support of different receive frame patterns. if the incoming frame passes the address filtering of filter command, and if filter crc-16 matches the incoming examined pattern, then the wake-up frame is received. filter_offset (minimum value 12, which refers to the 13th byte of the frame) determines the offset from which the frame is to be examined . filter byte mask determines which bytes of the frame must be examined. the thirty-first bit of byte mask mu st be set to zero. the remote wake-up crc block determines t he crc value that is compared with filter crc-16. the wake-up frame is checked only for length error, fcs error, dribble bit error, mii error, collision, and to ensure that it is not a runt frame. even if the wake-up frame is more than 512 bytes long, if the frame has a valid crc value, it is considered valid. wake-up frame detection is updated in the pmt control and status register for every remote wake-up frame received. a pmt interrupt to the application triggers a read to the pmt control and status register to determine reception of a wake-up frame. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 512 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.7.1.3 magic packet detection the magic packet frame is based on a method that uses advanced micro device?s magic packet technology to power up the sleeping de vice on the network. the mac receives a specific packet of information, called a ma gic packet, addressed to the node on the network. only magic packets that are addressed to the device or a br oadcast address will be checked to determine whether they meet the wake-up requirements. magic packets that pass the address filter ing (unicast or broadcast) will be checked to de termine whether they meet the remote wake-on-lan data format of 6 bytes of all ones followed by a mac address appearing 16 times. the application enables magic packet wake-up by writing a 1 to bit 1 of the pmt control and status register. the pmt block constant ly monitors each frame addressed to the node for a specific magic packet pattern. each frame received is checked for a 0xffff ffff ffff pattern following the destination and source address field. the pmt block then checks the frame for 16 repetitions of the mac address without any breaks or interruptions. in case of a break in the 16 repetitions of the address, the 0xffff ffff ffff pattern is scanned for again in the in coming frame. the 16 repetitions can be anywhere in the frame, but must be prec eded by the synchronization stream (0xffff ffff ffff). the device will also ac cept a multicast frame, as long as the 16 duplications of the mac address are detected. if the mac address of a node is 0x0011 2233 4455, then the mac scans for the data sequence: 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 00 11 22 33 44 55 ...crc magic packet detection is updated in the pmt control and status register for magic packet received. a pmt interrupt to the applic ation triggers a read to the pmt csr to determine whether a magic packet frame has been received. 22.7.1.4 system considerations during power-down mac neither gates nor stops cl ocks when power-down mode is enabled. power saving by clock gating must be done outside the core by the application. the receive data path must be clocked with enet_rx_clk during power-down mode because it is involved in magic packet/wake-on-lan frame detection. however, th e transmit path and the application path clocks can be gated off during power-down mode. the pmt interrupt is asserted when a valid wake-up frame is received. this signal is generated in the receive clock domain the recommended power-down and wake-up sequence is as follows. 1. disable the transmit dma and wait for any previous frame transmissions to complete. these transmissions can be detected when transmit interrupt (see dma_stat register bit nis; table 427 ) is received. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 513 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 2. disable the mac transmitter and mac receiver by clearing the appropriate bits in the mac configuration register. 3. wait until the receive dma empties all the frames from the rx fifo (a software timer may be required). 4. enable power-down mode by appropriately configuring the pmt registers. 5. enable the mac receiver and enter power-down mode. 6. gate the application and transmit clock input s to the core (and ot her relevant clocks in the system) to reduce power and enter sleep mode. 7. on receiving a valid wake-up frame, the mac pmt interrupt signal and exits power-down mode. 8. on receiving the interrupt, the system must enable the ap plication and transmit clock inputs to the core. 9. read the pmt status register to clear the interrupt, then enable the other modules in the system and resume normal operation. remark: 22.7.2 dma arbiter functions if you have enabled the transmit (tx) dma and receive (rx) dma of a channel, you can specify which dma gets the bus when the channel gets the control of the bus. you can set the priority between the corresponding tx dma and rx dma by using the bit 27 (txpr: transmit priority) of the dma bus mode register). for round-robin arbitration, you can use the bits [15:14] (pr: priority ratio) of the bus mode register to specify the weighted priority between the tx dma and rx dma. table 436 provides information about the priority scheme between tx dma and rx dma. table 436. priority scheme fo r transmit and receive dma bit 27 bit 15 bit 14 bit 1 priority scheme 0 x x x rx always has priority over tx 0 0 0 0 tx and rx have equal priority. rx gets the access first on simultaneous requests. 0 0 1 0 rx has priority over tx in the ratio 2:1. 0 1 0 0 rx has priority over tx in the ratio 3:1. 0 1 1 0 rx has priority over tx in the ratio 4:1. 1 x x 1 tx always has priority over rx. 1 0 0 0 tx and rx have equal priority. tx gets the access first on simultaneous requests. 1 0 1 0 tx has priority over rx in the ratio 2:1. 1 1 0 0 tx has priority over rx in the ratio 3:1. 1 1 1 0 tx has priority over rx in the ratio 4:1. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 514 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.7.3 ipc receive check sum offload engine in this mode, both ipv4 and ipv6 frames in the received ethernet frames are detected and processed for data integrity.you can enable this module by setting the bit 10 (ipc) of the mac configuration registe ( section 22.6.1 ). the mac receiver identifies ipv4 or ipv6 frames by checking for value 0x0800 or 0x 86dd, respectively, in the received ethernet frames. type field. this identification applies to vlan-tagged frames as well. the receive checksum offload engine calcul ates ipv4 header checksums and checks that they match the received ipv4 header checksums. the result of this operation (pass or fail) is given to the rfc module for insertion into the receive status word. the ip header error bit is set for any mismatch between th e indicated payload type (ethernet type field) and the ip header version, or when the rece ived frame does not have enough bytes, as indicated by the ipv4 header.s length field (o r when fewer than 20 bytes are available in an ipv4 or ipv6 header). this engine also identifies a tcp, udp, or icmp payload in the received ip datagrams (ipv4 or ipv6) and calculates the checksum of such payloads properly, as defined in the tcp, udp, or icmp specifications. th is engine includes the tcp/udp/icmpv6 pseudo-header bytes for checksum calculation and checks whether the received checksum field matches the calculated value. th e result of this operation is given as a payload checksum error bit in th e receive status word. this status bit is also set if the length of the tcp, udp, or icmp payload does not match the expected payload length given in the ip header. this engine bypasses the payload of fragmented ip datagrams, ip datagrams with security features, ipv6 routing headers, an d payloads other than tcp, udp or icmp. 22.8 dma controller description the dma has independent transmit and receive engines and a csr space. the transmit engine transfers data from system memory to the device port (mtl), while the receive engine transfers data from the device port to the system memory. the controller use descriptors to efficiently move data from source to destination with minimal host cpu intervention. the dma is designed for packet-oriented data transfers such as frames in ethernet. the controller can be programmed to in terrupt the host cpu for situations such as frame transmit and receive transfer completion, and other normal/error conditions. the dma and the host driver communicate through two data structures: ? control and status registers (csr). see section 22.6 . ? descriptor lists and data buffers. see section 22.9 . the dma transfers data frames received by th e core to the receive buffer in the host memory, and transmit data frames from the transmit buffer in the host memory. descriptors that reside in the host memory ac t as pointers to these buffers. there are two descriptor lists; one for reception, and one fo r transmission. the base address of each list is written into dma registers table 425 and table 426 . a descriptor list is forward linked (either implicitly or exp licitly). the last descri ptor may point back to the first entry to create a ring structure. explicit ch aining of descriptors is accomp lished by setting the second address chained in both receive and transmit descriptors (rdes1[24] and tdes1[24]). the descriptor lists resides in the host physi cal memory address space. each descriptor can point to a maximum of two buffers. this enables two buffers to be used, physically www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 515 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet addressed, rather than contiguous buffers in memory. a data buffer resides in the host physical memory space, and consists of an entire frame or part of a frame, but cannot exceed a single frame. buffers contain only data, buffer status is maintained in the descriptor. data chaining refers to frames that span multiple data buffers. however, a single descriptor cannot span multiple frames. the dma skips to the next frame buffer when end-of-frame is detected. data chaining can be enabled or disabled. 22.8.1 initialization follow these steps to initia lize the ethernet controller: 1. write to dma register table 421 to set host bus access parameters. 2. write to dma register table 429 to mask unnecessary interrupt causes. 3. the software driver creates the transmit and receive descriptor lists. then it writes to both dma register table 425 and dma register table 426 , providing the dma with the starting address of each list. 4. write to mac registers table 404 , table 406 , and table 405 for desired filtering options. fig 46. descriptor ring and chain structure descriptor 0 buffer 1 buffer 2 descriptor 1 descriptor 2 buffer 1 buffer 2 buffer 1 buffer 2 descriptor n buffer 1 buffer 2 ring structure descriptor 0 buffer 1 chain structure descriptor 1 buffer 1 descriptor 2 buffer 1 next descriptor www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 516 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 5. write to mac register table 403 to configure the operating mode and enable the transmit operation (bit 3: transmitter enable). the ps and dm bits are set based on the auto-negotiation result (read from the phy). 6. write to dma register table 428 to set bits 13 and 1 to start transmission and reception. 7. write to mac register table 403 to enable the receive operation (bit 2: receiver enable). the transmit and receive engines enter the running state and attempt to acquire descriptors from the respective descriptor lists. the receive and transmit engines then begin processing receive and transmit oper ations. the transmit and receive processes are independent of each other and can be started or stopped separately. 22.8.1.1 host bus burst access the dma attempts to execute fixed-length burs t transfers on the ahb master interface if configured to do so (fb bit of dma register 0). the maximum burst length is indicated and limited by the pbl field (dma register 0[13:8]). the receive and transmit descriptors are always accessed in the maximum possible (limited by pbl or 16 x 8/bus width) burst-size for the 16-bytes to be read. the transmit dma initiates a data transfer only when sufficient space to accommodate the configured burst is available in mtl transm it fifo or the number of bytes till the end of frame (when it is less than the configured burst-length). the dma indicates the start address and the number of transfers required to the ahb master interface. when the ahb interface is configured for fixed-length burs t, then it transfers data using the best combination of incr4/8/16 and si ngle transactions. otherwise (no fixed-length burst), it transfers data using incr (undefined length) and single transactions. the receive dma initiates a data transfer only when sufficient data to accommodate the configured burst is available in mtl receive fi fo or when the end of frame (when it is less than the configured burst-length) is det ected in the receive fifo. the dma indicates the start address and the number of transfer s required to the ahb master interface. when the ahb interface is configured for fixed-length burst, then it transfers data using the best combination of incr4/8/16 and single transa ctions. if the end-of frame is reached before the fixed-burst ends on the ahb interf ace, then dummy transfers are performed in order to complete the fixed-burst. otherwise (fb bit of dma register table 421 is reset), it transfers data using incr (undefined length) and single transactions. when the ahb interface is configured for address-aligned beats, both dma engines ensure that the first burst transfer the ahb initiates is less than or equal to the size of the configured pbl. thus, all subsequent beats start at an address that is aligned to the configured pbl. the dma can only align the address for beats up to size 16 (for pbl > 16), because the ahb in terface does not support more than incr16. 22.8.1.2 host data buffer alignment the transmit and receive data buffers do no t have any restrictions on start address alignment. for example, in systems with 32-bit memory, the start address for the buffers can be aligned to any of the four bytes. however, the dma always initiates transfers with address aligned to the bus width with dummy data for the byte lanes not required. this typically happens during the transfer of the beginning or end of an ethernet frame. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 517 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet example: buffer read if the transmit buffer address is 0x00000ff2 (for 32-bit data bus), and 15 bytes need to be transferred, then the dma reads five full words from address 0x00000ff0, but when transferring data to the mtl transmit fifo, the extra bytes (the first two bytes) are dropped or ignored. similarly, the last 3 bytes of the last transfer are also ignored. the dma always ensures it tr ansfers a full 32-bit data to the mtl transmit fifo, unless it is the end-of-frame. example: buffer write if the receive buffer address is 0x0000ff2 (for 64-bit data bus) and 16 bytes of a received frame need to be transferred, then the dma writes 3 full words from address 0x00000ff0. but the first 2 bytes of first transf er and the last 6 bytes of the third transfer have dummy data. 22.8.1.3 buffer size calculations the dma does not update the size fields in the transmit and receive descriptors. the dma updates only the status fields (rdes an d tdes) of the descriptors. the driver has to perform the size calculations. the transmit dma transfers the exact number of bytes (indicated by buffer size field of tdes1) towards the mac core. if a descriptor is marked as first (fs bit of tdes1 is set), then the dma marks the first transfer from the buffer as the start of frame. if a descriptor is marked as last (ls bit of tdes1), then the dma marks the last tran sfer from that data buffer as the end-of frame to the mtl. the receive dma transfers data to a buffer unt il the buffer is full or the end-of frame is received from the mtl. if a de scriptor is not marked as last (ls bit of rdes0), then the descriptor?s corresponding buffer(s) are full and the amount of valid data in a buffer is accurately indicated by its buffer size field minus the data buffer pointer offset when the fs bit of that descriptor is set. the offset is zero when the data buffer pointer is aligned to the data bus width. if a descripto r is marked as last, then the buffer may not be full (as indicated by the buffer size in rdes1). to co mpute the amount of valid data in this final buffer, the driver must read the frame length (fl bits of rdes0[29:16]) and subtract the sum of the buffer sizes of the preceding buffers in this frame. the receive dma always transfers the start of next frame with a new descriptor. remark: even when the start address of a receive buffer is not aligned to the system bus?s data width, the system sh ould allocate a receive buffe r of a size aligned to the system bus width. for example, if the system allocates a 1,024-byte (1 kb) receive buffer starting from address 0x1000, the software can program the buffer start address in the receive descriptor to have a 0x1002 offset . the receive dma writes the frame to this buffer with dummy data in the first two locations (0x1000 and 0x1001). the actual frame is written from location 0x1002. thus, the actual useful space in this buffer is 1,022 bytes, even though the buffer size is programmed as 1,024 bytes, because of the start address offset. 22.8.1.4 dma arbiter for mac-dma and mac-ahb cores the arbiter inside the dma module performs the arbitration between the transmit and receive channel accesses to the ahb master interface. two types of arbitrations are possible: round-robin, and fixed-priority. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 518 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet when round-robin arbitration is selected (da bit of register table 421 (bus mode register) is reset), the arbiter allocates the data bus in the ratio set by the pr bits of dma register table 421 , when both transmit and receive dmas are requesting for access simultaneously. when the da bit is set, the receive dma always gets priority over the transmit dma for data access by default. when the txpr bit (bit 27 of dma register table 421 ) is also set, then the transmit dma ge ts priority over the receive dma as . 22.8.2 transmission 22.8.2.1 txdma operation: default (non-osf) mode the transmit dma engine in default mode proceeds as follows: 1. the host sets up the transmit descriptor (tdes0-tdes3) and sets the own bit (tdes0[31]) after setting up the corresponding data buffer(s) with ethernet frame data. 2. once the st bit (dma register) is set, the dma enters the run state. 3. while in the run state, the dma polls the transmit descriptor list for frames requiring transmission. after polling starts , it continues in either sequ ential descript or ring order or chained order. if the dma detects a descr iptor flagged as owned by the host, or if an error condition occurs, transmission is suspended and both the transmit buffer unavailable (dma register table 427 ) and normal interrupt summary (dma register table 427 ) bits are set. the transmit engine proceeds to step 9. 4. if the acquired descriptor is flagged as owned by dma (tdes0[31] = 1), the dma decodes the transmit data buffer address from the acquired descriptor. 5. the dma fetches the transmit data from the host memory and transfers the data to the mtl for transmission. 6. if an ethernet frame is stored over data buffers in multiple descriptors, the dma closes the intermediate descriptor and fetc hes the next descriptor. steps 3, 4, and 5 are repeated until the end-of-ethernet-frame data is transferred to the mtl. 7. when frame transmission is complete, if ieee 1588 time stamping was enabled for the frame (as indicated in the transmit status) the timestamp value obtained from mtl is written to the transmit descriptor (tdes2 and tdes3) that contains the end-of-frame buffer. the status information is then written to this transmit descriptor (tdes0). because the own bit is cleared du ring this step, the host now owns this descriptor. if time stamping was not enabled for this frame, the dm a does not alter the contents of tdes2 and tdes3. 8. transmit interrupt (dma register table 427 ) is set after completi ng transmission of a frame that has interr upt on completion (tdes1[31]) se t in its last descriptor. the dma engine then returns to step 3. 9. in the suspend state, the dma tries to re-acquire the descriptor (and thereby return to step 3) when it receives a transmit poll demand and the underflow interrupt status bit is cleared. the txdma transmission flow in default mode is shown in figure 47 . www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 519 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.8.2.2 txdma operation: osf mode while in the run state, the transmit proc ess can simultaneously acquire two frames without closing the status descriptor of the fi rst (if the osf bit is set in dma operation mode register, bit 2). as the transmit proces s finishes transferring the first frame, it fig 47. txdma operation in default mode start txdma (re-)fetch next descriptor write status word to tdes0 wait for tx status transfer data from buffer(s) (ahb) error? own bit set? (ahb) error? frame xfer complete? time stamp present? (ahb) error? write time stamp to tdes2 and tdes3 (ahb) error? stop txdma txdma suspended no ye s no ye s no no start ye s ye s ye s close intermediate descriptor no ye s no ye s no poll demand www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 520 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet immediately polls the transmit de scriptor list for the second frame. if the second frame is valid, the transmit process tran sfers this frame before writing the first frame?s status information. in osf mode, the run state transmit dma operates in the following sequence: 1. the dma operates as described in step s 1 to 6 of the txdma (default mode). 2. without closing the previous frame?s la st descriptor, the dma fetches the next descriptor. 3. if the dma owns the acquired descriptor , the dma decodes the transmit buffer address in this descriptor. if the dma does not own the descriptor, the dma goes into suspend mode and skips to step 7. 4. the dma fetches the transmit frame from the host memory and transfers the frame to the mtl until the end-of-frame data is transferred, closing the intermediate descriptors if this frame is split across multiple descriptors. 5. the dma waits for the previous frame?s frame transmission status and time stamp. once the status is available, the dma writes the time st amp to tdes2 and tdes3, if such time stamp was captured (as indicated by a status bit). the dma then writes the status, with a cleared own bit, to the corresponding tdes0, thus closing the descriptor. if time stamping was not enabled for the previous frame, the dma does not alter the contents of tdes2 and tdes3. 6. if enabled, the transmit interrupt is set, the dma fetches the next descriptor, then proceeds to step 3 (when status is normal) . if the previous transmission status shows an underflow error, the dma goes into suspend mode (step 7). 7. in suspend mode, if a pending status and time stamp are received from the mtl, the dma writes the time stamp (if enabled for the current frame) to tdes2 and tdes3, then writes the status to the corresponding tdes0. it then sets relevant interrupts and returns to suspend mode. 8. the dma can exit suspend mode and enter the run state (go to step 1 or step 2 depending on pending status) only after receiving a transmit poll demand (dma transmit poll demand register). remark: as the dma fetches the next descriptor in advance before closing the current descriptor, the descriptor chain should have more than 2 different descriptors for correct and proper operation. the basic flow is described in figure 48 . www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 521 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet fig 48. txdma operation in osf mode previous frame status available start txdma (re-)fetch next descriptor write status word to prev. frame?s tdes0 transfer data from buffer(s) (ahb) error? own bit set? (ahb) error? frame xfer complete? time stamp present? (ahb) error? write time stamp to tdes2 & tdes3 for previous frame (ahb) error? stop txdma no ye s no ye s no start ye s close intermediate descriptor no no wait for previous frame?s tx status second frame? ye s ye s no ye s ye s write time stamp to tdes2 & tdes3 for previous frame (ahb) error? (ahb) error? ye s time stamp present? ye s write status word to prev. frame?s tdes0 txdma suspended ye s no ye s no no poll demand no no www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 522 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.8.2.3 transmit frame processing the transmit dma expects that the data buffers contain complete ethernet frames, excluding preamble, pad bytes, and fcs fields. the da, sa, and type/len fields contain valid data. if the transmit descriptor indica tes that the mac core must disable crc or pad insertion, the buffer must have complete ethernet frames (excluding preamble), including the crc bytes. frames can be data-chained and can span several buffers. frames must be delimited by the first descriptor (tdes1[29]) and the last descriptor (tdes1[30]), respectively. as transmission starts, the first descriptor mu st have (tdes1[29]) set. when this occurs, frame data transfers from the host buffer to the mtl transmit fifo. concurrently, if the current frame has the last descriptor (tdes1[30]) clear, the transmit process attempts to acquire the next descriptor. the transm it process expects this descriptor to have tdes1[29] clear. if tdes1[30] is clear, it indi cates an intermediary buffer. if tdes1[30] is set, it indicates the last buffer of the frame. after the last buffer of the frame has been transmitted, the dma writes back the final status information to the transmit descriptor 0 (tdes0) word of the descriptor that has the last segment set in transmit descriptor 1 (tdes1[30]). at this time, if interrupt on completion (tdes1[31]) wa s set, transmit interrupt (dma st atus register, bit 0) is set, the next descriptor is fetched, and the process repeats. the actual frame transmission begins after the mtl transmit fifo has reached either a programmable transmit threshold (dma operation mode register, bits [16:14]), or a full frame is contained in the fifo. there is also an option for store and forward mode (dma operation mode register, bit [21]). descript ors are released (own bit tdes0[31] clears) when the dma finishes transferring the frame. remark: to ensure proper transmission of a frame and the next frame, you must specify a non-zero buffer size for the transmit descript or that has the last descriptor (tdes1[30]) set. 22.8.2.4 transmit polling suspended transmit polling can be suspended by either of the following conditions: ? the dma detects a descriptor owned by the host (tdes0[31]=0). to resume, the driver must give descriptor ownershi p to the dma and then issue a poll demand command. ? a frame transmission is aborted when a transmit error because of underflow is detected. the appropriate transmit descriptor 0 (tdes0) bit is set. if the second condition occur, both abnormal interrupt summary (dma status register table 427 ) and transmit underflow bi ts (dma status register table 427 ) are set, and the information is written to tran smit descriptor 0, causing the suspension. if the dma goes into suspend state becau se of the first condition, th en both normal in terrupt summary (dma status register table 427 ) and transmit buffer unavailable (dma status register table 427 ) are set. in both cases, the position in the transmit list is retained. the retained position is that of the descriptor following the last descriptor closed by the dma. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 523 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet the driver must explicitly issue a transmit poll demand command after rectifying the suspension cause. 22.8.2.5 reception the receive dma engine?s reception sequence is shown in figure 49 and proceeds as follows: 1. the host sets up receive descriptors (rdes0-rdes3) and sets the own bit (rdes0[31]). 2. once the sr (dma operation mode register ta b l e 4 2 8 ) bit is set, the dma enters the run state. while in the run state, th e dma polls the receive descriptor list, attempting to acquire free descri ptors. if the fetched descript or is not free (is owned by the host), the dma enters the suspend state and jumps to step 9. 3. the dma decodes the receive data buffer address from the acquired descriptors. 4. incoming frames are processed and placed in the acquired descriptor?s data buffers. 5. when the buffer is full or the frame trans fer is complete, the receive engine fetches the next descriptor. 6. if the current frame transfer is complete, the dma proceeds to step 7. if the dma does not own the next fetched descriptor and the frame transfer is not complete (eof is not yet transferred), the dma sets the descriptor error bit in the rdes0 (unless flushing is disabled). the dma closes the current descriptor (clears the own bit) and marks it as intermediate by clearing the last segment (ls) bit in the rdes0 value (marks it as last descriptor if flushing is no t disabled), then proceeds to step 8. if the dma does own the next descriptor but the current frame transfer is not complete, the dma closes the current descriptor as in termediate and reverts to step 4. 7. if ieee 1588 time stamping is enabled, the dma writes the timestamp (if available) to the current descriptor?s rdes2 and rdes3. it then takes the receive frame?s status from the mtl and writes the status word to the current descriptor?s rdes0, with the own bit cleared and the last segment bit set. 8. the receive engine checks the latest de scriptor?s own bit. if the host owns the descriptor (own bit is 0) the receive buff er unavailable bit (dma status register table 427 ) is set and the dma receive engine en ters the suspended state (step 9). if the dma owns the descriptor, the engine returns to step 4 and awaits the next frame. 9. before the receive engine enters the sus pend state, partial frames are flushed from the receive fifo (you can control flushi ng using bit 24 of dma operation mode register ta b l e 4 2 8 ). 10. the receive dma exits the suspend stat e when a receive poll demand is given or the start of next frame is available from the mtl?s receive fifo. the engine proceeds to step 2 and refe tches the next descriptor. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 524 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet the dma does not acknowledge accepting the status from the mtl until it has completed the time stamp write-back and is ready to perform status write-back to the descriptor. fig 49. receive dma operation (re-)fetch next descriptor (ah b) error? no own bit set? yes yes stop rxdma start rxdma start (ah b) error? no rxdma suspended yes frame data available? wait for frame data write data to buffer(s) yes yes fetch next descriptor yes no frame transfer complete? no set descriptor error yes time stamp present? no close rdes0 as last descriptor write time stamp to rdes2 & rdes3 no (ahb) error? yes close rdes0 as intermediate descriptor frame transfer complete? no flush disabled? no flush the remaining frame yes yes no no no yes yes poll demand / new frame available no yes (ah b) error? (ah b) error? no own bit set for next desc? flush disabled? www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 525 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet if software has enabled time stamping through csr, when a valid time stamp value is not available for the frame (for example, because the receive fifo was full before the time stamp could be written to it), the dma writ es all-ones to rdes2 and rdes3. otherwise (that is, if time stamping is not enabled ), the rdes2 and rdes3 remain unchanged. 22.8.2.6 receive descriptor acquisition the receive engine always attempts to acquire an extra descriptor in anticipation of an incoming frame. descriptor acquisition is atte mpted if any of the fo llowing conditions is satisfied: ? the receive start/stop bit (dma operation mode register table 428 ) has been set immediately after being placed in the run state. ? the data buffer of current descriptor is full before the frame ends for the current transfer. ? the controller has completed frame reception, but the current receive descriptor is not yet closed. ? the receive process has been suspended because of a host-owned buffer (rdes0[31] = 0) and a new frame is received. ? a receive poll demand has been issued. 22.8.2.7 receive frame processing the mac transfers the received frames to the host memory only when the frame passes the address filter and frame size is greater than or equal to configurable threshold bytes set for the receive fifo of mtl, or when th e complete frame is wr itten to the fifo in store-and-forward mode. if the frame fails the address filt ering, it is dropped in the ma c block itself (unless receive all bit 3 is set in the mac frame filter register; table 404 ). frames that are shorter than 64 bytes, because of collisio n or premature termination, can be purged from the mtl receive fifo. after 64 (configurable threshold) bytes have been received, the mtl block requests the dma block to begin transferring the frame data to the receive buffer pointed to by the current descriptor. the dma sets first descriptor (rdes0[9]) after the dma host interface (ahb or mdc) becomes ready to rece ive a data transfer (if dma is not fetching transmit data from the host), to delimit the frame. the descriptors are released when the own (rdes[31]) bit is reset to 0, either as the da ta buffer fills up or as the last segment of the frame is transferred to the receive buffer. if the frame is contained in a single descriptor, both last descriptor (rdes[8] ) and first descriptor (rdes[9]) are set. the dma fetches the next descriptor, sets th e last descriptor (rdes[8]) bit, and releases the rdes0 status bits in the previous frame descriptor. then the dma sets receive interrupt (register 5[6]). the same process repeats unless the dma encounters a descriptor flagged as being owned by the hos t. if this occurs, the receive process sets receive buffer unavailable (dma status register table 427 ) and then enters the suspend state. the position in the receive list is retained. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 526 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.8.2.8 receive process suspended if a new receive frame arrives while the rece ive process is in suspend state, the dma refetches the current descriptor in the host memory. if the descriptor is now owned by the dma, the receive process re-enters the run state and starts frame reception. if the descriptor is still owned by the host, by defau lt, the dma discards the current fram e at the top of the mtl rx fifo and increments the missed frame counter. if more than one frame is stored in the mtl rx fifo, the process repeats. the discarding or flushing of the frame at the top of the mtl rx fifo can be avoided by setting operation mode register bit 24 (dff) in table 428 . in such condit ions, the receive process sets the receive buffer unavailable status and returns to the suspend state. 22.8.2.9 interrupts interrupts can be generated as a result of various events. the dma status register ( table 427 ) contains all the bits that might cause an interrupt. table 429 contains an enable bit for each of the events that can cause an interrupt. there are two groups of interrupts, normal and abnormal, as described in dma status register ( table 427 ). interrupts are cleared by writing a 1 to the corresponding bit position. when all the enabled interrupts within a gr oup are cleared, the corresponding summary bit is cleared. when both the summary bits are cleared, the interrupt signal is de-asserted. if the mac core is the cause for assertion of the interrupt, then any of the gli, gmi, or gpi bits of dma status register ( table 427 ) are set high. remark: the dma status register ( table 427 ) is the (interrupt) status register. the interrupt pin is asserted because of any ev ent in this status register only if the corresponding interrupt enable bit is set in dma interrup t enable register ( ta b l e 4 2 9 ). interrupts are not queued and if the interrupt event occurs before the driver has responded to it, no additional interrupts are generated. for example, the receive interrupt (bit 6 of the dma status register ( table 427 ) indicates that one or more frames were transferred to the host buffer. the driver must scan all descriptors, from the last recorded position to the first one owned by the dma. an interrupt is generated only once for simultaneous, multiple events. the driver must scan the dma status register ( ta b l e 4 2 7 ) for the cause of the inte rrupt. the interrupt is not generated again unless a new interrupting event occurs, after the driver has cleared the appropriate bit in dma status register. fo r example, the controller generates a dma receive interrupt (bit 6 of the dma status re gister), and the driver begins reading dma status register . next, receive buffer unava ilable (bit 7 of dma status register (status register)) occurs. the driver clears the receive interrupt. even then, the sbd_intr_o signal is not de-asserted, because of the ac tive or pending receive buffer unavailable interrupt. an interrupt timer riwt (bits 7:0 in receive interrupt watchdog timer register ( table 431 )) is given for flexible control of receiv e interrupt. when this interrupt timer is programmed with a non-zero value, it gets activated as soon as the rxdma completes a transfer of a received frame to system me mory without asserting the receive interrupt because it is not enabled in the correspondi ng receive descriptor (rdes1[31]. when this timer runs out as per the programmed value, ri bit is set and the interrupt is asserted if www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 527 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet the corresponding ri is enabled in dma interrupt enable register ( table 429 ). this timer gets disabled before it runs out, when a frame is transferred to memory and the ri is set because it is enabled for that descriptor. 22.8.2.10 error response to dma for any data transfer initiated by a dma channel, if the slave replies with an error response, that dma stops all operations and updates the error bits and the fatal bus error bit in the dma status register ( table 427 ). that dma controller can resume operation only after soft resetting or hard resetting the core and re-initializing the dma. this dma behavior is true for non-ahb interf aced dmas that receive an error response. 22.9 ethernet descript ors (enhanced format) the enhanced de scriptor structur e supports up to 8 dwords (32 bytes) and the ieee 1588-2008 advanced timestamp feature or the av feature. the features of the enhanced descriptor structure are: ? enhanced descriptor size can be 4 dwords (16 bytes) or 8 dwords (32 bytes) depending on the setting of the atds bit in the dma bus mode register ( table 421 ). ? support buffers of up to 8 kb (useful for ju mbo frames). ? the transmit descriptor stores the timest amp in tdes6 and tdes7 when you select the advanced timestamp. ? this receive descriptor structure is also us ed for storing the extended status (rdes4) and timestamp (rdes6 and rdes7) when advanced timestamp feature or ipc full offload is selected. ? when the enhanced descriptor mode is selected, and the timestamp feature is enabled, the software needs to allocate 32-bytes (8 dwords) of memory for every descriptor. when timestamping or receive ipc fulloffload engine are not enabled, the extended descriptors are not required and the sw can use alternate descriptors with the default size of 16 bytes. the core al so needs to be configured for this change using the bit 7 (atds: alternate descri ptor size) of dma bus mode register ( table 421 ). ? when an enhanced descriptor is chosen without timestamp or full ipc offload feature, the descriptor size is always 4 dwords (des0-des3). the description or bit-mapping alternate de scriptor structure (in little-endian mode) is given below. 22.9.1 transmit descriptor the transmit descriptor structure is shown in figure 50 . the application software must program the control bits tdes0[31:20] duri ng descriptor initializ ation. when the dma updates the descriptor, it write backs all the control bits except the own bit (which it clears) and updates the status bits[19:0]. the co ntents of the transmitter descriptor word 0 (tdes0) through word 3 (tdes3) are given in table 437 through table 440 , respectively. with the advance timestamp support, the snapsh ot of the timestamp to be taken can be enabled for a given frame by setting bit ttse: transmit timestamp enable. (bit-25 of tdes0). when the descriptor is closed (i.e. when the own bit is cleared), the time-stamp www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 528 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet is written into tdes6 and tdes7. this is in dicated by the status bit ttss: transmit timestamp status. (bit-17 of tdes0). this is shown in figure 50 . the contents of tdes6 and tdes7 are mentioned in table 441 to table 442 . when either advanced timestamp or ipc offload (type 2) features is enabled, the sw should set the dma bus mode register[7], so that the dma operates with extended descriptor size. when this control bit is reset, the tdes4-tdes7 descriptor space are not valid. the dma always reads or fetches four dwords of the descriptor from system memory to obtain the buffer and control information as shown in figure 51 . when advanced timestamp feature support is enabled, tdes0 ha s additional control bits[6:3] for channel 1 and channel 2. for channel 0, the bits 6:3 are ignored. the bits 6:3 are described in table 437 . fig 50. transmitter descriptor fields - enhanced format o w n status [16:0] buffer 1 address [31:0] buffer 2 address [31:0] or next descriptor address [31:0] r e s buffer 2 byte count [28:16] buffer 1 byte count [12:0] 31 0 tdes0 tdes3 tdes2 tdes1 t t t s reserved tdes4 reserved tdes5 transmit time stamp low [31:0] tdes6 transmit time stamp high [31:0] tdes7 r e s r e s ctrl [30:26] t t s e r e s ctrl [23:20] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 529 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet fig 51. transmit descriptor fetch (read) for enhanced format o w n reserved for status [3:0] buffer 1 address [31:0] buffer 2 address [31:0] or next descriptor address [31:0] r e s buffer 2 byte count [28:16] buffer 1 byte count [12:0] 31 0 tdes0 tdes3 tdes2 tdes1 r e s r e s ctrl [30 :26 ] t t s e r e s ctrl [23:20] reserved for status [17:7] slot number [6 :3 ] table 437. transmit descriptor word 0 (tdes0) bit symbol description 0 db deferred bit when set, this bit indicates that the mac defers before transmission because of the presence of carrier. this bit is valid only in half-duplex mode. 1 uf underflow error when set, this bit indicates that the mac aborted the frame because data arrived late from the host memory. underflow error indicates that the dma encountered an empty transmit buffer while transmitting the frame. the transmission process enters the suspended state and sets both transmit underflow (register 5[5]) and transmit interrupt (register 5[0]). 2 ed excessive deferral when set, this bit indicates that the transmission has ended because of excessive deferral of over 24,288 bit times (155,680 bits times in 1,000-mbps mode or if jumbo frame is enabled) if the deferral check (dc) bit in the mac control register is set high. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 530 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 6:3 cc/ slotnu m cc: collision count (status field) these status bits indicate the number of collisions that occurred before the frame was transmitted. this count is not valid when the excessive collisions bit (tdes0[8]) is set. the core updates this status field only in the half-duplex mode. slotnum: slot number control bits in av mode these bits indicate the slot interval in which the data should be fetched from the corresponding buffers addressed by tdes2 or tdes3. when the transmit descriptor is fetched, the dma compares the slot number value in this field with the slot interval maintained in the core (register 11xx). it fetches the data from the buffers only if there is a match in values. these bits are valid only for the av channels (not channel 0). 7vfvlan frame when set, this bit indicates that the transmitted frame was a vlan-type frame. 8 ec excessive collision when set, this bit indicates that the transmission was aborted after 16 successive collisions while attempting to transmit the current frame. if the dr (disable retry) bit in the mac configuration register is set, this bit is set after the first collision, and the tr ansmission of the frame is aborted. 9 lc late collision when set, this bit indicates that frame transmission was aborted due to a collision occurring after the collision window (64 byte-times, including preamble, in mii mode and 512 byte-times, including preamble and carrier extension, in mii mode). this bit is not valid if the underflow error bit is set. 10 nc no carrier when set, this bit indicates that the carrier sense signal form the phy was not asserted during transmission. 11 lc loss of carrier when set, this bit indicates that a loss of carrier occurred during frame transmission (that is, the gmii_crs_i signal was inactive for one or more transmit clock periods during frame transmission). this is valid only for the frames transmitted without collision wh en the mac operates in half-duplex mode. 12 ipe ip payload error when set, this bit indicates that mac transmitter detected an error in the tcp, udp, or icmp ip datagram payload. the transmitter checks the payload length received in the ipv4 or ipv6 header against the actual number of tcp, udp, or icmp packet bytes received from the application and issues an error status in case of a mismatch. 13 ff frame flushed when set, this bit indicates that the dma/mtl flushed the frame due to a software flush command given by the cpu. 14 jt jabber timeout when set, this bit indicates the mac transmitter has experienced a jabber time-out. this bit is only set when the mac configuration register?s jd bit is not set. table 437. transmit descriptor word 0 (tdes0) bit symbol description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 531 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 15 es error summary indicates the logical or of the following bits: ? tdes0[14]: jabber timeout ? tdes0[13]: frame flush ? tdes0[11]: loss of carrier ? tdes0[10]: no carrier ? tdes0[9]: late collision ? tdes0[8]: exce ssive collision ? tdes0[2]: exce ssive deferral ? tdes0[1]: underflow error ? tdes0[16]: ip header error ? tdes0[12]: ip payload error 16 ihe ip header error when set, this bit indicates that the mac transmitter detected an error in the ip datagram header. the transmitter checks the header length in the ipv4 packet against the number of header bytes received from the application and indicates an error status if there is a mismatch. for ipv6 frames, a header error is reported if the main header length is not 40 bytes. furthermore, the ethernet length/type field value for an ipv4 or ipv6 frame must match the ip header version received with the packet. for ipv4 frames, an error status is also indicated if the header length field has a value less than 0x5. 17 ttss transmit timestamp status this field is used as a status bit to indicate that a timestamp was captured for the described transmit frame. when this bit is set, tdes2 and tdes3 have a timestamp value captured for the transmit frame. this field is only valid when the descriptor?s last segment control bit (tdes0[29]) is set. 19:18 - reserved 20 tch second address chained when set, this bit indicates that the second address in the descriptor is the next descriptor address rather than the second buffer address. when tdes0[20] is set, tbs2 (tdes1[28:16]) is a ?don?t care? value. tdes0[21] takes precedence over tdes0[20]. 21 ter transmit end of ring when set, this bit indicates that the descriptor list reached its final descriptor. the dma returns to the base address of the list, creating a descriptor ring. 23:22 cic checksum in sertion control these bits control the checksum calculation and insertion. bit encodings are as shown below. ? 00: checksum insertion disabled. ? 01: only ip header checksum calculation and insertion are enabled. ? 10: ip header checksum and paylo ad checksum calculation and insertion are enabled, but pseudo- header checksum is not ca lculated in hardware. ? 11: ip header checksum and payload checksum calculation and insertion are enabled, and pseudo-header checksum is calculated in hardware. this field is reserved when the ipc_full_offload configuration parameter is not selected. 24 - reserved 25 ttse transmit timestamp enable when set, this bit enables ieee1588 hardware time stamping for the transmit frame referenced by the descriptor. this field is valid only when the first segment control bit (tdes0[28]) is set. table 437. transmit descriptor word 0 (tdes0) bit symbol description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 532 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 26 dp disable pad when set, the mac does not automatically add padding to a frame shorter than 64 bytes. when this bit is reset, the dma automatically adds padding and crc to a frame shorter than 64 bytes, and the crc field is added despite the state of the dc (tdes0[27]) bit. this is valid only when the first segment (tdes0[28]) is set. 27 dc disable crc when this bit is set, the mac does not append a cyclic redundancy check (crc) to the end of the transmitted frame. this is valid only when the first segment (tdes0[28]) is set. 28 fs first segment when set, this bit indicates that the buffer contains the first segment of a frame. 29 ls last segment when set, this bit indicates that the buffer contains the last segment of the frame. when this bit is set, the tbs1: transmit buffer 1 size or tbs2: transmit buffer 2 size field in tdes1 should have a non-zero value. 30 ic interrupt on completion when set, this bit sets the transmit interrupt (register 5[0]) after the present frame has been transmitted. 31 own own bit when set, this bit indicates that the descriptor is owned by the dma. when this bit is reset, it indicates that the descriptor is owned by the host. the dma clears this bit either when it completes the frame transmission or when the buffers allocated in the descriptor are read completely. the ownership bit of the frame?s first descriptor must be set after all subsequent descriptors belonging to the same frame have been set. this avoids a possible race condition between fetching a descriptor and the driver setting an ownership bit. table 438. transmit descriptor word 1 (tdes1) bit symbol description 12:0 tbs1 transmit buffer 1 size these bits indicate the first data buffer byte size, in bytes. if this field is 0, the dma ignores this buffer and uses buffer 2 or the next descriptor, depending on the value of tch (tdes0[20]). 15:13 - reserved 28:16 tbs2 these bits indicate the second data buffer size in bytes. this field is not valid if tdes0[20] is set. see section 22.8.1.3 . 31:29 - reserved table 439. transmit descriptor word 2 (tdes2) bit symbol description 31:0 b1add buffer 1 address pointer these bits indicate the physical address of buffer 1. there is no limitation on the buffer address alignment. see section 22.8.1.2 for further detail on buffer address alignment. table 437. transmit descriptor word 0 (tdes0) bit symbol description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 533 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 22.9.2 receive descriptor the structure of the receiv ed descriptor is shown in figure 52 . this can have 32 bytes of descriptor data (8 dwords) when advanced timestamp or ipc full offload feature is selected. remark: when either of these feat ures is enabled, the sw should set the dma bus mode register[7] so that the dma oper ates with extended descriptor si ze. when this control bit is reset, rdes0[7] and rdes0[0] is always cl eared and the rdes4-rdes7 descriptor space are not valid. table 440. transmit descriptor word 3 (tdes3) bit symbol description 31:0 b2add buffer 2 address pointer (next descriptor address) indicates the physical address of buffer 2 when a descriptor ring structure is used. if the second address chained (tdes1[24]) bit is set, this address contains the pointer to the physical memory where the next descriptor is present. the buffer address pointer must be aligned to the bus width only when tdes1[24] is set. (lsbs are ignored internally.) table 441. transmit descriptor word 6 (tdes6) bit symbol description 31:0 ttsl transmit frame timestamp low this field is updated by dma with the least significant 32 bits of the timestamp captured for the corresponding transmit frame. this field has the timestamp only if the last segment bit (ls) in the descriptor is set and timestamp status (ttss) bit is set. table 442. transmit descriptor word 7 (tdes7) bit symbol description 31:0 ttsh transmit frame timestamp high this field is updated by dma with the most significant 32 bits of the timestamp captured for the corresponding receive frame. this field has the timestamp only if the last segment bit (ls) in the descriptor is set and timestamp status (ttss) bit is set. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 534 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet the contents of rdes0 are identified in table 443 . the contents of rdes1 through rdes3 are identified in ta b l e 4 4 4 to table 446 . fig 52. receive descriptor fields - alternate (enhanced format) o w n status [30:0] buffer 1 address [31:0] buffer 2 address [31:0] or next descriptor address [31:0] ctrl buffer 2 byte count [28:16] buffer 1 byte count [12:0] 31 0 rdes0 rdes3 rdes2 rdes1 extended status [31:0] rdes4 reserved rdes5 receive time stamp low [31:0] rdes6 receive time stamp high [31:0] rdes7 res res [30:29] ctrl [15:14] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 535 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet table 443. receive descriptor fields 0 (rdes0) bit symbol description 0 esa extended status available/rx mac address when either advanced timestamp or ip checksum offload (type 2) is present, this bit, when set, indicates that the extended status is available in descriptor word 4 (rdes4). this is valid only when the last descriptor bit (rdes0[8]) is set. when advance timestamp feature or ipc full offload is not selected, this bit indi cates rx mac address status. when set, this bit indicates that the rx mac address registers value (1 to 31) matched the frame?s da field. when reset, this bit indicates that the rx mac address register 0 value matched the da field. 1 ce crc error when set, this bit indicates that a cyclic redundancy check (crc) error occurred on the received frame. this field is valid only when the last descriptor (rdes0[8]) is set. 2 de dribble bit error when set, this bit indicates that the received frame has a non-integer multiple of bytes (odd nibbles). this bit is valid only in mii mode. 3 re receive error when set, this bit indicates that the gmii_rxer_i signal is asserted while gmii_rxdv_i is asserted during frame reception. this error also includes carrier extension error in mii and half-duplex mode. error can be of less/no extension, or error (rxd ? 0f) during extension. 4 rwt receive watchdog timeout when set, this bit indicates that the receive watchdog timer has expired while receiving the current frame and th e current frame is truncated after the watchdog timeout. 5ft frame type when set, this bit indicates that the receive frame is an ethernet-type frame (the lt field is greater than or equal to 0x0600). when this bit is reset, it indicates that the received frame is an ieee802.3 frame. this bit is not valid for runt frames less than 14 bytes. 6 lc late collision when set, this bit indicates that a late collision has occurred while receiving the frame in half-duplex mode. 7 tsa timestamp available/ip che cksum error (type1) /giant frame when advanced timestamp feature is present, when set, this bit indicates that a snapshot of the timestamp is written in descriptor words 6 (rdes6) and 7 (rdes7). this is valid only when the last descriptor bit (rdes0[8]) is set. when ip checksum engine (type 1) is selected, this bit, when set, indicates that the 16-bit ipv4 header checksum calculated by the core did not match the received checksum bytes. othe rwise, this bit, when set, indicate s the giant frame status. giant frames are larger-than-1,518-byte (or 1,522-byte for vlan) normal frames and larger-than-9,018-byte (9,022-byte for vlan) frame when jumbo frame processing is enabled. 8 ls last descriptor when set, this bit indicates that the buffers pointed to by this descriptor are the last buffers of the frame 9 fs first descriptor when set, this bit indicates that this descriptor contains the first buffer of the frame. if the size of the first buffer is 0, the second buffer contains the beginning of the frame. if the size of the second buffer is also 0, the next descriptor contains the beginning of the frame. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 536 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet 10 vlan vlan tag when set, this bit indicates that the frame pointed to by this descriptor is a vlan frame tagged by the mac core. 11 oe overflow error when set, this bit indicates that the received frame was damaged due to buffer overflow in mtl. 12 le length error when set, this bit indicates that the actual length of the frame received and that the length/ type field does not match. this bit is valid only when the frame type (rdes0[5]) bit is reset. 13 saf source address filter fail when set, this bit indicates that the sa field of frame failed the sa filter in the mac core. 14 de descriptor error when set, this bit indicates a frame truncation caused by a frame that does not fit within the current descriptor buffers, and that the dma does not own the next descriptor. the frame is truncated. this field is valid only when the last descriptor (rdes0[8]) is set. 15 es es: error summary indicates the logical or of the following bits: ? rdes0[1]: crc error ? rdes0[3]: receive error ? rdes0[4]: watchdog timeout ? rdes0[6]: late collision ? rdes0[7]: giant frame ? rdes4[4:3]: ip header/payload error ? rdes0[11]: overflow error ? rdes0[14]: descriptor error this field is valid only when the last descriptor (rdes0[8]) is set. 29:16 fl frame length these bits indicate the byte length of the received frame that was transferred to host memory (including crc). this field is valid when last descriptor (rdes0[8]) is set and either the descriptor error (rdes0[14]) or overflow error bits are reset. the frame length also includes the two bytes appended to the ethernet frame when ip checksum ca lculation (type 1) is enabled and the received frame is not a mac control frame. this field is valid when last descriptor (rdes0[8]) is set. when the last descriptor and error summary bits are not set, this field indicates the accumulated number of bytes that have been transferred for the current frame. 30 afm destination address filter fail when set, this bit indicates a frame that failed in the da filter in the mac core. 31 own own bit when set, this bit indicates that the descriptor is owned by the dma of the mac subsystem. when this bit is reset, th is bit indicates that the descriptor is owned by the host. the dma clears this bit either when it completes the frame reception or when the buffers that are associated with this descriptor are full. table 443. receive descriptor fields 0 (rdes0) bit symbol description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 537 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet table 444. receive descriptor fields 1 (rdes1) bit symbol description 12:0 rbs1 receive buffer 1 size indicates the first data buffer size in bytes. the buffer size must be a multiple of 4, 8, or 16, depending upon the bus widths (32, 64, or 128), even if the value of rdes2 (buffer1 address pointer) is not aligned. when the buffer size is not a multiple of 4, 8, or 16, the resulting behavior is undefined. if this field is 0, the dma ignores this buffer and uses buffer 2 or next descriptor depending on the value of rch (bit 14). see section 22.8.1.3 for further details on calculating buffer sizes. 13 - reserved 14 rch second address chained when set, this bit indicates that the second address in the descriptor is the next descriptor address rather than the second buffer address. when this bit is set, rbs2 (rdes1[28:16]) is a ?don?t care? value. rdes1[15] takes precedence over rdes1[14]. 15 rer receive end of ring when set, this bit indicates that the descriptor list reached its final descriptor. the dma returns to the base address of the list, creating a descriptor ring. 28:16 rbs2 receive buffer 2 size these bits indicate the second data buffer size, in bytes. the buffer size must be a multiple of 4, 8, or 16, depending on the bus widths (32, 64, or 128, respectively), even if the value of rdes3 (buffer2 address pointer) is not aligned to bus width. if the buffer size is not an appropriate multiple of 4, 8, or 16, the resulting behavior is undefined. this field is not valid if rdes1[14] is set. see section 22.8.1.3 for further details on calculating buffer sizes. table 445. receive descriptor fields 2 (rdes2) bit symbol description 31:0 b1add address pointer these bits indicate the physical address of buffer 1. there are no limitations on the buffer address alignment except for the following condition: the dma uses the configured value for its address generation when the rdes2 value is used to store the start of frame. note that the dma performs a write operation with the rdes2[3/2/1:0] bits as 0 during the transfer of the start of frame but the frame data is shifted as per the actual buffer address pointer. the dma ignores rdes2[3/2/1:0] (corresponding to bus width of 128/64/32) if the address pointer is to a buffer where the middle or last part of the frame is stored. see section 22.8.1.2 for further details on buffer address alignment. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 538 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet the extended status written is as shown in ta b l e 4 4 7 . the extended status is written only when there is status related to ipc or time stamp available. the availability of extended status is indicated by bit-0 of rdes0. this status is available only when advance timestamp or ipc full offload feature is selected. table 446. receive descriptor fields 3 (rdes3) bit symbol description 31:0 b2add buffer 2 address pointer (next descriptor address) these bits indicate the physical address of buffer 2 when a descriptor ring structure is used. if the second address chained (rdes1[24]) bit is set, this address contains the pointer to the physical memory where the next descriptor is present. if rdes1[24] is set, the buffer (next descriptor) address pointer must be bus width-aligned (rdes3[3, 2, or 1:0] = 0, corresponding to a bus width of 128, 64, or 32. lsbs are ignored internally.) however, when rdes1[24] is reset, there are no limitations on the rdes3 value, except for the following condition: the dma uses the configured value for its buffer address generation when the rdes3 value is used to store the start of frame. the dma ignores rdes3 [3, 2, or 1:0] (corresponding to a bus width of 128, 64, or 32) if the address pointer is to a buffer where the middle or last part of the frame is stored. table 447. receive descriptor fields 4 (rdes4) bit symbol description 2:0 ippl ip payload type these bits indicate the type of payload encapsulated in the ip datagram processed by the receive checksum of fload engine (coe). the coe also sets these bits to 00 if it does not process the ip datagram?s payload due to an ip header error or fragmented ip. ? 000: unknown or did not process ip payload ? 001: udp ? 010: tcp ? 011: icmp ? 1xx: reserved 3 iphe ip header error when set, this bit indicates either th at the 16-bit ipv4 header checksum calculated by the core does not match the received checksum bytes, or that the ip datagram version is not consis tent with the ethernet type value. 4 ipple ip payload error when set, this bit indicates that the 16-bit ip payload checksum (that is, the tcp, udp, or icmp checksum) that t he core calculated does not match the corresponding checksum field in the received segment. it is also set when the tcp, udp, or icmp segment length does not match the payload length value in the ip header field. 5 ipcsb ip checksum bypassed when set, this bit indicates that the checksum offload engine is bypassed. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 539 of 1164 nxp semiconductors UM10430 chapter 22: lpc18xx ethernet rdes6 and rdes7 contain the snapshot of the time-stamp. the availability of the snapshot of the time-stamp in rdes6 and rdes7 is indicated by bit-7 in the rdes0 descriptor. the contents of rdes6 and rdes7 are identified in table 448 and table 449 . 6 ipv4 ipv4 packet received when set, this bit indicates that the received packet is an ipv4 packet. 7 ipv6 ipv6 packet received when set, this bit indicates that the received packet is an ipv6 packet. 11:8 mt message type these bits are encoded to give the type of the message received. ? 0000: no ptp message received ? 0001: sync (all clock types) ? 0010: follow_up (all clock types) ? 0011: delay_req (all clock types) ? 0100: delay_resp (all clock types) ? 0101: pdelay_req (in peer-to-peer transparent clock) ? 0110: pdelay_resp (in peer-to-peer transparent clock) ? 0111: pdelay_resp_follow_up (in peer-to-peer transparent clock) ? 1000: announce ? 1001: management ? 1010: signaling ? 1011-1110: reserved ? 1111: ptp packet with reserved message type these bits are valid only when you select the advance timestamp feature. table 448. receive descriptor fields 6 (rdes6) bit symbol description 31:0 rtsl receive frame timestamp low this field is updated by dma with the least significant 32 bits of the timestamp captured for the corresponding receive frame. this field is updated by dma only for the last descriptor of the receive frame which is indicated by last descriptor status bit (rdes0[8]). table 449. receive descriptor fields 7 (rdes7) bit symbol description 31:0 rtsh receive frame timestamp high this field is updated by dma with the most significant 32 bits of the timestamp captured for the corresponding receive frame. this field is updated by dma only for the last descriptor of the receive frame which is indicated by last descriptor status bit (rdes0[8]). table 447. receive descriptor fields 4 (rdes4) bit symbol description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 540 of 1164 23.1 how to read this chapter the lcd controller is ava ilable on part lpc1850. 23.2 basic configuration the lcd controller is co nfigured as follows: ? see ta b l e 4 5 0 for clocking and power control. ? the lcd is reset by the lcd_rst (reset # 16). ? the lcd interrupt is connected to interrupt slot # 7 in the nvic. 23.3 features ? ahb bus master interface to access frame buffer. ? setup and control via a separate ahb slave interface. ? dual 16-deep programmable 64-bit wide fifos for buffering incoming display data. ? supports single and dual-panel monochrome super twisted nematic (stn) displays with 4 or 8-bit interfaces. ? supports single and dual-panel color stn displays. ? supports thin film transi stor (tft) color displays. ? programmable display resolution including , but not limited to: 320x200, 320x240, 640x200, 640x240, 640x480, 800x600, and 1024x768. ? hardware cursor support for single-panel displays. ? 15 gray-level monochrome, 3375 color stn, and 32k color palettized tft support. ? 1, 2, or 4 bits-per-pixel (bpp) palettized displays for monochrome stn. ? 1, 2, 4, or 8 bpp palettized color displays for color stn and tft. ? 16 bpp true-color non-palettized, for color stn and tft. ? 24 bpp true-color non-palettized, for color tft. ? programmable timing for different display panels. ? 256 entry, 16-bit palette ram, arranged as a 128x32-bit ram. ? frame, line, and pixel clock signals. ? ac bias signal for stn, data enable signal for tft panels. ? supports little and big-endian, and windows ce data formats. UM10430 chapter 23: lpc18xx lcd rev. 00.13 ? 20 july 2011 user manual table 450. lcd clocking and power control base clock branch clock maximum frequency notes lcd register interface clock base_m3_clk clk_m3_lcd 150 mhz - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 541 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd ? lcd panel clock may be generated from the peripheral clock, or from a clock input pin. 23.4 general description 23.4.1 programmable parameters the following key display and controller parameters can be programmed: ? horizontal front and back porch ? horizontal synchronization pulse width ? number of pixels per line ? vertical front and back porch ? vertical synchroniz ation pulse width ? number of lines per panel ? number of pixel clocks per line ? hardware cursor control. ? signal polarity, active high or low ? ac panel bias ? panel clock frequency ? bits-per-pixel ? display type: stn monoch rome, stn color, or tft ? stn 4 or 8-bit interface mode ? stn dual or single panel mode ? little-endian, big-endian, or windows ce mode ? interrupt gene ration event 23.4.2 hardware cursor support the hardware cursor feature reduces software overhead associated with maintaining a cursor image in the lcd frame buffer. without this feature, software needed to: ? save an image of the area under the next cursor position. ? update the area with the cursor image. ? repair the last cursor position with a previously saved image. in addition, the lcd driver had to check w hether the graphics operation had overwritten the cursor, and correct it. with a cursor size of 64x64 and 24-bit color, each cursor move involved reading and writing approximately 75 kb of data. the hardware cursor removes the requirement for this management by providing a completely separate image buffer for the cursor, and superimposing the cursor image on the lcd output stream at the current cursor (x,y) coordinate. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 542 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd to move the hardware cursor, the software driver supplies a new cursor coordinate. the frame buffer requires no modification. this significantly reduces software overhead. the cursor image is held in the lcd controller in an internal 256x32-bit buffer memory. 23.4.3 types of lcd panels supported the lcd controller supports th e following types of lcd panel: ? active matrix tft panels with up to 24-bit bus interface. ? single-panel monochrome stn panels (4-bit and 8-bit bus interface). ? dual-panel monochrome stn panels (4-bit and 8-bit bus interface per panel). ? single-panel color stn panels, 8-bit bus interface. ? dual-panel color stn panels, 8-bit bus interface per panel. 23.4.3.1 tft panels tft panels support one or more of the following color modes: ? 1 bpp, palettized, 2 colors selected from available colors. ? 2 bpp, palettized, 4 colors selected from available colors. ? 4 bpp, palettized, 16 colors selected from available colors. ? 8 bpp, palettized, 256 colors selected from available colors. ? 12 bpp, direct 4:4:4 rgb. ? 16 bpp, direct 5:5:5 rgb, wit h 1 bpp not normally used. this pixel is still output, and can be used as a brightness bit to connect to the least significant bit (lsb) of rgb components of a 6:6:6 tft panel. ? 16 bpp, direct 5:6:5 rgb. ? 24 bpp, direct 8:8:8 rgb, pr oviding over 16 million colors. each 16-bit palette entry is composed of 5 bpp (rgb), plus a commo n intensity bit. this provides better memory utilizat ion and performance compared with a full 6 bpp structure. the total number of colors supported can be doubled from 32k to 64k if the intensity bit is used and applied to all three color components simultaneously. alternatively, the 16 signals can be used to drive a 5:6:5 panel with the extra bit only applied to the green channel. 23.4.3.2 color stn panels color stn panels support one or more of the following color modes: ? 1 bpp, palettized, 2 colors selected from 3375. ? 2 bpp, palettized, 4 colors selected from 3375. ? 4 bpp, palettized, 16 colors selected from 3375. ? 8 bpp, palettized, 256 colors selected from 3375. ? 16 bpp, direct 4:4:4 rgb, with 4 bpp not being used. 23.4.3.3 monochrome stn panels monochrome stn panels support one or more of the following modes: www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 543 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd ? 1 bpp, palettized, 2 gray scales selected from 15. ? 2 bpp, palettized, 4 gray scales selected from 15. ? 4 bpp, palettized, 16 gray scales selected from 15. more than 4 bpp for monochrome panels can be programmed, but using these modes has no benefit because the maximum number of gr ay scales supported on the display is 15. 23.5 pin description the largest configuration for the lcd controlle r uses 31 pins. there are many variants using as few as 10 pins for a monochrome stn panel. pins are allocated in groups based on the selected configuration. all lcd function s are shared with other chip functions. in table 451 , only the lcd related portion of the pin name is shown. 23.5.1 signal usage the signals that are used for various display types are identified in the following sections. 23.5.1.1 signals used for single panel stn displays the signals used for single panel stn displays are shown in table 452 . ud refers to upper panel data. table 451. lcd controller pins pin name type function lcdpwr output lcd panel power enable. lcdclk output lcd panel clock. lcdenab/lcdm (lcdac) output stn ac bias drive or tft data enable output. lcdfp output frame pulse (stn). vertical synchronization pulse (tft) lcdle output line end signal lcdlp output line synchronization pulse (stn). horizontal synchronization pulse (tft) lcdvd[23:0] output lcd panel data. bits used depend on the panel configuration. gp_clkin input general purpose cgu input clock. can be used as the lcd external clock lcdclkin. table 452. pins used for single panel stn displays pin name 4-bit monochrome (10 pins) 8-bit monochrome (14 pins) color (14 pins) lcdpwr yyy lcddclk y y y lcdenab/ lcdm y y y lcdfp yyy lcdle yyy lcdlp yyy www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 544 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.5.1.2 signals used for dual panel stn displays the signals used for dual panel stn displays are shown in table 453 . ud refers to upper panel data, and ld refers to lower panel data. 23.5.1.3 signals used for tft displays the signals used for tft displays are shown in table 454 . lcdvd[3:0] ud[3:0] ud[3:0] ud[3:0] lcdvd[7:4] - ud[7:4] ud[7:4] lcdvd[23:8] - - - table 452. pins used for single panel stn displays pin name 4-bit monochrome (10 pins) 8-bit monochrome (14 pins) color (14 pins) table 453. pins used for dual panel stn displays pin name 4-bit monochrome (14 pins) 8-bit monochrome (22 pins) color (22 pins) lcdpwr yyy lcddclk y y y lcdenab/ lcdm y y y lcdfp yyy lcdle yyy lcdlp yyy lcdvd[3:0] ud[3:0] ud[3:0] ud[3:0] lcdvd[7:4] - ud[7:4] ud[7:4] lcdvd[11:8] ld[3:0] ld[3:0] ld[3:0] lcdvd[15:12] - ld[7:4] ld[7:4] lcdvd[23:16] - - - table 454. pins used for tft displays pin name 12-bit, 4:4:4 mode (18 pins) 16-bit, 5:6:5 mode (22 pins) 16-bit, 1:5:5:5 mode (24 pins) 24-bit (30 pins) lcdpwryyyy lcddclk y y y y lcdenab/ lcdm y y y y lcdfp y y y y lcdle y y y y lcdlp y y y y lcdvd[1:0] - - - red[1:0] lcdvd[2] - - intensity red[2] lcdvd[3] - red[0] red[0] red[3] lcdvd[7:4] red[3:0] red[ 4:1] red[4:1] red[7:4] lcdvd[9:8] - - - green[1:0] lcdvd[10] - green[0] intensity green[2] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 545 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6 register description table 455 shows the registers associated with the lcd controller and a summary of their functions. following the table are details for each register. lcdvd[11] - green[1] green[0] green[3] lcdvd[15:12] green[3:0] green [5:2] green[4:1] green[7:4] lcdvd[17:16] - - - blue[1:0] lcdvd[18] - - intensity blue[2] lcdvd[19] - blue[0] blue[0] blue[3] lcdvd[23:20] blue[3:0] blue[4:1] blue[4:1] blue[7:4] table 454. pins used for tft displays pin name 12-bit, 4:4:4 mode (18 pins) 16-bit, 5:6:5 mode (22 pins) 16-bit, 1:5:5:5 mode (24 pins) 24-bit (30 pins) table 455. register overview: lcd controller (base address: 0x4000 8000) name access address offset description reset value [1] timh r/w 0x000 horizontal timing control register 0x0 timv r/w 0x004 vertical timing control register 0x0 pol r/w 0x008 clock and signal polarity control register 0x0 le r/w 0x00c line end control register 0x0 upbase r/w 0x010 upper panel frame base address register 0x0 lpbase r/w 0x014 lower panel frame base address register 0x0 ctrl r/w 0x018 lcd control register 0x0 intmsk r/w 0x01c interrupt mask register 0x0 intraw ro 0x020 raw interrupt status register 0x0 intstat ro 0x024 masked interrupt status register 0x0 intclr wo 0x028 interrupt clear register 0x0 upcurr ro 0x02c upper panel current address value register 0x0 lpcurr ro 0x030 lower panel current address value register 0x0 - - 0x034 to 0x1fc reserved - pal r/w 0x200 to 0x3fc 256x16-bit color palette registers 0x0 - - 0x400 to 0x7fc reserved - crsr_img r/w 0x800 to 0xbfc cursor image registers 0x0 crsr_ctrl r/w 0xc00 cursor control register 0x0 crsr_cfg r/w 0xc04 cursor configuration register 0x0 crsr_pal0 r/w 0xc08 cursor palette register 0 0x0 crsr_pal1 r/w 0xc0c cursor palette register 1 0x0 crsr_xy r/w 0xc10 cursor xy position register 0x0 crsr_clip r/w 0xc14 cursor clip position register 0x0 crsr_intmsk r/w 0xc20 cursor interrupt mask register 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 546 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd [1] reset value reflects the data stored in used bi ts only. it does not include reserved bits content. 23.6.1 horizontal timing register the timh register controls the horizontal synchronization pulse width (hsw), the horizontal front porch (hfp) period, the ho rizontal back porch (hbp) period, and the pixels-per-line (ppl). crsr_intclr wo 0xc24 cursor interrupt clear register 0x0 crsr_intraw ro 0xc28 cursor raw interrupt status register 0x0 crsr_intstat ro 0xc2c cursor masked interrupt status register 0x0 table 455. register overview: lcd controller (base address: 0x4000 8000) ?continued name access address offset description reset value [1] table 456. horizontal timing register (timh, address 0x4000 8000) bit description bits symbol description reset value 1:0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 7:2 ppl pixels-per-line. the ppl bit field specifies the number of pixels in each line or row of the screen. ppl is a 6-bit value that represents between 16 and 1024 pixels per line. ppl counts the number of pixel clocks that occur before the hfp is applied. program the value required divided by 16, minus 1. actual pixels-per-line = 16 * (ppl + 1). for example, to obtain 320 pixels per line, program ppl as (320/16) -1 = 19. 0x0 15:8 hsw horizontal synchronization pulse width. the 8-bit hsw field specifies the pulse width of the line clock in passive mode, or the horizontal synchronization pulse in active mode. program with desired value minus 1. 0x0 23:16 hfp horizontal front porch. the 8-bit hfp field sets the number of pixel clock intervals at the end of each line or row of pixels, before the lcd line clock is pulsed. when a complete line of pixels is transmitted to the lcd driver, the value in hfp counts the number of pixel clocks to wait before asserting the line clock. hfp can generate a period of 1-256 pixel clock cycles. progra m with desired value minus 1. 0x0 31:24 hbp horizontal back porch. the 8-bit hbp field is used to specify the number of pixel clock periods inserted at the beginning of each line or row of pixels. after the line clock for the previous line has been deasserted, the value in hbp counts the number of pixel clocks to wait before starting the next display line. hbp can generate a delay of 1-256 pixel clock cycles. program with desired value minus 1. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 547 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.1.1 horizontal timing restrictions dma requests new data at the start of a horizontal display line. some time must be allowed for the dma transfer and for data to propagate down the fifo path in the lcd interface. the data path latency forces some restrictions on the usable minimum values for horizontal porch width in stn mode. the minimum values are hsw = 2 and hbp = 2. single panel mode: ? hsw = 3 pixel clock cycles ? hbp = 5 pixel clock cycles ? hfp = 5 pixel clock cycles ? panel clock divisor (pcd) = 1 (lcdclk / 3) dual panel mode: ? hsw = 3 pixel clock cycles ? hbp = 5 pixel clock cycles ? hfp = 5 pixel clock cycles ? pcd = 5 (lcdclk / 7) if enough time is given at the start of the line, for example, setting hsw = 6, hbp = 10, data does not corrupt for pcd = 4, the minimum value. 23.6.2 vertical timing register the timv register controls the vertical sync hronization pulse width (vsw), the vertical front porch (vfp) period, the vertical back porch (vbp) period, an d the lines-per-panel (lpp). www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 548 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.3 clock and signal polarity register the pol register controls various details of clock timing and signal polarity. table 457. vertical timing register (timv, address 0x4000 8004) bit description bits symbol description reset value 9:0 lpp lines per panel. this is the number of active lines per screen. the lpp field specifies the total number of lines or rows on the lcd panel being controlled. lpp is a 10-bit value allowing between 1 and 1024 lines. program the register with the number of lines per lcd panel, minus 1. for dual panel displays, program the register with the number of lines on each of the upper and lower panels. 0x0 15:10 vsw vertical synchronization pulse width. this is the number of horizontal synchronization lines. the 6-bit vsw field specifies the pulse width of the vertical synchronization pulse. program the register with the number of lines required, minus one. the number of horizontal synchronization lines must be small (for example, program to zero) for passive stn lcds. the higher the value the worse the contrast on stn lcds. 0x0 23:16 vfp vertical front porch. this is the number of inactive lines at the end of a frame, before the vertical synchronization period. the 8-bit vfp field specifies the number of line clocks to insert at the end of each frame. when a complete frame of pixels is transmitted to the lcd display, the value in vfp is used to count the number of line clock periods to wait. after the count has elapsed, the vertical synchronization signal, lcdfp, is asserted in active mo de, or extra line clocks are inserted as specified by the vsw bit-field in passive mode. vfp generates 0?255 line clock cycles. program to zero on passive displays for improved contrast. 0x0 31:24 vbp vertical back porch. this is the number of inactive lines at the start of a frame, after the vertical synchronizati on period. the 8-bit vbp field specifies the number of line clocks inserted at the beginning of each frame. the vbp count starts immediately after t he vertical synchronization signal for the previous frame has been negated for active mode, or the extra line clocks have been inserted as specified by the vsw bit field in passive mode. after this has occu rred, the count value in vbp sets the number of line clock periods in serted before the next frame. vbp generates 0?255 extra line clock cycles. program to zero on passive displays for improved contrast. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 549 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd table 458. clock and signal polarity register (pol, address 0x4000 8008) bit description bits symbol description reset value 4:0 pcd_lo lower five bits of panel clock divisor. the ten-bit pcd field, comprising pcd_hi (bits 31:27 of this register) and pcd_lo, is used to derive the lcd panel clock frequency lcddclk from the input clock, lcddclk = lcdclk/(pcd+2). for monochrome stn displays with a 4 or 8-bit interface, the panel clock is a factor of four and eight down from the actual individual pixel clock rate. for color stn displays, 22/3 pixels are output per lcddclk cycle, so the panel clock is 0.375 times the pixel rate. for tft displays, the pixel clock divider can be bypassed by setting the bcd bit in this register. note: data path latency forces some restrictions on the usable minimum values for the panel clock divider in stn modes: single panel color mode, pcd = 1 (lcddclk = lcdclk/3). dual panel color mode, pcd = 4 (lcddclk = lcdclk/6). single panel monochrome 4-bit interface mode, pcd = 2(lcddclk = lcdclk/4). dual panel monochrome 4-bit interface mode and single panel monochrome 8-bit interface mode, pcd = 6(lcddclk = lcdclk/8). dual panel monochrome 8-bit interface mode, pcd = 14(lcddclk = lcdclk/16). 0x0 5 clksel clock select. this bit controls the selection of the source for lcdclk. 0 = the clock source for the lcd block is cclk. 1 = the clock source for the lcd block is lcdclkin (external clock input for the lvd). 0x0 10:6 acb ac bias pin frequency. the ac bias pin frequency is only applicable to stn displays. these require the pixel voltage polarity to periodically reverse to prevent damage caused by dc charge accumulation. program this field with the required value minus one to apply the number of line clocks between each toggle of the ac bias pin, lcdenab. this field has no effect if the lcd is operating in tft mode, when the lcdenab pin is used as a data enable signal. 0x0 11 ivs invert vertical synchronization. the ivs bit inverts the polarity of the lcdfp signal. 0 = lcdfp pin is active high and inactive low. 1 = lcdfp pin is active low and inactive high. 0x0 12 ihs invert horizontal synchronization. the ihs bit inverts the polarity of the lcdlp signal. 0 = lcdlp pin is active high and inactive low. 1 = lcdlp pin is active low and inactive high. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 550 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.4 line end control register the le register controls the enabling of line- end signal lcdle. when enabled, a positive pulse, four lcdclk periods wid e, is output on lcdle afte r a programmable delay, led, from the last pixel of each display line. if the line-end signal is disabled it is held permanently low. 13 ipc invert panel clock. the ipc bit selects the edge of the panel clock on which pixel data is driven out onto the lcd data lines. 0 = data is driven on the lcd data lines on the rising edge of lcddclk. 1 = data is driven on the lcd data lines on the falling edge of lcddclk. 0x0 14 ioe invert output enable. this bit selects the active polarity of the output enable signal in tft mode. in this mode, the lcdenab pin is used as an enable that indicates to the lcd panel when valid display data is available. in active display mode, data is driven onto the lcd data lines at the programmed edge of lcddclk when lcdenab is in its active state. 0 = lcdenab output pin is active high in tft mode. 1 = lcdenab output pin is active low in tft mode. 0x0 15 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 25:16 cpl clocks per line. this field specifies the number of actual lcddclk clocks to the lcd panel on each line. this is the number of ppl divided by either 1 (for tft), 4 or 8 (for monochrome passive), 2 2/3 (for color passive), minus one. this mu st be correctly programmed in addition to the ppl bit in the timh register for the lcd display to work correctly. 0x0 26 bcd bypass pixel clock divider. setting this to 1 bypasses the pixel clock divider logic. this is mainly used for tft displays. 0x0 31:27 pcd_hi upper five bits of panel clock divisor. see description for pcd_lo, in bits [4:0] of this register. 0x0 table 458. clock and signal polarity register (pol, address 0x4000 8008) bit description bits symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 551 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.5 upper panel fram e base address register the upbase register is the color lcd upper panel dma base address register, and is used to program the base address of the frame buffer for the upper panel. lcdupbase (and lcdlpbase for dual panels) must be in itialized before enablin g the lcd controller. the base address must be doubleword aligned. optionally, the value may be changed mid-frame to create double-buffered video displays. these registers are copied to the correspond ing current registers at each lcd vertical synchronization. this event causes the lnbu bit and an optional interrupt to be generated. the interrupt can be used to reprogram the base address when generating double-buffered video. 23.6.6 lower panel frame base address register the lpbase register is the color lcd lower panel dma base addres s register, and is used to program the base address of the frame buffer for the lower panel. lcdlpbase must be initialized before enabling the lcd controller. the base address must be doubleword aligned. optionally, the value may be changed mid-frame to create double-buffered video displays. these registers are copied to the correspond ing current registers at each lcd vertical synchronization. this event causes the lnbu bit and an optional interrupt to be generated. the interrupt can be used to reprogram the base address when generating double-buffered video. table 459. line end control register (le, address 0x4000 800c) bit description bits symbol description reset value 6:0 led line-end delay. controls line-end signal delay from the rising-edge of the last panel clock, lcddclk. program with number of lcdclk clock periods minus 1. 0x0 15:7 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 16 lee lcd line end enable. 0 = lcdle disabled (held low). 1 = lcdle signal active. 0x0 31:17 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 460. upper panel frame base register (upbase, address 0x4000 8010) bit description bits symbol description reset value 2:0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 31:3 lcdupbase lcd upper panel base address. this is the start address of the upper panel frame data in memory and is doubleword aligned. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 552 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.7 lcd control register the ctrl register controls the lcd operating mode and the panel pixel parameters. table 461. lower panel frame base register (lpbase, address 0x4000 8014) bit description bits symbol description reset value 2:0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 31:3 lcdlpbase lcd lower panel base address. this is the start address of the lower panel frame data in memory and is doubleword aligned. 0x0 table 462. lcd control register (ctrl, address 0x4000 8018) bit description bits symbol description reset value 0 lcden lcd enable control bit. 0 = lcd disabled. signals lcdlp, lcddclk, lcdfp, lcdenab, and lcdle are low. 1 = lcd enabled. signals lcdlp, lcddclk, lcdfp, lcdenab, and lcdle are high. see lcd power-up and power-down sequence for details on lcd power sequencing. 0x0 3:1 lcdbpp lcd bits per pixel: selects the number of bits per lcd pixel: 000 = 1 bpp. 001 = 2 bpp. 010 = 4 bpp. 011 = 8 bpp. 100 = 16 bpp. 101 = 24 bpp (tft panel only). 110 = 16 bpp, 5:6:5 mode. 111 = 12 bpp, 4:4:4 mode. 0x0 4 lcdbw stn lcd monochrome/color selection. 0 = stn lcd is color. 1 = stn lcd is monochrome. this bit has no meaning in tft mode. 0x0 5 lcdtft lcd panel tft type selection. 0 = lcd is an stn display. use gray scaler. 1 = lcd is a tft display. do not use gray scaler. 0x0 6 lcdmono8 monochrome lcd interface width. this bit controls whether a monochrome stn lcd uses a 4 or 8-bit parallel interface. it has no meaning in other modes and must be programmed to zero. 0 = monochrome lcd uses a 4-bit interface. 1 = monochrome lcd uses a 8-bit interface. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 553 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 7 lcddual single or dual lcd panel selection. stn lcd interface is: 0 = single-panel. 1 = dual-panel. 0x0 8 bgr color format selection. 0 = rgb: normal output. 1 = bgr: red and blue swapped. 0x0 9 bebo big-endian byte order. controls byte ordering in memory: 0 = little-endian byte order. 1 = big-endian byte order. 0x0 10 bepo big-endian pixel ordering. controls pixel ordering within a byte: 0 = little-endian ordering within a byte. 1 = big-endian pixel ordering within a byte. the bepo bit selects between little and big-endian pixel packing for 1, 2, and 4 bpp display modes, it has no effect on 8 or 16 bpp pixel formats. see pixel serializer for more information on the data format. 0x0 11 lcdpwr lcd power enable. 0 = power not gated through to lcd panel and lcdv[23:0] signals disabled, (held low). 1 = power gated through to lcd panel and lcdv[23:0] signals enabled, (active). see lcd power-up and power-down sequence for details on lcd power sequencing. 0x0 13:12 lcdvcomp lcd vertical compare interrupt. generate vcomp interrupt at: 00 = start of vertical synchronization. 01 = start of back porch. 10 = start of active video. 11 = start of front porch. 0x0 15:14 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 16 watermark lcd dma fifo watermark level. controls when dma requests are generated: 0 = an lcd dma request is generated when either of the dma fifos have four or more empty locations. 1 = an lcd dma request is generated when either of the dma fifos have eight or more empty locations. 0x0 31:17 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 462. lcd control register (ctrl, address 0x4000 8018) bit description ?continued bits symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 554 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.8 interrupt mask register the intmsk register controls whether various lcd interrupts occur.setting bits in this register enables the corresponding raw interrup t intraw status bit values to be passed to the intstat register for processing as interrupts. 23.6.9 raw interrupt status register the intraw register contains status flags for various lcd controller events. these flags can generate an interrupts if enabled by mask bits in the intmsk register. table 463. interrupt mask register (intmsk, address 0x4000 801c) bit description bits function description reset value 0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 1 fufim fifo underflow interrupt enable. 0: the fifo underflow interrupt is disabled. 1: interrupt will be generated when the fifo underflows. 0x0 2 lnbuim lcd next base address update interrupt enable. 0: the base address update interrupt is disabled. 1: interrupt will be generated when the lcd base address registers have been updated from the next address registers. 0x0 3 vcompim vertical compare interrupt enable. 0: the vertical compare time interrupt is disabled. 1: interrupt will be generated when the vertical compare time (as defined by lcdvcomp field in the ctrl register) is reached. 0x0 4 berim ahb master error interrupt enable. 0: the ahb master error interrupt is disabled. 1: interrupt will be generated when an ahb master error occurs. 0x0 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 464. raw interrupt status register (int raw, address 0x4000 8020) bit description bits function description reset value 0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 1 fufris fifo underflow raw interrupt status. set when either the upper or lower dma fifos have been read accessed when empty causing an underflow condition to occur. generates an interrupt if the fufim bit in the intmsk register is set. 2 lnburis lcd next address base update raw interrupt status. mode dependent. set when the current base address registers have been successfully updated by the next address registers. signifies that a new next address can be loaded if double buffering is in use. generates an interrupt if the lnbuim bit in the intmsk register is set. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 555 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.10 masked interrupt status register the intstat register is read-only, and contai ns a bit-by-bit logical and of the intraw register and the intmask re gister. a logical or of all interr upts is provided to the system interrupt controller. 23.6.11 interrupt clear register the intclr register is write-only. writing a logic 1 to the relevant bit clears the corresponding interrupt. 3 vcompris vertical compare raw interrupt status. set when one of the four vertical regions is reached, as selected by the lcdvcomp bits in the ctrl register. generates an interrupt if the vcompim bit in the intmsk register is set. 0x0 4 berraw ahb master bus e rror raw interru pt status. set when the ahb master interface receives a bus error response from a slave. generates an interrupt if the berim bit in the intmsk register is set. 0x0 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 464. raw interrupt status register (int raw, address 0x4000 8020) bit description bits function description reset value table 465. masked interrupt status register (intstat, address 0x4000 8024) bit description bits function description reset value 0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 1 fufmis fifo underflow masked interrupt status. set when the both the fufris bit in the intraw register and the fufim bit in the intmsk register are set. 0x0 2 lnbumis lcd next address base update masked interrupt status. set when the both the lnburis bit in the intraw register and the lnbuim bit in the intmsk register are set. 0x0 3 vcompmis vertical compare masked interrupt status. set when the both the vcompris bit in the intraw register and the vcompim bit in the intmsk register are set. 0x0 4 bermis ahb master bus error masked interrupt status. set when the both the berraw bit in the intraw register and the berim bit in the intmsk register are set. 0x0 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 556 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.12 upper panel curre nt address register the upcurr register is read-only, and cont ains an approximate value of the upper panel data dma address when read. note: this register can change at any time an d therefore can only be used as a rough indication of display position. the contents of the upcurr register are described in table 467 . 23.6.13 lower panel cu rrent address register the lpcurr register is read-only, and cont ains an approximate value of the lower panel data dma address when read. note: this register can change at any time an d therefore can only be used as a rough indication of display position. table 466. interrupt clear register (intclr, address 0x4000 8028) bit description bits function description reset value 0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 1 fufic fifo underflow interrupt clear. writing a 1 to this bit clears the fifo underflow interrupt. 0x0 2 lnbuic lcd next address base update interrupt clear. writing a 1 to this bit clears the lcd next address base update interrupt. 0x0 3 vcompic vertical compare interrupt clear. writing a 1 to this bit clears the vertical compare interrupt. 0x0 4 beric ahb master e rror interrupt clear. writing a 1 to this bit clears the ahb master error interrupt. 0x0 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 467. upper panel current address register (upcurr, address 0x4000 802c) bit description bits function description reset value 31:0 lcdupcurr lcd upper panel current address. contains the current lcd upper panel data dma address. 0x0 table 468. lower panel current address regi ster (lpcurr, address 0x4000 8030) bit description bits function description reset value 31:0 lcdlpcurr lcd lower panel current address. contains the current lcd lower panel data dma address. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 557 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.14 color palette registers the pal register contain 256 palette entries organized as 128 locations of two entries per word. each word location contains two palette entri es. this means that 128 word locations are used for the palette. when configured for littl e-endian byte ordering, bits [15:0] are the lower numbered palette entry and [31:16] are the higher numbered palette entry. when configured for big-endian byte ordering this is reversed, because bits [31:16] are the low numbered palette entry and [15:0] are the high numbered entry. note: only tft displays use all of the palette entry bits. the contents of the pal register are described in table 469 . 23.6.15 cursor image registers the crsr_img register area contains 256-w ord wide values which are used to define the image or images overlaid on the displa y by the hardware cursor mechanism. the image must always be stored in lbbp mode (little-endian byte, big-endian pixel) mode, as described in section 23.7.5.6 . two bits are used to encode color and transparency for each pixel in the cursor. depending on the state of bit 0 in the cr sr_cfg register (see cursor configuration register description), the cursor image ram contains either four 32x32 cursor images, or a single 64x64 cursor image. table 469. color palette registers (pal, address 0x4000 8200 (pal0) to 0x4000 83fc (pal255)) bit description bits function description reset value 4:0 r04_0 red palette data. for stn displays, only the four msbs, bits [4:1], are used. for monochrome displays only the red palette data is used. all of the palette registers have the same bit fields. 0x0 9:5 g04_0 green palette data. 0x0 14:10 b04_0 blue palette data. 0x0 15 i0 intensity / unused bit. can be used as the lsb of the r, g, and b inputs to a 6:6:6 tft display, doubling the number of colors to 64k, where each color has two different intensities. 0x0 20:16 r14_0 red palette data. for stn displays, only the four msbs, bits [4:1], are used. for monochrome displays only the red palette data is used. all of the palette registers have the same bit fields. 0x0 25:21 g14_0 green palette data. 0x0 30:26 b14_0 blue palette data. 0x0 31 i1 intensity / unused bit. can be used as the lsb of the r, g, and b inputs to a 6:6:6 tft display, doubling the number of colors to 64k, where each color has two different intensities. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 558 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd the two colors defined for the cursor are mapped onto values from the crsr_pal0 and crsr_pal0 registers (see cursor palette register descriptions). the contents of the crsr_img register are described in ta b l e 4 7 0 . 23.6.16 cursor control register the crsr_ctrl register provides access to frequently used cursor functions, such as the display on/off control for the cursor, and the cursor number. if a 32x32 cursor is selected, one of four 32x32 cursors can be enabled. the images each occupy one quarter of the image memory, with cursor0 from location 0, followed by cursor1 from address 0x100, cursor2 from 0x200 and cursor3 from 0x300. if a 64x64 cursor is selected only one cu rsor fits in the image buffer , and no selection is possible. similar frame synchronization rules apply to the cursor number as apply to the cursor coordinates. if crsrfram esync is 1, the displa yed cursor image is only changed during the vertical frame blanking period. if crsrframesyn c is 0, the cursor image index is changed immediately, even if the cursor is currently being scanned. the contents of the crsr_ctrl register are described in table 471 . 23.6.17 cursor configuration register the crsr_cfg register provides overall c onfiguration information for the hardware cursor. table 470. cursor image registers (crsr_img, address 0x4000 8800 (crsr_img0) to 0x4000 8bfc (crsr_img1)) bit description bits function description reset value 31:0 crsr_img cursor image data. the 256 words of the cursor image registers define the appearance of either one 64x64 cursor or 4 32x32 cursors. 0x0 table 471. cursor control register (crsr_ctrl, address 0x4000 8c00) bit description bits function description reset value 0 crsron cursor enable. 0 = cursor is not displayed. 1 = cursor is displayed. 0x0 3:1 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0x0 5:4 crsrnum1_0 cursor image number. if the selected cursor size is 6x64, this field has no effect. if the selected cursor size is 32x32: 00 = cursor0. 01 = cursor1. 10 = cursor2. 11 = cursor3. 0x0 31:6 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 559 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd the contents of the crsr_cfg register are described in ta b l e 4 7 2 . 23.6.18 cursor palette register 0 the cursor palette registers provide color pale tte information for the visible colors of the cursor. color0 maps through crsr_pal0. the register provides 24-bit rgb values that are displayed according to the abilities of the lcd panel in the same way as the frame-buffers palette output is displayed. in monochrome stn mode, only the upper 4 bits of the red field are used. in stn color mode, the upper 4 bits of the red, blue, and green fields are used. in 24 bits per pixel mode, all 24 bits of the palette registers are significant. the contents of the crsr_pal0 register are described in table 473 . 23.6.19 cursor palette register 1 the cursor palette registers provide color pale tte information for the visible colors of the cursor. color1 maps through crsr_pal1. the register provides 24-bit rgb values that are displayed according to the abilities of the lcd panel in the same way as the frame-buffers palette output is displayed. in monochrome stn mode, only the upper 4 bits of the red field are used. in stn color mode, the upper 4 bits of the red, blue, and green fields are used. in 24 bits per pixel mode, all 24 bits of the palette registers are significant. the contents of the crsr_pal1 register are described in table 474 . table 472. cursor configuration register (crsr_cfg, address 0x4000 8c04) bit description bits function description reset value 0 crsrsize cursor size selection. 0 = 32x32 pixel cursor. allows for 4 defined cursors. 1 = 64x64 pixel cursor. 0x0 1 framesync cursor frame synchronization type. 0 = cursor coordinates are asynchronous. 1 = cursor coordinates are synchronized to the frame synchronization pulse. 0x0 31:2 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 473. cursor palette register 0 (crsr_pal0, address 0x4000 8c08) bit description bits function description reset value 7:0 red red color component 0x0 15:8 green green color component 0x0 23:16 blue blue color component. 0x0 31:24 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 560 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.20 cursor xy position register the crsr_xy register defines the distance of the top-left edge of the cursor from the top-left side of the cursor overlay. refer to the section on cursor clipping for more details. if the framesync bit in the crsr_cfg register is 0, the cursor position changes immediately, even if the cursor is currently being scanned. if framesync is 1, the cursor position is only changed during the next vertical frame blanking period. the contents of the crsr_xy register are described in table 475 . 23.6.21 cursor clip position register the crsr_clip register defines the distance fr om the top-left edge of the cursor image, to the first displayed pi xel in the cursor image. different synchronization rules apply to the cu rsor clip registers than apply to the cursor coordinates. if the framesync bit in the crsr_cfg register is 0, the cursor clip point is changed immediately, even if the cursor is currently being scanned. if the framesync bit in the crsr_cfg register is 1, the displayed cursor image is only changed during the vertical frame blanking pe riod, providing that the cursor position has been updated since the clip register was progr ammed. when programming, the clip register must be written before the position register (clcdcrsrxy) to ensure that in a given frame, the clip and position information is coherent. the contents of the crsr_clip register are described in table 476 . table 474. cursor palette register 1 (crsr_pal1, address 0x4000 8c0c) bit description bits function description reset value 7:0 red red color component 0x0 15:8 green green color component 0x0 23:16 blue blue color component. 0x0 31:24 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 475. cursor xy position register (crsr_xy, address 0x4000 8c10) bit description bits function description reset value 9:0 crsrx x ordinate of the cursor origin measured in pixels. when 0, the left edge of the cursor is at the left of the display. 0x0 15:10 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 25:16 crsry y ordinate of the cursor origin measured in pixels. when 0, the top edge of the cursor is at the top of the display. 0x0 31:26 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 561 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.22 cursor interrupt mask register the crsr_intmsk register is used to enable or disable the cursor from interrupting the processor. the contents of the crsr_intmsk register are described in table 477 . 23.6.23 cursor interrupt clear register the crsr_intclr register is used by software to clear the cursor interrupt status and the cursor interrupt signal to the processor. the contents of the crsr_intclr register are described in table 478 . table 476. cursor clip position register (crsr_ clip, address 0x4000 8c14) bit description bits function description reset value 5:0 crsrclipx cursor clip position for x direction. distance from the left edge of the cursor image to the first displayed pixel in the cursor. when 0, the first pixel of the cursor line is displayed. 0x0 7:6 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 13:8 crsrclipy cursor clip position for y direction. distance from the top of the cursor image to the first displayed pixel in the cursor. when 0, the first displayed pixel is from the top line of the cursor image. 0x0 31:14 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 477. cursor interrupt mask register (crsr_intmsk, address 0x4000 8c20) bit description bits function description reset value 0 crsrim cursor interrupt mask. when clear, the cursor never interrupts the processor. when set, the cursor interrupts the processor immediately after reading of the last word of cursor image. 0x0 31:1 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 562 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.6.24 cursor raw interr upt status register the crsr_intraw register is set to indicate a cursor interrupt. when enabled via the crsrim bit in the crsr_intmsk register, prov ides the interrupt to the system interrupt controller. the contents of the crsr_intraw register are described in table 479 . 23.6.25 cursor masked inte rrupt status register the crsr_intstat register is set to indica te a cursor interrupt providing that the interrupt is not masked in the crsr_intmsk register. the contents of the crsr_intstat register are described in table 480 . table 478. cursor interrupt clear register (crsr_intclr, address 0x4000 8c24) bit description bits function description reset value 0 crsric cursor interrupt clear. writing a 0 to this bit has no effect. writing a 1 to this bit causes the cursor interrupt status to be cleared. 0x0 31:1 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 479. cursor raw interrupt status register (crsr_intraw, address 0x4000 8c28) bit description bits function description reset value 0 crsrris cursor raw interrupt status. the cursor interrupt status is set immediately after the last data is read from the cursor image for the current frame. this bit is cleared by writing to the crsric bit in the crsr_intclr register. 0x0 31:1 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 480. cursor masked interrupt status register (crsr_intstat, address 0x4000 8c2c) bit description bits function description reset value 0 crsrmis cursor masked interrupt status. the cursor interrupt status is set immediately after the last data read from the cursor image for the current frame, providing that the corresponding bit in the crsr_intmsk register is set. the bit remains clear if the crsr_intmsk register is clear. this bit is cleared by writing to the crsr_intclr register. 0x0 31:1 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 563 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.7 lcd controller functional description the lcd controller performs translation of pixel-coded data into the required formats and timings to drive a variety of single or dual panel monochrome and color lcds. packets of pixel coded data are fed using the ahb interface, to two independent, programmable, 32-bit wide, dma fifos that act as input data flow buffers. the buffered pixel coded data is then unpacked using a pixel serializer. depending on the lcd type and mode, the unpacked data can represent: ? an actual true display gray or color value. ? an address to a 256x16 bit wide palette ram gray or color value. in the case of stn displays, either a value obtained from the addressed palette location, or the true value is passed to the gray sc aling generators. the hardware-coded gray scale algorithm logic sequences the activity of t he addressed pixels over a programmed number of frames to provide the effective display appearance. for tft displays, either an addressed palette va lue or true color value is passed directly to the output display drivers, bypass ing the gray scaling algorithmic logic. in addition to data formatting, the lcd controller provides a set of programmable display control signals, including: ? lcd panel power enable ? pixel clock ? horizontal and vertical synchronization pulses ? display bias the lcd controller generates individual interrupts for: ? upper or lower panel dma fifo underflow ? base address update signification ? vertical compare ? bus error there is also a single combined interrupt that is asserted when any of the individual interrupts become active. figure 53 shows a simplified block diagram of the lcd controller. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 564 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.7.1 ahb interfaces the lcd controller includes two separate ahb interfaces. the first, an ahb slave interface, is used primarily by the cpu to access control and data registers within the lcd controller. the second, an ahb master interface, is used by the lcd controller for dma access to display data stored in memory elsewhere in the system. the lcd dma controller can access any sram on ahb and the external memory. 23.7.1.1 amba ahb slave interface the ahb slave interface connects the lcd co ntroller to the ahb bus and provides cpu accesses to the registers and palette ram. 23.7.1.2 amba ahb master interface the ahb master interface transfers display da ta from a selected slave (memory) to the lcd controller dma fifos. it can be configured to obtain data from any on-chip sram on ahb, various types of off-chip st atic memory, or off-chip sdram. fig 53. lcd controller block diagram ahb slave interface ahb master interface ahb bus panel clock generator timing controller lcd panel clock lcd control signals upper panel dma fifo pixel serializer lower panel formatter ram palette (128x32) input fifo control lower panel dma fifo upper panel output fifo lower panel output fifo upper panel formatter upper stn lower stn hardware cursor gray scaler stn/tft data select lcd panel data interrupt generation interrupt fifo underflow ahb error lcdclkin www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 565 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd in dual panel mode, the dma fi fos are filled up in an alte rnating fashion via a single dma request. in single panel mode, the dma fifos are filled up in a sequential fashion from a single dma request. the inherent ahb master interface state machine performs the following functions: ? loads the upper panel base address into the ahb address incrementer on recognition of a new frame. ? monitors both the upper and lower dma fifo levels and asserts a dma request to request display data from memory, filling th em to above the pr ogrammed watermark. the dma request is reasserted when there are at least four locations available in either fifo (dual panel mode). ? checks for 1 kb boundaries during fixed-length bursts, appropriately adjusting the address in such occurrences. ? generates the address sequences for fixed-length and undefined bursts. ? controls the handshaking between the me mory and dma fifos. it inserts busy cycles if the fifos have not completed their synchronization and updating sequence. ? fills up the dma fifos, in dual panel mode, in an alternating fa shion from a single dma request. ? asserts the a bus error interrupt if an error occurs during an active burst. ? responds to retry commands by restarting the failed access. this introduces some busy cycles while it re-synchronizes. 23.7.2 dual dma fifos and associated control logic the pixel data accessed from memory is buffered by two dma fifos that can be independently controlled to cover single and dual-panel lcd types. each fifo is 16 words deep by 64 bits wide and can be cascaded to form an effective 32-dword deep fifo in single panel mode. synchronization logic transfers the pixel data from the ahb clock domain to the lcd controller clock domain. the wate r level marks in each fifo ar e set such that each fifo requests data when at least four locations become available. an interrupt signal is asserted if an attempt is made to read either of the two dma fifos when they are empty (an underflow condition has occurred). 23.7.3 pixel serializer this block reads the 32-bit wide lcd data from the output port of the dma fifo and extracts 24, 16, 8, 4, 2, or 1 bpp data, depending on the current mode of operation. the lcd controller supports big-endian, little-endian, and windows ce data formats. depending on the mode of operation, the extracted data can be used to point to a color or gray scale value in the palette ram or can actually be a true color value that can be directly applied to an lcd panel input. table 481 through table 483 show the structure of the data in each dma fifo word corresponding to the endianness and bpp combinations. for each of the three supported data formats, the required data for each panel display pixel must be extracted from the data word. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 566 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd table 481. fifo bits for little-endian byte, little-endian pixel order fifo bit 1 bpp 2 bpp 4 bpp 8 bpp 16 bpp 24 bpp 31 p31 p15 p7 p3 p1 30 p30 29 p29 p14 28 p28 27 p27 p13 p6 26 p26 25 p25 p12 24 p24 23 p23 p11 p5 p2 p0 22 p22 21 p21 p10 20 p20 19 p19 p9 p4 18 p18 17 p17 p8 16 p16 15 p15 p7 p3 p1 p0 14 p14 13 p13 p6 12 p12 11 p11 p5 p2 10 p10 9p9 p4 8p8 7p7 p3 p1 p0 6p6 5p5 p2 4p4 3p3 p1 p0 2p2 1p1 p0 0p0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 567 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd table 482. fifo bits for big-endian byte, big-endian pixel order fifo bit 1 bpp 2 bpp 4 bpp 8 bpp 16 bpp 24 bpp 31 p0 p0 p0 p0 p0 30 p1 29 p2 p1 28 p3 27 p4 p2 p1 26 p5 25 p6 p3 24 p7 23 p8 p4 p2 p1 p0 22 p9 21 p10 p5 20 p11 19 p12 p6 p3 18 p13 17 p14 p7 16 p15 15 p16 p8 p4 p2 p1 14 p17 13 p18 p9 12 p19 11 p20 p10 p5 10 p21 9p22 p11 8p23 7p24 p12 p6 p3 6p25 5p26 p13 4p27 3p28 p14 p7 2p29 1p30 p15 0p31 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 568 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd table 484 shows the structure of the data in each dma fifo word in rgb mode. table 483. fifo bits for little-endi an byte, big-endian pixel order fifo bit 1 bpp 2 bpp 4 bpp 8 bpp 16 bpp 24 bpp 31 p24 p12 p6 p3 p1 30 p25 29 p26 p13 28 p27 27 p28 p14 p7 26 p29 25 p30 p15 24 p31 23 p16 p8 p4 p2 p0 22 p17 21 p18 p9 20 p19 19 p20 p10 p5 18 p21 17 p22 p11 16 p23 15 p8 p4 p2 p1 p0 14 p9 13 p10 p5 12 p11 11 p12 p6 p3 10 p13 9p14 p7 8p15 7p0 p0 p0 p0 6p1 5p2 p1 4p3 3p4 p2 p1 2p5 1p6 p3 0p7 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 569 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.7.4 ram palette the ram-based palette is a 256 x 16 bit dual-port ram physically structured as 128 x 32 bits. two entries can be written into the palette from a single word write access. the least significant bit (lsb) of the serialized pixel da ta selects between upper and lower halves of the palette ram. the half that is selected depends on the byte ordering mode. in little-endian mode, setting the lsb selects the upper half, but in big-endian mode, the lower half of the palette is selected. table 484. rgb mode data formats fifo data 24-bit rgb 16-bit (1:5:5:5 rgb) 16-bit (5:6:5 rgb) 16-bit (4:4:4 rgb) 31 - p1 intensity bit p1, blue 4 - 30 - p1, blue 4 p1, blue 3 - 29 - p1, blue 3 p1, blue 2 - 28 - p1, blue 2 p1, blue 1 - 27 - p1, blue 1 p1, blue 0 p1, blue 3 26 - p1, blue 0 p1, green 5 p1, blue 2 25 - p1, green 4 p1, green 4 p1, blue 1 24 - p1, green 3 p1, green 3 p1, blue 0 23 p0, blue 7 p1, green 2 p1, green 2 p1, green 3 22 p0, blue 6 p1, green 1 p1, green 1 p1, green 2 21 p0, blue 5 p1, green 0 p1, green 0 p1, green 1 20 p0, blue 4 p1, red 4 p1, red 4 p1, green 0 19 p0, blue 3 p1, red 3 p1, red 3 p1, red 3 18 p0, blue 2 p1, red 2 p1, red 2 p1, red 2 17 p0, blue 1 p1, red 1 p1, red 1 p1, red 1 16 p0, blue 0 p1, red 0 p1, red 0 p1, red 0 15 p0, green 7 p0 intensity bit p0, blue 4 - 14 p0, green 6 p0, blue 4 p0, blue 3 - 13 p0, green 5 p0, blue 3 p0, blue 2 - 12 p0, green 4 p0, blue 2 p0, blue 1 - 11 p0, green 3 p0, blue 1 p0, blue 0 p0, blue 3 10 p0, green 2 p0, blue 0 p0, green 5 p0, blue 2 9 p0, green 1 p0, green 4 p0, green 4 p0, blue 1 8 p0, green 0 p0, green 3 p0, green 3 p0, blue 0 7 p0, red 7 p0, green 2 p0, green 2 p0, green 3 6 p0, red 6 p0, green 1 p0, green 1 p0, green 2 5 p0, red 5 p0, green 0 p0, green 0 p0, green 1 4 p0, red 4 p0, red 4 p0, red 4 p0, green 0 3 p0, red 3 p0, red 3 p0, red 3 p0, red 3 2 p0, red 2 p0, red 2 p0, red 2 p0, red 2 1 p0, red 1 p0, red 1 p0, red 1 p0, red 1 0 p0, red 0 p0, red 0 p0, red 0 p0, red 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 570 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd pixel data values can be written and veri fied through the ahb slave interface. for information on the supported colors, refer to the section on the related panel type earlier in this chapter. the palette ram is a dual port ram with independent controls and addresses for each port. port1 is used as a read/write port and is connected to the ahb slave interface. the palette entries can be written and verified thro ugh this port. port2 is used as a read-only port and is connected to the unpacker and gray scaler. for color modes of less than 16 bpp, the palette enables each pixel value to be mapped to a 16-bit color: ? for tft displays, the 16-bit value is passed directly to the pixel serializer. ? for stn displays, the 16-bit value is first converted by the gray scaler. table 485 shows the bit representation of the palette data. the palette 16-bit output uses the tft 1:5:5:5 data format. in 16 and 24 b pp tft mode, the palette is bypassed and the output of the pixel serializer is used as the tft panel data. the red and blue pixel data can be swapped to support bgr data format using a control register bit (bit 8 = bgr). see the ctrl register description for more information. table 486 shows the bit representation of the palette data for the stn color modes. table 485. palette data storage for tft modes. bit(s) name (rgb format) description (rgb format) name (bgr format) description (bgr format) 31 i intensity / unused i intensity / unused 30:26 b[4:0] blue palette data r[4:0] red palette data 25:21 g[4:0] green palette data g[4:0] green palette data 20:16 r[4:0] red palette data b[4:0] blue palette data 15 i intensity / unused i intensity / unused 14:10 b[4:0] blue palette data r[4:0] red palette data 9:5 g[4:0] green palette data g[4:0] green palette data 4:0 r[4:0] red palette data b[4:0] blue palette data table 486. palette data storage for stn color modes. bit(s) name (rgb format) description (rgb format) name (bgr format) description (bgr format) 31 - unused - unused 30:27 b[3:0] blue palette data r[3:0] red palette data 26 - unused - unused 25:22 g[3:0] green palette data g[3:0] green palette data 21 - unused - unused 20:17 r[3:0] red palette data b[3:0] blue palette data 16 - unused - unused 15 i unused i unused 14:11 b[4:1] blue palette data r[4:1] red palette data 10 b[0] unused r[0] unused 9:6 g[4:1] green palette data g[4:1] green palette data www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 571 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd for monochrome stn mode, only the red palette field bits [4:1] are used. however, in stn color mode the green and blue [4:1] are also used. only 4 bits per color are used, because the gray scaler only supports 16 different shades per color. table 487 shows the bit representation of the palette data for the stn monochrome mode. 23.7.5 hardware cursor the hardware cursor is an integral part of the lcd controller. it uses the lcd timing module to provide an indication of the current scan position coordinate, and intercepts the pixel stream between the palette logic and the gray scale/output multiplexer. all cursor programming registers are accessed through the lcd slave interface. this also provides a read/write port to the cursor image ram. 23.7.5.1 cursor operation the hardware cursor is contained in a dual port ram. it is programmed by software through the ahb slave interface. the ahb slav e interface also provides access to the hardware cursor control registers. these registers enable you to modify the cursor position and perform various other functions. when enabled, the hardware cursor uses the horizontal and vertic al synchronization signals, along with a pixel clock enable and various display parameters to calculate the current scan coordinate. 5 g[0] unused g[0] unused 4:1 r[4:1] red palette data b[4:1] blue palette data 0 r[0] unused b[0] unused table 487. palette data storage for stn monochrome mode. bit(s) name description 31 - unused 30:27 - unused 26 - unused 25:22 - unused 21 - unused 20:17 y[3:0] intensity data 16 - unused 15 - unused 14:11 - unused 10 - unused 9:6 - unused 5 - unused 4:1 y[3:0] intensity data 0 - unused table 486. palette data storage for stn color modes. bit(s) name (rgb format) description (rgb format) name (bgr format) description (bgr format) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 572 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd when the display point is inside the bounds of the cursor image, the cursor replaces frame buffer pixels with cursor pixels. when the last cursor pixel is displayed, an interrupt is generated that software can use as an indication that it is safe to modify the cursor image. this enables software controlled animations to be performed without flickering for frame synchronized cursors. 23.7.5.2 cursor sizes two cursor sizes are supported, as shown in table 488 . 23.7.5.3 cursor movement the following descriptions assume that both the screen and cursor origins are at the top left of the visible screen (the firs t visible pixel scanned each frame). figure 54 shows how each pixel coordinate is assumed to be the top left corner of the pixel. 23.7.5.4 cursor xy positioning the crsr_xy register controls the cursor position on the cursor overlay (see cursor xy position register). this provides se parate fields for x and y ordinates. the crsr_cfg register (see cursor config uration register) provides a framesync bit controlling the visible behavior of the cursor. table 488. palette data storage for stn monochrome mode. x pixels y pixels bits per pixel words per line words in cursor image 32 32 2 2 64 64 64 2 4 256 fig 54. cursor movement crsr_xy(x) crsr_xy(y) (0,0) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 573 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd with framesync inactive, the cursor responds immediately to any change in the programmed crsr_xy value. some transient smearing effects may be visible if the cursor is moved across the lcd scan line. with framesync active, the cursor only updates its position after a vertical synchronization has occurred. this provides clean cursor movement, but the cursor position only updates once a frame. 23.7.5.5 cursor clipping the crsr_xy register (see cu rsor xy position register ) is programmed with positive binary values that enable the cursor image to be located anywhere on the visible screen image. the cursor image is clipped automatically at the screen limits when it extends beyond the screen image to the right or bottom (see x1,y1 in figure 55 ). the checked pattern shows the visible portion of the cursor. because the crsr_xy register values are posi tive integers, to emulate cursor clipping on the left and top of screen, a clip positi on register, crsr_clip, is provided. this controls which point of the cursor image is positioned at the crsr _clip coordinate. for clipping functions on the y axis, crsr_xy( x) is zero, and clip(x ) is programmed to provide the offset into the cursor image (x2 an d x3). the equivalent function is provided to clip on the x axis at the top of the display (y2). for cursors that are not clipp ed at the x=0 or y=0 lines, prog ram the clip position register x and y fields with zero to display the cursor correctly. see clip(x4,y4) for the effect of incorrect programming. fig 55. cursor clipping clip(x2) clip(y2) clip(x3) cursor(y1) cursor(x1) cursor(x5) clip(x4) cursor(y5) clip(y4) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 574 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.7.5.6 cursor image format the lcd frame buffer supports three packing formats, but the hardware cursor image requirement has been simplified to support only lbbp. this is little-endian byte, big-endian pixel for windows ce mode. the image ram start address is offset by 0x800 from the lcd base address, as shown in the register description in this chapter. the displayed cursor coordinate system is expressed in terms of (x,y). 64 x 64 is an extension of the 32 x 32 format shown in figure 56 . 32 by 32 pixel format four cursors are held in memory, each with the same pixel format. table 489 lists the base addresses for the four cursors. fig 56. cursor image format table 489. addresses for 32 x 32 cursors address description 0x4000 8800 cursor 0 start address. 0x4000 8900 cursor 1 start address. 0x4000 8a00 cursor 2 start address. 0x4000 8b00 cursor 3 start address. (31, 0) (0, 0) (1, 0) (2, 0) (30, 0) (29, 0) (31, 1) (0, 1) (1, 1) (2, 1) (30, 1) (29, 1) (31, 2) (0, 2) (1, 2) (2, 2) (30, 2) (29, 2) right left (31, 29) (0, 29) (1, 29) (2, 29) (30, 29) (29, 29) (31, 30) (0, 30) (1, 30) (2, 30) (30, 30) (29, 30) (31, 31) (0, 31) (1, 31) (2, 31) (30, 31) (29, 31) top bottom www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 575 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd table 490 shows the buffer to pi xel mapping for cursor 0. 64 by 64 pixel format only one cursor fits in the me mory space in 64 x 64 mode. table 491 shows the 64 x 64 cursor format. table 490. buffer to pixel mapping for 32 x 32 pixel cursor format offset into cursor memory data bits 0 4 (8 * y) (8 * y) +4 f8 fc 31:30 (12, 0) (28, 0) (12, y) (28, y) (12, 31) (28,31) 29:28 (13, 0) (29, 0) (13, y) (29, y) (13, 31) (29, 31) 27:26 (14, 0) (30, 0) (14, y) (30, y) (14, 31) (30, 31) 25:24 (15, 0) (31, 0) (15, y) (31, y) (15, 31) (31, 31) 23:22 (8, 0) (24, 0) (8, y) (24, y) (8, 31) (24, 31) 21:20 (9, 0) (25, 0) (9, y) (25, y) (9, 31) (25, 31) 19:18 (10, 0) (26, 0) (10, y) (26, y) (10, 31) (26, 31) 17:16 (11, 0) (27, 0) (11, y) (27, y) (11, 31) (27, 31) 15:14 (4, 0) (20, 0) (4, y) (20, y) (4, 31) (20, 31) 13:12 (5, 0) (21, 0) (5, y) (21, y) (5, 31) (21, 31) 11:10 (6, 0) (22, 0) (6, y) (22, y) (6, 31) (22, 31) 9:8 (7, 0) (23, 0) (7, y) (23, y) (7, 31) (23, 31) 7:6 (0, 0) (16, 0) (0, y) (16, y) (0, 31) (16, 31) 5:4 (1, 0) (17, 0) (1, y) (17, y) (1, 31) (17, 31) 3:2 (2, 0) (18, 0) (2, y) (18, y) (2, 31) (18, 31) 1:0 (3, 0) (19, 0) (3, y) (19, y) (3, 31) (19, 31) table 491. buffer to pixel mapping for 64 x 64 pixel cursor format offset into cursor memory data bits 0 4 8 12 (16 * y) (16 * y) +4 (16 * y) + 8 (16 * y) + 12 fc 31:30 (12, 0) (28, 0) (44, 0) (60, 0) (12, y) (28, y) (44, y) (60, y) (60, 63) 29:28 (13, 0) (29, 0) (45, 0) (61, 0) (13, y) (29, y) (45, y) (61, y) (61, 63) 27:26 (14, 0) (30, 0) (46, 0) (62, 0) (14, y) (30, y) (46, y) (62, y) (62, 63) 25:24 (15, 0) (31, 0) (47, 0) (63, 0) (15, y) (31, y) (47, y) (63, y) (63, 63) 23:22 (8, 0) (24, 0) (40, 0) (56, 0) (8, y) (24, y) (40, y) (56, y) (56, 63) 21:20 (9, 0) (25, 0) (41, 0) (57, 0) (9, y) (25, y) (41, y) (57, y) (57, 63) 19:18 (10, 0) (26, 0) (42, 0) (58, 0) (10, y) (26, y) (42, y) (58, y) (58, 63) 17:16 (11, 0) (27, 0) (43, 0) (59, 0) (11, y) (27, y) (43, y) (59, y) (59, 63) 15:14 (4, 0) (20, 0) (36, 0) (52, 0) (4, y) (20, y) (36, y) (52, y) (52, 63) 13:12 (5, 0) (21, 0) (37, 0) (53, 0) (5, y) (21, y) (37, y) (53, y) (53, 63) 11:10 (6, 0) (22, 0) (38, 0) (54, 0) (6, y) (22, y) (38, y) (54, y) (54, 63) 9:8 (7, 0) (23, 0) (39, 0) (55, 0) (7, y) (23, y) (39, y) (55, y) (55, 63) 7:6 (0, 0) (16, 0) (32, 0) (48, 0) (0, y) (16, y) (32, y) (48, y) (48, 63) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 576 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd cursor pixel encoding each pixel of the cursor requires two bits of information. these are interpreted as color0, color1, transparent, and transparent inverted. in the coding scheme, bit 1 selects between color and transparent (and mask) and bit 0 selects variant (xor mask). table 492 shows the pixel encoding bit assignments. 23.7.6 gray scaler a patented gray scale algorithm drives mono chrome and color stn panels. this provides 15 gray scales for monochrome displays. for stn color displa ys, the three color components (rgb) are gray scaled simultaneously. this results in 3375 (15x15x15) colors being available. the gray scaler transf orms each 4-bit gray value into a sequence of activity-per-pixel over several frames, relying to some degree on the display characteristics, to give the repres entation of gray scales and color. 23.7.7 upper and lower panel formatters formatters are used in stn mode to convert the gray scaler output to a parallel format as required by the display. for monochrome displays, this is either 4 or 8 bits wide, and for color displays, it is 8 bits wide. table 493 shows a color display driven with 2 2/3 pixels worth of data in a repeating sequence. 5:4 (1, 0) (17, 0) (33, 0) (49, 0) (1, y) (17, y) (33, y) (49, y) (49, 63) 3:2 (2, 0) (18, 0) (34, 0) (50, 0) (2, y) (18, y) (34, y) (50, y) (50, 63) 1:0 (3, 0) (19, 0) (35, 0) (51, 0) (3, y) (19, y) (35, y) (51, y) (51, 63) table 491. buffer to pixel mapping for 64 x 64 pixel cursor format offset into cursor memory data bits 0 4 8 12 (16 * y) (16 * y) +4 (16 * y) + 8 (16 * y) + 12 fc table 492. pixel encoding value description 00 color0. the cursor color is displayed according to the red-green-blue (rgb) value programmed into the crsr_pal0 register. 01 color1. the cursor color is displayed according to the rgb value programmed into the crsr_pal1 register. 10 transparent. the cursor pixel is transparent, so is displayed unchanged. this enables the visible cursor to assume shapes that are not square. 11 transparent inverted. the cursor pixel assumes the complementary color of the frame pixel that is displayed. this can be used to ensure that the cursor is visible regardless of the color of the frame buffer image. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 577 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd each formatter consists of thre e 3-bit (rgb) shift left registers. rgb pixel data bit values from the gray scaler are concurrently shifte d into the respective registers. when enough data is available, a byte is constructed by mu ltiplexing the registered data to the correct bit position to satisfy the rgb data pattern of lcd panel. the byte is transferred to the 3-byte fifo, which has enough space to store eight color pixels. 23.7.8 panel clock generator the output of the panel clock generator block is the panel clock, pin lcddclk. the panel clock can be based on either the peripheral clock for the lcd block or the external clock input for the lcd, pin lcdclkin. whichever so urce is selected can be divided down in order to produce the internal lcd clock, lcdclk. the panel clock generator can be programmed to output the lcd panel clock in the range of lcdclk/2 to lcdclk/1025 to match the bpp data rate of the lcd panel being used. the clksel bit in the pol regi ster determines wh ether the base cloc k used is cclk or the lcdclkin pin. 23.7.9 timing controller the primary function of the timing controller block is to generate the horizontal and vertical timing panel signals. it also provides the p anel bias and enable signals. these timings are all register-programmable. 23.7.10 stn and tft data select support is provided for passive super twisted nematic (stn) and active thin film transistor (tft) lcd display types: 23.7.10.1 stn displays stn display panels require algorithmic pixel pattern generation to provide pseudo gray scaling on monochrome displays, or color creation on color displays. 23.7.10.2 tft displays tft display panels require the digital color value of each pixel to be applied to the display data inputs. 23.7.11 interrupt generation four interrupts are generated by the lcd controller, and a single combined interrupt. the four interr upts are: ? master bus error interrupt. ? vertical compare interrupt. table 493. color display driv en with 2 2/3 pixel data byte cld[7] cld[6] cld[5] cld[4] cld[3] cld[2] cld[1] cld[0] 0 p2[green] p2[red] p1[blue] p1[green] p1[red] p0[blue] p0[green] p0[red] 1 p5[red] p4q[blue] p4[green] p4[red] p3[blue] p3[green] p3[red] p2[blue] 2 p7[blue] p7[green] p7[red] p6[blue] p6[green] p6[red] p5[blue] p5[green] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 578 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd ? next base address update interrupt. ? fifo underflow interrupt. each of the four individual maskable interrupts is enabled or disabled by changing the mask bits in the int_msk register. these interrupts are also combined into a single overall interrupt, which is asserted if any of the individ ual interrupts are both asserted and unmasked. provision of individual outputs in addition to a combined interrupt output enables use of either a global interrupt service routine, or modular device drivers to handle interrupts. the status of the individual interrupt sources can be read from the intraw register. 23.7.11.1 master bus error interrupt the master bus error interrupt is asserted when an error response is received by the master interface during a transaction with a sl ave. when such an error is encountered, the master interface enters an error state and remain s in this state until clearance of the error has been signaled to it. when the respective interrupt service routine is complete, the master bus error interrupt may be cleared by writing a 1 to the beric bit in the intclr register. this action releases the master in terface from its error state to the start of frame state, and enables fresh frame of data display to be initiated. 23.7.11.2 vertical compare interrupt the vertical compare interrupt asserts when one of four vertical display regions, selected using the ctrl register, is reached. the interrupt can be made to occur at the start of: ? vertical synchronization. ? back porch. ? active video. ? front porch. the interrupt may be cleared by writing a 1 to the vcompic bit in the intclr register. 23.7.11.2.1 next base address update interrupt the lcd next base address update interrupt asserts w hen either the lcdupbase or lcdlpbase values have been transferred to the lcdupcurr or lcdlpcurr incrementers respective ly. this signals to the system that it is safe to update the lcdupbase or the lcdlpbase registers with new frame base addresses if required. the interrupt can be cleared by writing a 1 to the lnbuic bit in the intclr register 23.7.11.2.2 fifo u nderflow interrupt the fifo underflow interrupt asserts when in ternal data is requested from an empty dma fifo. internally, upper and lower panel dma fifo underflow interrupt signals are generated. the interrupt can be cleared by writing a 1 to the fufic bit in the intclr register. 23.7.12 lcd power-up an d power-down sequence the lcd controller requires the following power-up sequence to be performed: www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 579 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 1. when power is applied, the following signals are held low: ? lcdlp ? lcddclk ? lcdfp ? lcdenab/ lcdm ? lcdvd[23:0] ? lcdle 2. when lcd power is stabilized, a 1 is written to the lcden bi t in the ctrl register. this enables the following signals into their active states: ? lcdlp ? lcddclk ? lcdfp ? lcdenab/ lcdm ? lcdle the lcdv[23:0] signals remain in an inactive state. 3. when the signals in step 2 have stabiliz ed, the contrast volta ge (not controlled or supplied by the lcd controller) is applied to the lcd panel. 4. if required, a software or hardware timer can be used to provide the minimum display specific delay time between application of the control signals and power to the panel display. on completion of the time interval, power is applied to the panel by writing a 1 to the lcdpwr bit within the ctrl register that, in turn, sets the lcdpwr signal high and enables the lcdv[23:0] signals into their active states. the lcdpwr signal is intended to be used to gate the power to the lcd panel. the power-down sequence is the reverse of the above four steps and must be strictly followed, this time, writing the respective register bits with 0. figure 57 shows the power-up and power-down sequences. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 580 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd fig 57. power-up and power-down sequences lcdlp, lcdcp, lcdfp, lcdac, lcdle lcd power contrast voltage lcdpwr, lcd[23:0] minimum 0 ms lcd on sequence lcd off sequence minimum 0 ms minimum 0 ms display specific delay display specific delay minimum 0 ms www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 581 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.8 lcd timing diagrams (1) the active data lines will vary with the type of stn panel (4-bit, 8-bit, colo r, mono) and with single or dual frames. (2) the lcd panel clock is selected and scaled by the lcd controller and used to produce lcdclk. (3) the duration of the lcdlp signal is controll ed by the hsw field in the timh register. (4) the polarity of the lcdlp signal is determined by the ihs bit in the pol register. fig 58. horizontal timing for stn displays pixel clock (internal) lcd_timh (hsw) lcdlp (line synch pulse) suppressed during lcdlp lcd_timh (hbp) 16 ? lcd_timh(ppl) ? 1 lcd_timh (hfp) lcddclk (panel clock) horizontal back porch (defined in pixel clocks) horizontal front porch (defined in pixel clocks) one horizontal line of lcd data lcdvd[15:0] (panel data) one horizontal line www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 582 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd (1) signal polarities may va ry for some displays. fig 59. vertical timing for stn displays lcd_timv (vsw) lcddclk (panel clock) lcd_timv (vbp) lcd_timv(lpp) lcd_timv (vfp) lcdfp (vertical synch pulse) back porch (defined in line clocks) front porch (defined in line clocks) pixel data and horizontal controls for one frame one frame all horizontal lines for one frame see horizontal timing for stn displays panel data clock active (1) the active data lines will vary with the type of tft panel. (2) the lcd panel clock is selected and scaled by the lcd controller and used to produce lcdclk. (3) the duration of the lcdlp is controlled by the hsw field in the timh register. (4) the polarity of the lcdlp signal is determined by the ihs bit in the pol register. fig 60. horizontal timing for tft displays pixel clock (internal) lcd_timh (hsw) lcdlp (lhorizontal synch pulse) lcd_timh (hbp) lcd_timh(ppl) lcd_timh (hfp) lcddclk (panel clock) lcdenab horizontal back porch (defined in pixel clocks) horizontal front porch (defined in pixel clocks) one horizontal line of lcd data lcdvd[23:0] (panel data) one horizontal line www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 583 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd 23.9 lcd panel signal usage (1) polarities may vary for some displays. fig 61. vertical timing for tft displays lcd_timv (vsw) lcdena (data enable) lcd_timv (vbp) lcd_timv(lpp) lcd_timv (vfp) lcdfp (vertical synch pulse) back porch (defined in line clocks) front porch (defined in line clocks) pixel data and horizontal control signals for one frame one frame all horizontal lines for one frame see horizontal timing for tft displays data enable lcddclk (panel clock) panel data clock active table 494. lcd panel connections for stn single panel mode external pin 4-bit mono stn single panel 8-bit mono stn single panel color stn single panel lpc18xx pin used lcd function lpc18xx pin used lcd function lpc18xx pin used lcd function lcdvd23 - - - - - - lcdvd22 - - - - - - lcdvd21 - - - - - - lcdvd20 - - - - - - lcdvd19 - - - - - - lcdvd18 - - - - - - lcdvd17 - - - - - - lcdvd16 - - - - - - lcdvd15 - - - - - - lcdvd14 - - - - - - lcdvd13 - - - - - - lcdvd12 - - - - - - lcdvd11 - - - - - - lcdvd10 - - - - - - lcdvd9 - - - - - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 584 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd lcdvd8 - - - - - - lcdvd7 - - p8_4 ud[7] p8_4 ud[7] lcdvd6 - - p8_5 ud[6] p8_5 ud[6] lcdvd5 - - p8_6 ud[5] p8_6 ud[5] lcdvd4 - - p8_7 ud[4] p8_7 ud[4] lcdvd3 p4_2 ud[3] p4_2 ud[3] p4_2 ud[3] lcdvd2 p4_3 ud[2] p4_3 ud[2] p4_3 ud[2] lcdvd1 p4_4 ud[1] p4_4 ud[1] p4_4 ud[1] lcdvd0 p4_1 ud[0] p4_1 ud[0] p4_1 ud[0] lcdlp p7_6 lcdlp p7_6 lcdlp p7_6 lcdlp lcdenab/ lcdm p4_6 lcdenab/ lcdm p4_6 lcdenab/ lcdm p4_6 lcdenab/ lcdm lcdfp p4_5 lcdfp p4_5 lcdfp p4_5 lcdfp lcddclk p4_7 lcddclk p4_7 lcddclk p4_7 lcddclk lcdle p7_0 lcdle p7_0 lcdle p7_0 lcdle lcdpwr p7_7 cdpwr p7_7 lcdpwr p7_7 lcdpwr gp_clkin pf_4 lcdclkin pf_4 lcdclkin pf_4 lcdclkin table 494. lcd panel connections for stn single panel mode external pin 4-bit mono stn single panel 8-bit mono stn single panel color stn single panel lpc18xx pin used lcd function lpc18xx pin used lcd function lpc18xx pin used lcd function table 495. lcd panel connections for stn dual panel mode external pin 4-bit mono stn dual panel 8-bit mono stn dual panel color stn dual panel lpc18xx pin used lcd function lpc18xx pin used lcd function lpc18xx pin used lcd function lcdvd23 - - - - - - lcdvd22 - - - - - - lcdvd21 - - - - - - lcdvd20 - - - - - - lcdvd19 - - - - - - lcdvd18 - - - - - - lcdvd17 - - - - - - lcdvd16 - - - - - - lcdvd15 - - pb_4 ld[7] pb_4 ld[7] lcdvd14 - - pb_5 ld[6] pb_5 ld[6] lcdvd13 - - pb_6 ld[5] pb_6 ld[5] lcdvd12 - - p8_3 ld[4] p8_3 ld[4] lcdvd11 p4_9 ld[3] p4_9 ld[3] p4_9 ld[3] lcdvd10 p4_10 ld[2] p4_10 ld[2] p4_10 ld[2] lcdvd9 p4_8 ld[1] p4_8 ld[1] p4_8 ld[1] lcdvd8 p7_5 ld[0] p7_5 ld[0] p7_5 ld[0] lcdvd7 - - ud[7] p8_4 ud[7] lcdvd6 - - p8_5 ud[6] p8_5 ud[6] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 585 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd lcdvd5 - - p8_6 ud[5] p8_6 ud[5] lcdvd4 - - p8_7 ud[4] p8_7 ud[4] lcdvd3 p4_2 ud[3] p4_2 ud[3] p4_2 ud[3] lcdvd2 p4_3 ud[2] p4_3 ud[2] p4_3 ud[2] lcdvd1 p4_4 ud[1] p4_4 ud[1] p4_4 ud[1] lcdvd0 p4_1 ud[0] p4_1 ud[0] p4_1 ud[0] lcdlp p7_6 lcdlp p7_6 lcdlp p7_6 lcdlp lcdenab/ lcdm p4_6 lcdenab/ lcdm p4_6 lcdenab/ lcdm p4_6 lcdenab/ lcdm lcdfp p4_5 lcdfp p4_5 lcdfp p4_5 lcdfp lcddclk p4_7 lcddclk p4_7 lcddclk p4_7 lcddclk lcdle p7_0 lcdle p7_0 lcdle p7_0 lcdle lcdpwr p7_7 lcdpwr p7_7 lcdpwr p7_7 lcdpwr gp_clkin pf_4 lcdclkin pf_4 lcdclkin pf_4 lcdclkin table 495. lcd panel connections for stn dual panel mode external pin 4-bit mono stn dual panel 8-bit mono stn dual panel color stn dual panel lpc18xx pin used lcd function lpc18xx pin used lcd function lpc18xx pin used lcd function table 496. lcd panel connections for tft panels external pin tft 12 bit (4:4:4 mode) tft 16 bit (5 :6:5 mode) tft 16 bit (1:5:5:5 mode) tft 24 bit lpc18xx pin used lcd function lpc18xx pin used lcd function lpc18xx pin used lcd function lpc18xx pin used lcd function lcdvd23 pb_0 blue3 pb_0 blue4 pb_0 blue4 blue7 lcdvd22 pb_1 blue2 pb_1 blue3 pb_1 blue3 blue6 lcdvd21 pb_2 blue1 pb_2 blue2 pb_2 blue2 blue5 lcdvd20 pb_3 blue0 pb_3 blue1 pb_3 blue1 blue4 lcdvd19 - - p7_1 blue0 p7_1 blue0 blue3 lcdvd18 - - - - p7_2 intensity blue2 lcdvd17 - - - - - - p7_3 blue1 lcdvd16 - - - - - - p7_4 blue0 lcdvd15 pb_4 green3 pb_4 green5 pb_4 green4 pb_4 green7 lcdvd14 pb_5 green2 pb_5 green4 pb_5 green3 pb_5 green6 lcdvd13 pb_6 green1 pb_6 green3 pb_6 green2 pb_6 green5 lcdvd12 p8_3 green0 p8_3 green2 p8_3 green1 p8_3 green4 lcdvd11 - - p4_9 green1 p4_9 green0 p4_9 green3 lcdvd10 - - p4_10 green0 p4_10 intensity p4_10 green2 lcdvd9 - - - - - - p4_8 green1 lcdvd8 - - - - - - p7_5 green0 lcdvd7 p8_4 red3 p8_4 red4 p8_4 red4 p8_4 red7 lcdvd6 p8_5 red2 p8_5 red3 p8_5 red3 p8_5 red6 lcdvd5 p8_6 red1 p8_6 red2 p8_6 red2 p8_6 red5 lcdvd4 p8_7 red0 p8_7 red1 p8_7 red1 p8_7 red4 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 586 of 1164 nxp semiconductors UM10430 chapter 23: lpc18xx lcd lcdvd3 - - p4_2 red0 p4_2 red0 p4_2 red3 lcdvd2 - - - - p4_3 intensity p4_3 red2 lcdvd1 - - - - - - p4_4 red1 lcdvd0 - - - - - - p4_1 red0 lcdlp p7_6 lcdlp p7_6 lcdlp p7_6 lcdlp p7_6 lcdlp lcdenab/ lcdm p4_6 lcdenab/ lcdm p4_6 lcdenab/ lcdm p4_6 lcdenab/ lcdm p4_6 lcdenab/l cdm lcdfp p4_5 lcdfp p4_5 lcdfp p4_5 lcdfp p4_5 lcdfp lcddclk p4_7 lcddclk p4_7 lcddclk p4_7 lcddclk p4_7 lcddclk lcdle p7_0 lcdle p7_0 lcdle p7_0 lcdle p7_0 lcdle lcdpwr p7_7 lcdpwr p7_7 lcdpwr p7_7 lcdpwr p7_7 lcdpwr gp_clkin pf_4 lcdclkin pf_4 lcdclkin pf_4 lcdclkin pf_4 lcdclkin table 496. lcd panel connections for tft panels external pin tft 12 bit (4:4:4 mode) tft 16 bit (5 :6:5 mode) tft 16 bit (1:5:5:5 mode) tft 24 bit lpc18xx pin used lcd function lpc18xx pin used lcd function lpc18xx pin used lcd function lpc18xx pin used lcd function www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 587 of 1164 24.1 how to read this chapter the sct is available on all lpc18xx parts. the following configuration options apply to parts lpc1850_30_20_10 rev ?a? only: ? the sct inputs and outputs are connected to event-driven peripherals through the gima (see section 14.3 ). 24.2 basic configuration the sct is configured as follows: ? see ta b l e 4 9 7 for clocking and power control. ? the sct is reset by the sct_rst (reset #37). ? connect inputs and outputs of the sct through the gima (see chapter 14 ). ? the sct combined interrupt is connected to slot # 10 in the nvic. sct outputs 2, 6, 14 are ored with timer match channels and connected to slots # 13, 14, 16 in the event router (see ta b l e 1 6 ). ? for connecting the sct outputs 0 and 1 to the gpdma, use the dmamux register in the creg block (see ta b l e 3 5 ) and enable the gpdma channel in the dma channel configuration registers section 16.6.20 . 24.3 features ? two 16-bit counters or one 32-bit counter. ? counter(s) clocked by bu s clock or selected input. ? up counter(s) or up-down counter(s). ? state variable allows sequencin g across multiple counter cycles. ? event can be defined by a counter match c ondition, an input (or output) condition, a combination of a match and/or and input/ output condition in a specified state. ? events control outputs, interrupts, and dma requests. ? selected event(s) can limit, halt, start, or stop a counter. ? supports: ? 8 inputs ? 16 outputs ? 16 match/capture registers ? 16 events UM10430 chapter 24: lpc18xx state configurable timer (sct) rev. 00.13 ? 20 july 2011 user manual table 497. sct clocking and power control base clock branch clock maximum frequency sct base_m3_clk clk_m3_sct 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 588 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) ? 32 states 24.4 general description the state configurable timer (sct) allows a wide variety of timing, counting, output modulation, and input capture operations. the most basic user-programmable option is whether a sct operates as two 16-bit counters or a unified 32-bit counter. in the two-counter case, in addition to the counter value the following operational elements are independent for each half: ? state variable ? limit, halt, stop, and start conditions ? values of match/capture registers, plus reload or capture control values in the two-counter case, the following operational elements are global to the sct, but events, outputs, interrupts, and dma reques ts can use match conditions from either counter: ? clock selection ? inputs ? events ? outputs ? interrupts ? dma requests remark: this document uses the term ?bus error? to indicate a sct response that makes the processor take an exception. fig 62. sct block diagram prescaler(s) sct clock clk_m3_sct www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 589 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.5 pin description 24.6 register description the register addresses of the stat e configurable timer are shown in table 499 . for most of the sct registers, the register function de pends on the setting of certain other register bits: 1. the unify bit in the config register de termines whether the sct is used as one 32-bit register (for operation as one 32 -bit counter/timer) or as two 16-bit counter/timers named l and h. the setting of the unify bit is reflected in the register map: ? unify = 1: only one register is used (f or operation as one 32-bit counter/timer). ? unify = 0: the l and h registers can be accessed by a 32-bit read or write operation or can be read or written to i ndividually (for operation as two 16-bit counter/timers). typically, the unify bit is configured by writing to the config register before any other registers are accessed. 2. the regmoden bits in the regmode register determine whether each set of match/capture registers uses the match or capture functionality: ? regmoden = 1: registers operate as match and reload registers. fig 63. sct counter and select logic sct clock clk_m3_sct prescaler prescaler unified counter l counter h counter table 498. sct pin description function name direction description ctin_[7:0] i state configurable timer (sct) inputs. ctout_[15:0] o state configurable timer (sct) outputs. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 590 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) ? regmoden = 0: registers operate as capture and capture control registers. table 499. register overview: state configurable timer (base address 0x4000 0000) name access address offset description reset value config r/w 0x000 sct configuration register 0x0000 7e00 ctrl r/w 0x004 sct control register 0x0004 0004 ctrl_l r/w 0x004 sct control register low counter 16-bit 0x0004 0004 ctrl_h r/w 0x006 sct control register high counter 16-bit 0x0004 0004 limit r/w 0x008 sct limit register 0x0000 0000 limit_l r/w 0x008 sct limit register low counter 16-bit 0x0000 0000 limit_h r/w 0x00a sct limit register high counter 16-bit 0x0000 0000 halt r/w 0x00c sct halt condition register 0x0000 0000 halt_l r/w 0x00c sct halt condition register low counter 16-bit 0x0000 0000 halt_h r/w 0x00e sct halt condition register high counter 16-bit 0x0000 0000 stop r/w 0x010 sct stop condition register 0x0000 0000 stop_l r/w 0x010 sct stop condition register low counter 16-bit 0x0000 0000 stop_h r/w 0x012 sct stop condition register high counter 16-bit 0x0000 0000 start r/w 0x014 sct start condition register 0x0000 0000 start_l r/w 0x014 sct start condition register low counter 16-bit 0x0000 0000 start_h r/w 0x016 sct start condition register high counter 16-bit 0x0000 0000 - - 0x018 - 0x03c reserved count r/w 0x040 sct counter register 0x0000 0000 count_l r/w 0x040 sct counter register low counter 16-bit 0x0000 0000 count_h r/w 0x042 sct counter register high counter 16-bit 0x0000 0000 state r/w 0x044 sct state register 0x0000 0000 state_l r/w 0x044 sct state register low counter 16-bit 0x0000 0000 state_h r/w 0x046 sct state register high counter 16-bit 0x0000 0000 input ro 0x048 sct input register 0x0000 0000 regmode r/w 0x04c sct match/capture registers mode register 0x0000 0000 regmode_l r/w 0x04c sct match/capture registers mode register low counter 16-bit 0x0000 0000 regmode_o r/w 0x04e sct match/capture registers mode register high counter 16-bit 0x0000 0000 output r/w 0x050 sct output register 0x0000 0000 outputdirctrl r/w 0x054 sct output counter direction control register 0x0000 0000 res r/w 0x058 sct conflict resolution register 0x0000 0000 dmareq0 r/w 0x05c sct dma request 0 register 0x0000 0000 dmareq1 r/w 0x060 sct dma request 1 register 0x0000 0000 - - 0x064 - 0x0ec reserved even r/w 0x0f0 sct event enable register 0x0000 0000 evflag r/w 0x0f4 sct event flag register 0x0000 0000 conen r/w 0x0f8 sct conflict enable register 0x0000 0000 conflag r/w 0x0fc sct conflict flag register 0x0000 0000 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 591 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) match0 to match15 r/w 0x100 to 0x13c sct match value register of match channels 0 to 15; regmod0 to regmode15 = 0 0x0000 0000 match0_l to match15_l r/w 0x100 to 0x13c sct match value register of match channels 0 to 15; low counter 16-bit; regmod0_l to regmode15_l = 0 0x0000 0000 match0_h to match15_h r/w 0x102 to 0x13e sct match value register of match channels 0 to 15; high counter 16-bit; regmod0_h to regmode15_h = 0 0x0000 0000 cap0 to cap15 0x100 to 0x13c sct capture register of capture channel 0 to 15; regmod0 to regmode15 = 1 0x0000 0000 cap0_l to cap15_l 0x100 to 0x13c sct capture register of capture channel 0 to 15; low counter 16-bit; regmod0_l to regmode15_l = 1 0x0000 0000 cap0_h to cap15_h 0x102 to 0x13e sct capture register of capture channel 0 to 15; high counter 16-bit; regmod0_h to regmode15_h = 1 0x0000 0000 matchrel0 to matchrel15 r/w 0x200 to 0x23c sct match reload value register 0 to 15; regmod0 = 0 to regmode15 = 0 0x0000 0000 matchrel0_l to matchrel15_l r/w 0x200 to 0x23c sct match reload value register 0 to 15; low counter 16-bit; regmod0_l = 0 to regmode15_l = 0 0x0000 0000 matchrel0_h to matchrel15_h r/w 0x202 to 0x23e sct match reload value register 0 to 15; high counter 16-bit; regmod0_h = 0 to regmode15_h = 0 0x0000 0000 capctrl0 to capctrl15 0x200 to 0x23c sct capture control register 0 to 15; regmod0 = 1 to regmode15 = 1 0x0000 0000 capctrl0_l to capctrl15_l 0x200 to 0x23c sct capture control register 0 to 15; low counter 16-bit; regmod0_l = 1 to regmode15_l = 1 0x0000 0000 capctrl0 to capctrl15 0x202 to 0x23e sct capture control register 0 to 15; high counter 16-bit; regmod0 = 1 to regmode15 = 1 0x0000 0000 evstatemsk0 r/w 0x300 sct event state register 0 0x0000 0000 evctrl0 r/w 0x304 sct event control register 0 0x0000 0000 evstatemsk1 r/w 0x308 sct event state register 1 0x0000 0000 evctrl1 r/w 0x30c sct event control register 1 0x0000 0000 evstatemsk2 r/w 0x310 sct event state register 2 0x0000 0000 evctrl2 r/w 0x314 sct event control register 2 0x0000 0000 evstatemsk3 r/w 0x318 sct event state register 3 0x0000 0000 evctrl3 r/w 0x31c sct event control register 3 0x0000 0000 evstatemsk4 r/w 0x320 sct event state register 4 0x0000 0000 evctrl4 r/w 0x324 sct event control register4 0x0000 0000 evstatemsk5 r/w 0x328 sct event state register 5 0x0000 0000 evctrl5 r/w 0x32c sct event control register 5 0x0000 0000 evstatemsk6 r/w 0x330 sct event state register 6 0x0000 0000 evctrl6 r/w 0x334 sct event control register 6 0x0000 0000 evstatemsk7 r/w 0x338 sct event state register 7 0x0000 0000 evctrl7 r/w 0x33c sct event control register 7 0x0000 0000 evstatemsk8 r/w 0x340 sct event state register 8 0x0000 0000 evctrl8 r/w 0x344 sct event control register 8 0x0000 0000 evstatemsk9 r/w 0x348 sct event state register 9 0x0000 0000 table 499. register overview: state configurable timer (base address 0x4000 0000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 592 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) evctrl9 r/w 0x34c sct event control register 9 0x0000 0000 evstatemsk10 r/w 0x350 sct event state register 10 0x0000 0000 evctrl10 r/w 0x354 sct event control register 10 0x0000 0000 evstatemsk11 r/w 0x358 sct event state register 11 0x0000 0000 evctrl11 r/w 0x35c sct event control register 11 0x0000 0000 evstatemsk12 r/w 0x360 sct event state register 12 0x0000 0000 evctrl12 r/w 0x364 sct event control register 12 0x0000 0000 evstatemsk13 r/w 0x368 sct event state register 13 0x0000 0000 evctrl13 r/w 0x36c sct event control register 13 0x0000 0000 evstatemsk14 r/w 0x370 sct event state register 14 0x0000 0000 evctrl14 r/w 0x374 sct event control register 14 0x0000 0000 evstatemsk15 r/w 0x378 sct event state register 15 0x0000 0000 evctrl15 r/w 0x37c sct event control register 15 0x0000 0000 outputset0 r/w 0x500 sct output 0 set register 0x0000 0000 outputcl0 r/w 0x504 sct output 0 clear register 0x0000 0000 outputset1 r/w 0x508 sct output 1 set register 0x0000 0000 outputcl1 r/w 0x50c sct output 1 clear register 0x0000 0000 outputset2 r/w 0x510 sct output 2 set register 0x0000 0000 outputcl2 r/w 0x514 sct output 2 clear register 0x0000 0000 outputset3 r/w 0x518 sct output 3 set register 0x0000 0000 outputcl3 r/w 0x51c sct output 3 clear register 0x0000 0000 outputset4 r/w 0x520 sct output 4 set register 0x0000 0000 outputcl4 r/w 0x524 sct output 4 clear register 0x0000 0000 outputset5 r/w 0x528 sct output 5 set register 0x0000 0000 outputcl5 r/w 0x52c sct output 5 clear register 0x0000 0000 outputset6 r/w 0x530 sct output 6 set register 0x0000 0000 outputcl6 r/w 0x534 sct output 6 clear register 0x0000 0000 outputset7 r/w 0x538 sct output 7 set register 0x0000 0000 outputcl7 r/w 0x53c sct output 7 clear register 0x0000 0000 outputset8 r/w 0x540 sct output 8 set register 0x0000 0000 outputcl8 r/w 0x544 sct output 8 clear register 0x0000 0000 outputset9 r/w 0x548 sct output 9 set register 0x0000 0000 outputcl9 r/w 0x54c sct output 9 clear register 0x0000 0000 outputset10 r/w 0x550 sct output 10 set register 0x0000 0000 outputcl10 r/w 0x554 sct output 10 clear register 0x0000 0000 outputset11 r/w 0x558 sct output 11 set register 0x0000 0000 outputcl11 r/w 0x55c sct output 11 clear register 0x0000 0000 outputset12 r/w 0x560 sct output 12 set register 0x0000 0000 outputcl12 r/w 0x564 sct output 12 clear register 0x0000 0000 outputset13 r/w 0x568 sct output 13 set register 0x0000 0000 table 499. register overview: state configurable timer (base address 0x4000 0000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 593 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.1 sct configuration register this register configures the overall operatio n of the sct and should be written before any other registers. outputcl13 r/w 0x56c sct output 13 clear register 0x0000 0000 outputset14 r/w 0x570 sct output 14 set register 0x0000 0000 outputcl14 r/w 0x574 sct output 14 clear register 0x0000 0000 outputset15 r/w 0x578 sct output 15 set register 0x0000 0000 outputcl15 r/w 0x57c sct output 15 clear register 0x0000 0000 table 499. register overview: state configurable timer (base address 0x4000 0000) ?continued name access address offset description reset value table 500. sct configuration register (con fig - address 0x4000 0000) bit description bit symbol value description reset value 0 unify sct operation 0 0 the sct operates as two 16-bit counters named l and h. 1 the sct operates as a unified 32-bit counter. 2:1 clkmode sct clock mode 00 0x0 the sct and prescaler(s) are clocked by the bus clock. 0x1 the sct clock is the bus clock, but the prescaler(s) is (are) enabled to count only when sampling of the input selected by the cksel field finds the selected edge. the minimum pulse width on the clock input is 1 bus clock period. this is the high-performance sampled-clock mode. 0x2 the sct and prescaler(s) are clocked by the input selected by cksel, synchronized to the bus clock and possi bly inverted. the minimum pulse width on the clock input is 1 bus clock period. this is the low-power sampled-clock mode. 0x3 the sct and prescaler(s) are clocked by the input edge selected by the cksel field. in this m ode the following is true: most of the sct is clocked by the (selected polarity of the) input. outputs are switched synchronously to the input clock. the input clock rate must be at least half the bus clock rate and can be faster than the bus clock. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 594 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.2 sct control register if unify = 1 in the config register, only the _l bits are used. if unify = 0 in the config regi ster, this register can be written to as two registers ctrl_l (address 0x4000 4004) and ctrl_h (address 0x4000 4006). both the l and h registers can be read or written in a single 32- bit read or write operation, or they can be read or written individually. all bits in this register can be written to w hen the counter is stopped or halted. when the counter is running, the only bits that can be written are stop or halt. (other bits can be written in a subsequent write after halt is set to 1.) 6:3 clksel sct clock select 0000 0x0 rising edges on input 0. 0x1 falling edges on input 0. 0x2 rising edges on input 1. 0x3 falling edges on input 1. 0x4 rising edges on input 2. 0x5 falling edges on input 2. 0x6 rising edges on input 3. 0x7 falling edges on input 3. 0x8 rising edges on input 4. 0x9 falling edges on input 4. 0xa rising edges on input 5. 0xb falling edges on input 5. 0xc rising edges on input 6. 0xd falling edges on input 6. 0xe rising edges on input 7. 0xf falling edges on input 7. 7 norelaodl_ noreloadu - a 1 in this bit prevents the lower match registers from being reloaded from their respective reload registers. software can write to set or clear this bit at any time. this bit applies to both the higher and lower registers when the unify bit is set. 0 8 noreloadh - a 1 in this bit prevents the higher match registers from being reloaded from their respective reload registers. software can write to set or clear this bit at any time. this bit is not used when the unify bit is set. 0 16:9 insyncn - synchronization for input n (bit 9 = input 0, bit 10 = input 1,..., bit 16 = input 7). a 1 in one of these bits subjects the corresponding input to synchronization to the sct clock, before it is used to create an event. if an input is synchronous to the sct clock, keep its bit 0 for faster response. when the ckmode field is 1x, the bit in this field, corresponding to the input selected by the cksel field, is not used. 1 31:17 - reserved - table 500. sct configuration register (con fig - address 0x4000 0000) bit description ?continued bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 595 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.3 sct limit register if unify = 1 in the config register, only the _l bits are used. table 501. sct control register (ctrl - address 0x4000 0004) bit description bit symbol value description reset value 0 down_l - this bit is 1 when the l or unified co unter is counting down. it is set by hardware when the counter?s limit is reached and bidi r is 1. it is cleared by hardware when the counter reaches 0. 0 1 stop_l - when this bit is 1 and halt is 0, the l or unified counter does not run but i/o events related to the counter can occur. if such an event matches the mask in the start register, this bit is cleared and counting resumes. 0 2 halt_l - when this bit is 1, the l or unified counter does not run and no events can occur. this bit is set by reset. remark: once set, this bit can only be cleared by software to restore counter operation. 1 3 clrctr_l - writing a 1 to this bit clears the l or unified counter. this bit always reads as 0. 0 4 bidir_l l or unified counter direction select 0 0 the counter counts up to its limit condition, then is cleared to zero. 1 the counter counts up to its limit, then counts down to 0. 12:5 pre_l - specifies the factor by which the sct clock is prescaled to produce the l or unified counter clock. the counter clock will be clocked at the rate of the sct clock divided by pre_l+1. remark: clear the counter (by writing a 1 to the clrctr bit) whenever changing the pre value. 0 15:13 - reserved 16 down_h - this bit is 1 when the h counter is co unting down. it is set by hardware when the counter?s limit is reached and bidir is 1. it is cleared by hardware when the counter reaches 0. 0 17 stop_h - when this bit is 1 and halt is 0, the h counter does not run but i/o events related to the counter can occur. if such an event matches the mask in the start register, this bit is cleared and counting resumes. 0 18 halt_h - when this bit is 1, the h counter does no t run and no events can occur. this bit is set by reset. remark: once set, this bit can only be cleared by software to restore counter operation. 1 19 clrctr_h - writing a 1 to this bit clears the h counter. this bit always reads as 0. 0 20 bidir_h direction select 0 0 the h counter counts up to its limit condition, then is cleared to zero. 1 the h counter counts up to its limit, then counts down to 0. 28:21 pre_h - specifies the factor by which the sc t clock is prescaled to produce the h counter clock. the counter clock will be clocked at the rate of the sct clock divided by prelh+1. remark: clear the counter (by writing a 1 to the clrctr bit) whenever changing the pre value. 0 31:29 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 596 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) if unify = 0 in the config regi ster, this register can be written to as two registers limit_l (address 0x4000 4008) and limit_h (address 0x4000 400a). both the l and h registers can be read or written in a single 32- bit read or write operation, or they can be read or written individually. the bits in this register set which events ac t as counter limits. when a limit event occurs, the counter is cleared to zero in unidirectional mode or begins counting down in bidirectional mode. when the counter reaches a ll ones, this state is always treated as a limit event, and the counter is cleared in un idirectional mode or, in bidirectional mode, begins counting down on the next clock edge - even if no limit even t as defined by the sct limit register has occurred. 24.6.4 sct halt condition register if unify = 1 in the config register, only the _l bits are used. if unify = 0 in the config regi ster, this register can be written to as two registers halt_l (address 0x4000 400c) and halt_h (address 0x4000 400e). both the l and h registers can be read or written in a single 32- bit read or write operation, or they can be read or written individually. remark: any event halting the counter disables it s operation until software clears the halt bit (or bits) in the ctrl register ( ta b l e 5 0 1 ). 24.6.5 sct stop condition register if unify = 1 in the config register, only the _l bits are used. if unify = 0 in the config regi ster, this register can be written to as two registers stopt_l (address 0x4000 4010) and stop_h (address 0x4000 4012). both the l and h registers can be read or written in a single 32- bit read or write operation, or they can be read or written individually. table 502. sct limit register (limit - address 0x4000 0008) bit description bit symbol description reset value 15:0 limmsk_l if bit n is one, event n is used as a counter limit for the l or unified counter (event 0 = bit 0, event 1 = bit 1, event 15 = bit 15). 0 31:16 limmsk_h if bit n is one, event n is used as a counter limit for the h counter (event 0 = bit 16, event 1 = bit 17, event 15 = bit 31). 0 table 503. sct halt condition register (halt - address 0x4000 000c) bit description bit symbol description reset value 15:0 haltmsk_l if bit n is one, event n sets the halt_l bit in the ctrl register (event 0 = bit 0, event 1 = bit 1, event 15 = bit 15). 0 31:16 haltmsk_h if bit n is one, event n sets the halt_h bit in the ctrl register (event 0 = bit 16, event 1 = bit 17, event 15 = bit 31). 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 597 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.6 sct start condition register if unify = 1 in the config register, only the _l bits are used. if unify = 0 in the config regi ster, this register can be written to as two registers start_l (address 0x4000 4014) and start_h (address 0x4000 4016). both the l and h registers can be read or written in a single 32 -bit read or write operation, or they can be read or written individually. the bits in this register select which event(s), if any, clear the stop bit in the control register. (since no events can occur when halt is 1, halt can only be cleared by software writing the control register.) 24.6.7 sct counter register if unify = 1 in the config register, the counter is a unified 32-bit register and both the _l and _h bits are used. if unify = 0 in the config regi ster, this register can be written to as two registers count_l (address 0x4000 4040) and count_h (address 0x4000 4042). both the l and h registers can be read or written in a sing le 32-bit read or write operation, or they can be read or written individually. in this case, the l and h registers count independently under the control of the other registers. attempting to write a counter while it is running will not af fect the counter but will produce a bus error. software can read the counter register(s) at any time. table 504. sct stop condition register (stop - address 0x4000 0010) bit description bit symbol description reset value 15:0 stopmsk_l if bit n is one, event n sets the stop_l bit in the ctrl register (event 0 = bit 0, event 1 = bit 1, event 15 = bit 15). 0 31:16 stopmsk_h if bit n is one, event n sets the stop_h bit in the ctrl register (event 0 = bit 16, event 1 = bit 17, event 15 = bit 31). 0 table 505. sct start condition register (start - address 0x4000 0014) bit description bit symbol description reset value 15:0 startmsk_l if bit n is one, event n clears the stop_l bit in the ctrl register (event 0 = bit 0, event 1 = bit 1, event 15 = bit 15). 0 31:16 startmsk_h if bit n is one, event n clears the stop_h bit in the ctrl register (event 0 = bit 16, event 1 = bit 17, event 15 = bit 31). 0 table 506. sct counter register (count - address 0x4000 0040) bit description bit symbol description reset value 15:0 ctr_l when unify = 0, read or write the 16-bit l counter value. when unify = 1, read or write the lower 16 bits of the 32-bit unified counter. 0 31:16 ctr_h when unify = 0, read or write the 16-bit h counter value. when unify = 1, read or write the upper 16 bits of the 32-bit unified counter. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 598 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.8 sct state register if unify = 1 in the config register, only the _l bits are used. if unify = 0 in the config regi ster, this register can be written to as two registers state_l (address 0x4000 4044) and state_h (address 0x4000 4046). both the l and h registers can be read or written in a single 32 -bit read or write operation, or they can be read or written individually. software can read the state associated with a counter at any time. writing the state is only allowed when the counter?s halt bit is 1; when halt is 0, a write attempt does not change the state and results in a bus error. the state variable is the main feature that di stinguishes the sct from other counter/timer/ pwm blocks. events can be made to occur onl y in certain states. events, in turn, can perform the following actions: ? set and clear outputs ? limit, stop, and start the counter ? cause interrupts and dma requests ? modify the state variable the value of a state variable is completely under the control of the application. if an application does not use states, the value of the state variable remains zero, which is the default value. a state variable can be used to track and cont rol multiple cycles of the associated counter in any desired operational sequence, and it is logically associated with a state machine diagram which represents the sct configuration. see section 24.6.23 and 24.6.24 for more about the relationship between states and events. all possible values for the state variable ar e set by the stateld/stadev fields in the event control registers of all defined events. the change of the state variable during multiple counter cycles reflects how the associated state machine moves from one state to the next. 24.6.9 sct input register software can read the state of the sct?s inputs in this read-only register in two slightly different forms. the only situ ation in which these will differ is if clkmode = 2 in the config register. table 507. sct state register (state - address 0x4000 0044) bit description bit symbol description reset value 4:0 state_l state variable. 0 15:5 - reserved. - 20:16 state_h state variable. 0 31:21 - reserved. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 599 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.10 sct match/capture registers mode register if unify = 1 in the config regist er, only the _l bits of this register are used, and they control whether each set of match/capt ure registers operate as unified 32-bit capture/match registers. if unify = 0 in the config regi ster, this register can be written to as two registers regmode_l (address 0x4000 404c) and regmode_h (address 0x4000 404e). both the l and h registers can be read or written in a single 32-bit read or write operation, or they can be read or written individually. the _l bits/registers cont rol the l match/capture registers, and the _h bits/registers control the h match/capture registers. the sct contains 16 match/capture register pairs. the register mode register selects whether each register pair acts as a match register (see section 24.6.19 ) or as a capture register (see section 24.6.20 ). each match/capture regi ster has an accompanying register which serves as a reload register wh en the register is used as a match register ( section 24.6.21 ) or as a capture-control register when the register is used as a capture register ( section 24.6.22 ). regmode_h is used only when the unify bit is 0. an alternate addressing mode is avail able for all of the match/capture and reload/capture-cont rol registers, for dma access to halfword registers when unify=0. it is described in section 24.7.9 . table 508. sct input register (input - address 0x4000 0048) bit description bit symbol description reset value 0 ain0 real-time status of input 0. pin 1 ain1 real-time status of input 1. pin 2 ain2 real-time status of input 2. pin 3 ain3 real-time status of input 3. pin 4 ain4 real-time status of input 4. pin 5 ain5 real-time status of input 5. pin 6 ain6 real-time status of input 6. pin 7 ain7 real-time status of input 7. pin 15:8 - reserved. - 16 sin0 input 0 state synchronized to the sct clock. - 17 sin1 input 1 state synchronized to the sct clock. - 18 sin2 input 2 state synchronized to the sct clock. - 19 sin3 input 3 state synchronized to the sct clock. - 20 sin4 input 4 state synchronized to the sct clock. - 21 sin5 input 5 state synchronized to the sct clock. - 22 sin6 input 6 state synchronized to the sct clock. - 23 sin7 input 7 state synchronized to the sct clock. - 31:24 - reserved - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 600 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.11 sct output register the sct supports 16 outputs, each of whic h has a corresponding bit in this register. software can write to any of the output registers when both counters are halted to control the outputs directly. writing to this register when either counter is stopped or running does not affect the outputs and results in an bus error. software can read this register at any time to sense the state of the outputs. 24.6.12 sct bidirectional output control register this register specifies (for each output) the impact of the counting direction on the meaning of set and clear oper ations on the output (see section 24.6.25 and section 24.6.26 ). table 509. sct match/capture registers mode register (regmode - address 0x4000 004c) bit description bit symbol description reset value 15:0 regmod_l each bit controls one pair of match/capture registers (register 0 = bit 0, register 1 = bit 1,..., register 15 = bit 15). 0 = registers operate as match registers. 1 = registers operate as capture registers. 0 31:16 regmod_h each bit controls one pair of match/capture registers (register 0 = bit 16, register 1 = bit 17,..., register 15 = bit 31). 0 = registers operate as match registers. 1 = registers operate as capture registers. 0 table 510. sct output register (output - address 0x4000 0050) bit description bit symbol description reset value 15:0 out writing a 1 to bit n makes the corresponding output high. 0 makes the corresponding output low (output 0 = bit 0, output 1 = bit 1,..., output 15 = bit 15). 0 31:16 - reserved table 511. sct bidirectional output control register (outputdirctrl - address 0x4000 0054) bit description bit symbol value description reset value 1:0 setclr0 set/clear operation on output 0. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 3:2 setclr1 set/clear operation on output 1. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 601 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 5:4 setclr2 set/clear operation on output 2. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 7:6 setclr3 set/clear operation on output 3. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 9:8 setclr4 set/clear operation on output 4. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 11: 10 setclr5 set/clear operation on output 5. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 13: 12 setclr6 set/clear operation on output 6. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 15: 14 setclr7 set/clear operation on output 7. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 17: 16 setclr8 set/clear operation on output 8. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 19: 18 setclr9 set/clear operation on output 9. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 21: 20 setclr10 set/clear operation on output 5. value 0x 3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 23: 22 setclr11 set/clear operation on output 11. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. table 511. sct bidirectional output control register (outputdirctrl - address 0x4000 0054) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 602 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.13 sct conflict resolution register the registers outputsetn ( section 24.6.25 ) and outputcln ( section 24.6.26 ) allow both setting and clearing to be indicated for an output in the same clock cycle, even for the same event. this sct conflict resolution register controls what happens when this occurs. to enable an event to toggle an output, set the onres value to 0x3 in this register, and set the event?s bits in both the set and clear registers. 25: 24 setclr12 set/clear operation on output 12. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 27: 26 setclr13 set/clear operation on output 13. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 29: 28 setclr14 set/clear operation on output 14. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. 31: 30 setclr15 set/clear operation on output 15. value 0x3 is reserved. do not program this value. 0 0x0 set and clear do not depend on any counter. 0x1 set and clear are reversed when counter l or the unified counter is counting down. 0x2 set and clear are reversed when counter h is counting down. do not use if unify = 1. table 511. sct bidirectional output control register (outputdirctrl - address 0x4000 0054) bit description bit symbol value description reset value table 512. sct conflict resolution register (res - address 0x4000 0058) bit description bit symbol value description reset value 1:0 o0res effect of simultaneous set and clear on output 0. 0 0x0 no change. 0x1 set output (or clear based on the setclr0 field). 0x2 clear output (or set based on the setclr0 field). 0x3 toggle output. 3:2 o1res effect of simultaneous set and clear on output 1. 0 0x0 no change. 0x1 set output (or clear based on the setclr1 field). 0x2 clear output (or set based on the setclr1 field). 0x3 toggle output. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 603 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 5:4 o2res effect of simultaneous set and clear on output 2. 0 0x0 no change. 0x1 set output (or clear based on the setclr2 field). 0x2 clear output n (or set based on the setclr2 field). 0x3 toggle output. 7:6 o3res effect of simultaneous set and clear on output 3. 0 0x0 no change. 0x1 set output (or clear based on the setclr3 field). 0x2 clear output (or set based on the setclr3 field). 0x3 toggle output. 9:8 o4res effect of simultaneous set and clear on output 4. 0 0x0 no change. 0x1 set output (or clear based on the setclr4 field). 0x2 clear output (or set based on the setclr4 field). 0x3 toggle output. 11: 10 o5res effect of simultaneous set and clear on output 5. 0 0x0 no change. 0x1 set output (or clear based on the setclr5 field). 0x2 clear output (or set based on the setclr5 field). 0x3 toggle output. 13: 12 o6res effect of simultaneous set and clear on output 6. 0 0x0 no change. 0x1 set output (or clear based on the setclr6 field). 0x2 clear output (or set based on the setclr6 field). 0x3 toggle output. 15: 14 o7res effect of simultaneous set and clear on output 7. 0 0x0 no change. 0x1 set output (or clear based on the setclr7 field). 0x2 clear output (or set based on the setclr7 field). 0x3 toggle output. 17: 16 o8res effect of simultaneous set and clear on output 8. 0 0x0 no change. 0x1 set output (or clear based on the setclr8 field). 0x2 clear output (or set based on the setclr8 field). 0x3 toggle output. 19: 18 o9res effect of simultaneous set and clear on output 9. 0 0x0 no change. 0x1 set output (or clear based on the setclr9 field). 0x2 clear output (or set based on the setclr9 field). 0x3 toggle output. table 512. sct conflict resolution register (res - address 0x4000 0058) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 604 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.14 sct dma request 0 and 1 registers the sct includes two dma request outputs. thes e registers enable the dma requests to be triggered when a particular event occu rs or when a counter?s match registers are loaded from its reload registers. 21: 20 o10res effect of simultaneous set and clear on output 10. 0 0x0 no change. 0x1 set output (or clear based on the setclr10 field). 0x2 clear output (or set based on the setclr10 field). 0x3 toggle output. 23: 22 o11res effect of simultaneous set and clear on output 11. 0 0x0 no change. 0x1 set output (or clear based on the setclr11 field). 0x2 clear output (or set based on the setclr11 field). 0x3 toggle output. 25: 24 o10res effect of simultaneous set and clear on output 12. 0 0x0 no change. 0x1 set output (or clear based on the setclr12 field). 0x2 clear output (or set based on the setclr12 field). 0x3 toggle output. 27: 26 o13res effect of simultaneous set and clear on output 13. 0 0x0 no change. 0x1 set output (or clear based on the setclr13 field). 0x2 clear output (or set based on the setclr13 field). 0x3 toggle output. 29: 28 o14res effect of simultaneous set and clear on output 14. 0 0x0 no change. 0x1 set output (or clear based on the setclr14 field). 0x2 clear output (or set based on the setclr14 field). 0x3 toggle output. 31: 30 o15res effect of simultaneous set and clear on output 15. 0 0x0 no change. 0x1 set output (or clear based on the setclr15 field). 0x2 clear output (or set based on the setclr15 field). 0x3 toggle output. table 512. sct conflict resolution register (res - address 0x4000 0058) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 605 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.15 sct flag enable register this register enables flags to request an inte rrupt if the flagn bit in the sct event flag register ( section 24.6.16 ) is also set. 24.6.16 sct event flag register this register records events. writing ones to this register clears the corresponding flags and will negate the sct inte rrupt request if all enabled flag bits are zero. table 513. sct dma 0 request register (dmareq0 - address 0x4000 005c) bit description bit symbol description reset value 15:0 dev_0 if bit n is one, event n sets dma request 0 (event 0 = bit 0, event 1 = bit 1,..., event 15 = bit 15). 0 29:16 - reserved - 30 drl0 a 1 in this bit makes the sct set dma request 0 when it loads the match_l/unified registers from the reload_l/unified registers. 31 drq0 this read-only bit indicates the state of dma request 0 table 514. sct dma 1 request register (dma req1 - address 0x4000 0060) bit description bit symbol description reset value 15:0 dev_1 if bit n is one, event n sets dma request 1 (event 0 = bit 0, event 1 = bit 1,..., event 15 = bit 15). 0 29:16 - reserved - 30 drl1 a 1 in this bit makes the sct set dma request 1 when it loads the match l/unified registers from the reload l/unified registers. 31 drq1 this read-only bit indicates the state of dma request 1. table 515. sct flag en able register (even - addres s 0x4000 00f0) bi t description bit symbol description reset value 15:0 ien the sct requests interrupt when bit n of this register and the event flag register are both one (event 0 = bit 0, event 1 = bit 1,..., event 15 = bit 15). 0 31:16 - reserved table 516. sct event flag register (evflag - address 0x4000 00f4) bit description bit symbol description reset value 15:0 flag bit n is one if event n has occurred since reset or a 1 was last written to this bit (event 0 = bit 0, event 1 = bit 1,..., event 15 = bit 15). 0 31: 16 - reserved - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 606 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.17 sct conflict enable register this register enables the ?no change conflict? events specified in the sct conflict resolution register to request an irq. 24.6.18 sct conflict flag register this register records interrupt-enabled no-change conflict events and provides details of a bus error. writing ones to the ncflag bits clears the corresponding read bits and will negate the sct?s interrupt request if all enabled flag bits are then zero. 24.6.19 sct match registers 0 to 15 (regmoden bit = 0) match registers are compared to the counter(s) to help create events. when the unify bit is 0, the l and h registers are independent ly compared to the l and h counters. when unify is 1, the l and h registers hold a 32-bit value that is compared to the unified counter. a match can only occur in a clock in which the counter is running (stop and halt are both 0). match registers can be read at any time. writ ing to a match register while the associated counter is running will not affect the match regi ster and will result in an bus error. match events occur in the sct clock in which the counter is (or would be) incremented to the next value. when a match event limits its counter as described in section 24.6.3 , the value in the match register is the last value of the counter before it is cleared to zero (or decremented if bidir is 1). table 517. sct conflict enable register (conen - address 0x4000 00f8) bit description bit symbol description reset value 15:0 ncen the sct requests interrupt when bit n of this register and the sct conflict flag register are both one (output 0 = bit 0, output 1 = bit 1,..., output 15 = bit 15). 0 31:16 - reserved table 518. sct conflict flag register (conflag - address 0x4000 00fc) bit description bit symbol description reset value 15:0 ncflag bit n is one if a no-change conflict event occurred on output n since reset or a 1 was last written to this bit (output 0 = bit 0, output 1 = bit 1,..., output 15 = bit 15). 0 29:16 - reserved. - 30 buserrl the most recent bus error from this sct involved writing ctr l/unified, state l/unified, match l/unified, or the output register when the l/u counter was not halted. note that a word write to certain l and h registers can be half successful and half unsuccessful. 0 31 buserrh the most recent bus error from this sct involved writing ctr h, state h, match h, or the output register when the h counter was not halted. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 607 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) there is no ?write-through? from reload registers to match registers. before starting a counter, software can write on e value to the match register that will be used in the first cycle of the counter, and a different value to the corresponding match reload register that will be used in the second cycle. 24.6.20 sct capture register s 0 to 15 (regmoden bit = 1) these register(s) allow software to read the counter value(s) at which the event selected by the corresponding capture control register(s) occurred. 24.6.21 sct match reload regist ers 0 to 15 (regmoden bit = 0) a match register (l, h, or unified 32-bit) is loaded from the corresponding reload register when bidir is 0 and the counter reaches its lim it condition, or when bidir is 1 and the counter reaches 0. table 519. sct match registers 0 to 15 (match - address 0x4000 0100 (match0) to 0x4000 4013c (match15)) bit description (regmoden bit = 0) bit symbol description reset value 15:0 matchn_l when unify = 0, read or write the 16-bit value to be compared to the l counter. when unify = 1, read or write the lower 16 bits of the 32-bit value to be compared to the unified counter. 0 31:16 matchn_h when unify = 0, read or write the 16-bit value to be compared to the h counter. when unify = 1, read or write the upper 16 bits of the 32-bit value to be compared to the unified counter. 0 table 520. sct capture registers 0 to 15 (cap - address 0x4000 0100 (cap0) to 0x4000 013c (cap15)) bit description (regmoden bit = 1) bit symbol description reset value 15:0 capn_l when unify = 0, read the 16-bit counter value at which this register was last captured. when unify = 1, read the lower 16 bits of the 32-bit value at which this register was last captured. 0 31:16 capn_h when unify = 0, read the 16-bit counter value at which this register was last captured. when unify = 1, read the upper 16 bits of the 32-bit value at which this register was last captured. 0 table 521. sct match reload registers 0 to 15 (matchrel- address 0x4000 0200 (matchreload0) to 0x4000 023c (m atchreload15) bit description (regmoden bit = 0) bit symbol description reset value 15:0 reloadn_l when unify = 0, read or write the 16-bit value to be loaded into the sctmatchn_l register. when unify = 1, read or write the lower 16 bits of the 32-bit value to be loaded into the matchn register. 0 31:16 reloadn_h when unify = 0, read or write the 16-bit to be loaded into the matchn_h register. when unify = 1, read or write the upper 16 bits of the 32-bit value to be loaded into the matchn register. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 608 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.22 sct capture control regi sters 0 to 15 (regmoden bit = 1) if unify = 1 in the config register, only the _l bits are used. if unify = 0 in the config regi ster, this register can be written to as two registers capctrln_l (address 0x4000 4100 to 0x4000 413c) and capctrln_h (address 0x4000 4102 to 0x4000 413e). both the l and h registers can be read or written in a single 32-bit read or write operation, or they can be read or written individually. each capture control register (l, h, or unified 32-bit) controls which events load the corresponding capture register from the counter. 24.6.23 sct event state mask registers 0 to 15 each event has one associated sct event state mask register that allow this event to happen in one or more stat es of the counter selected by the hevent bit in the corresponding evctrln register. an event n is disabled when its evstatemskn re gister contains all zeros, since it is masked regardless of the current state. in simple applications that don?t use states, writ e 0x01 to this register to enable an event. since the state will always remain at its reset value of 0, this effectively permanently state-enables this event. 24.6.24 sct event cont rol registers 0 to 15 this register defines the conditions for event n to occur, other than the state variable which is defined by the state mask register above. most events are associated with a particular counter (high, low, or unified), in which case the event can depend on a match to that register. the other possible ingredient of an event is a selected input or output signal. table 522. sct capture control registers 0 to 15 (capctrl- address 0x4000 0200 (capctrl0) to 0x4000 023c (capctrl15)) bit descri ption (regmoden bit = 1) bit symbol description reset value 15:0 capconn_l if bit m is one, event m causes the capn_l (unify = 0) or the capn (unify = 1) register to be loaded (event 0 = bit 0, event 1 = bit 1,..., event 15 = bit 15). 0 31:16 capconn_h if bit m is one, event m causes the capn_h (unify = 0) register to be loaded (event 0 = bit 16, event 1 = bit 17,..., event 15 = bit 31). 0 table 523. sct event state mask registers 0 to 15 (evstatemsk - addresses 0x4000 0300 (evstatemsk0) to 0x4000 0378 (evstatemsk15)) bit description bit symbol description reset value 31:0 statemskn if bit m is one, event n (n= 0 to 15) happens in state m of the counter selected by the hevent bi t (m = state number; state 0 = bit 0, state 1= bit 1,..., state 31 = bit 31). 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 609 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) when the unify bit is 0, each event is a ssociated with a particular counter by the hevent bit in its event control register. an event ca n not occur when its related counter is halted nor when the current state is not enab led to cause the event as specified in its event mask register. note that an event is permanently disabled when its event state mask register contains all 0s. an enabled event can be programmed to occur based on a selected input or output edge or level and/or based on its counter value matching a selected match register. each event can modify its counter?s state value. if more than one event associated with the same counter occurs in a given clock cycl e, only the state change specified for the highest-numbered event among them takes place. other actions dictated by any simultaneously occurring events will all take place. table 524. sct event control register 0 to 15 (evctrl - address 0x4000 0304 (evctrl0) to 0x4000 037c (evctrl15)) bit description bit symbol value description reset value 3:0 matchsel - selects the match register associated with this event (if any). a match can occur only when the counter selected by the hevent bit is running. 0 4 hevent select l/h counter. do not set this bit if unify = 1. 0 0 selects the l state and the l match register selected by matchsel. 1 selects the h state and the h match register selected by matchsel. 5 outsel input/output select 0 0 selects the output selected by iosel. 1 selects the input selected by iosel. 9:6 iosel - selects the input or output signal associat ed with this event (if any). if ckmode is 1x, the clock input is an implicit ingredient of every event, and should not be selected in this register. 0 11:10 iocond selects the i/o condition for event n. (note that the detection of edges on outputs will lag the conditions that switch the outputs by one sct clock). an input must have a minimum pulse width of at least one sct clock period in order to guarantee proper edge/state detection. 0 0x0 low 0x1 rise 0x2 fall 0x3 high 13:12 combmode selects how the specified match and i/o condition are used and combined. 0x0 or. the event occurs when either the specified match or i/o condition occurs. 0x1 match. uses the specified match only. 0x2 io. uses the specified i/o condition only. 0x3 and. the event occurs when the specified match and i/o condition occur simultaneously. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 610 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.6.25 sct output se t registers 0 to 15 each output n has one set register that cont rols how events effect each output. whether outputs are set or cleared depends on the setting of the setclrn field in the sctoutputdirctrl register. 24.6.26 sct output clear registers 0 to 15 each output n has one clear regi ster that controls how events effect each output. whether outputs are set or cleared depends on the setting of the setclrn field in the outputdirctrl register. 14 stateld this bit controls how the statev value modifies the state selected by hevent when this event is the highest-numbered event occurring for that state. 0 statev value is added into state (the carry-out is ignored). 1 statev value is loaded into state. 19:15 statev this value is loaded into or added to the state selected by hevent, depending on stateld, when this event is the highest-numbered event occurring for that state. if stateld and statev are both zero, there is no change to the state value. 31:20 - reserved table 524. sct event control register 0 to 15 (evctrl - address 0x4000 0304 (evctrl0) to 0x4000 037c (evctrl15)) bit description bit symbol value description reset value table 525. sct output set register 0 to 15 (outputset - address 0x4000 0500 (outputset0) to 0x4000 0578 (outputset15)) bit description bit symbol description reset value 15:0 set a 1 in bit m selects event m to set output n (or clear it if setclrn = 0x1 or 0x2) event 0 = bit 0, event 1 = bit 1,..., event 15 = bit 15. 0 31:16 - reserved table 526. sct output set register 0 to 15 (outputcl - address 0x4000 0504 (outputcl0) to 0x4000 057c (outputcl15)) bit description bit symbol description reset value 15:0 clr a 1 in bit m selects event m to clear output n (or set it if setclrn = 0x1 or 0x2) event 0 = bit 0, event 1 = bit 1,..., event 15 = bit 15. 0 31:16 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 611 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.7 functional description 24.7.1 match logic 24.7.2 capture logic 24.7.3 event selection state variable(s) allow control of the sct across more than one cycle of the counter. counter matches, input/output edges, and state values are combined into a set of general purpose events that can switch outputs, request interrupts, and change state values. fig 64. match logic = counter l match i h match reg i h match reload i h = match reg i l match reload i l match i l unify fig 65. capture logic sct clock www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 612 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.7.4 output generation figure 67 shows one output slice of the sct. 24.7.5 interrupt generation the sct generates one interrupt to the nvic. fig 66. event selection select event  i select matchseli inputs ioseli select statemaski combmodei iocondi outputs outseli heventi h state l state h matches l matches fig 67. output slice i set register i clear register i out reg select events output i nochangeconflict i oires setclri sct clock fig 68. sct interrupt generation enable register events flags register no change conflict events ut interrupt conflict enable register conflict flags register www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 613 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.7.6 clearing the prescaler when enabled by a non-zero pre field in the control register, the prescaler acts as a clock divider for the counter, like a fractional part of the counter value. the prescaler is cleared whenever the counter is cleared or loaded for any of the following reasons: ? hardware reset ? software writing to the counter register ? software writing a 1 to the clrctr bit in the control register ? an event selected by a 1 in the counter?s limit register when bidir = 0 when bidir is 0, a limit event caused by an i/o signal can clear a non-zero prescaler, but a limit event caused by a match will only clear a non-zero prescaler in one special case as described section 24.7.7 . a limit event when bidir is 1 does not clear th e prescaler. rather it clears the down bit in the control register, and decrements the counter on the same clock if the counter is enabled in that clock. 24.7.7 match vs. i/o events counter operation is complicated by the pre scaler, and by clock mo de 01 in which the sct clock is the bus clock, but the prescale r and counter are enabled to count only when a selected edge is detected on a clock input. ? the prescaler is enabled when the clock mode is not 01, or when the input edge selected by the clksel field is detected. ? the counter is enabled when the presca ler is enabled, and (prelim=0 or the prescaler is equal to the value in prelim). an i/o component of an event can occur in any sct clock when its counter?s halt bit is 0. in general a match component of an even t can only occur in a ut clock when its counter?s halt and stop bits are both 0 and the counter is enabled. table 527 shows when the various kinds of events can occur. table 527. event conditions combmode iomode event can occur on clock: io any event can occur whenever halt = 0 (type a). match any event can occur when halt = 0 and stop = 0 and the counter is enabled (type c). or any from the io component: event can occur whenever halt = 0 (a). from the match component: event can occur when halt = 0 and stop = 0 and the counter is enabled (c). and low or high event can occur when halt = 0 and stop = 0 and the counter is enabled (c). and rise or fall event can occur whenever halt = 0 (a). www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 614 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.7.8 dma operation a dma controller can be used to write one or more reload registers, or read one or more capture registers, typically at the start of a counter cycle. dma access to more than one reload or capture register requires that they be consecutive registers. (nothing else in the sct constrains how these re gisters are assigned and used.) a dma request can be set by an event or when a counter?s match registers are loaded from its reload registers, as described in section 24.6.14 . the sct?s two requests can be used to do the same kind of register access for both counters when unify is 0, or one request can be used for writing reload r egisters and the other for reading capture registers. the sct does not know how many transfers should be done for each request, so it cannot control its dma requests accordingly. the two dma requests are connected to dmabreq7 and dmabreq8. the number of registers to be transferred for each request should be written to the transfersize field in the channel control register of the dma channel to which the request is connected. if the linked list feature is used, there is a transfer size value in each linked list entry. the gpdma asserts the dmacclr signal when that number of transfers has been completed, which makes the sct clear the request. 24.7.9 alternate addressing for match/capture registers the match, reload, capture, and capture co ntrol registers are ar ranged as consecutive words, with the standard division of each word into two halfwords. when the unify bit is zero, these two halfwords are related to the l and h counters. software has the option of writing words initially to set up both halves of a sct simultaneously, or writing halfwords to set up each half separately. applications can use a dma controller to wr ite reload registers or to read capture registers. however, when unify is 0, the addressing of the halfword registers is not compatible with many dma co ntrollers? requirement to us e consecutive addresses for sequential-address operation. ta b l e 5 2 8 shows how the second half of the range occupied by each type of register contains an alternate address map for halfword accesses to the same registers, which is compatible with such dma controllers. when unify is 1, dma word accesses should be done using standard offsets. table 528. alternate address map for dma halfword access match register capture register standard offset dma halfword offset match0_l cap0_l 0x100 0x180 match0_h cap0_h 0x102 0x1c0 match1_l cap1_l 0x104 0x182 match1_h cap1_h 0x106 0x1c2 ... ... ... ... matchrel0_l capctrl0_l 0x200 0x280 matchrel0_h capctrl0_h 0x202 0x2c0 matchrel1_l capctrl1_l 0x204 0x282 matchrel1_h capctrl1_h 0x206 0x2c2 ... ... ... ... www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 615 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) 24.7.10 sct operation in its simplest, single-state configuration, the sct operates as an event controlled uni- or bidirectional counter. events can be configured to be counter match events, an input or output level, transitions on an input or ou tput pin, or a combination of match and input/output behavior. in response to an event, the sct?s output or outputs can transition or the sct can perform other actions such as cr eating an interrupt or starting, stopping, or resetting the counter. multiple simultaneous actions are allowed for each event. furthermore, one specific acti on of the sct can be triggered by any number of events. an event is defined uniquely by an action or mu ltiple actions of the sct. a state is defined by which events are enabled to trigger an sct action or actions in any stage of the counter. events not selected for this state are ignored. in a multi-state configuration, states change in response to events. a state change is an additional action that the sc t can perform when the event occurs. when an event is configured to change the state, the new state defines a new set of events resulting in different actions of the sct. through multip le cycles of the counter, events can change the state multiple times and thus create a larg e variety of event controlled transitions on the sct?s outputs and/or interrupts. once configured, the sct can run continuously without software intervention and can generate multiple output patterns entirely under the control of events. ? to configure the sct, see section 24.7.10.1 . ? to start, run, and stop the sct, see section 24.7.10.2 . ? to configure the sct without in using mult iple states as simple event controlled counter/timer, see section 24.7.10.3 . 24.7.10.1 configure the sct to set up the sct for multiple events and st ates perform the following configuration steps: 24.7.10.1.1 configure the counter 1. configure the l and h counters in the co nfig register by selecting two independent 16-bit counters (l counter and h counter) or one combined 32-bit counter in the unify field. 2. select the sct clock sour ce in the config register (fields clkmode and clksel) from any of the inputs or an internal clock. 24.7.10.1.2 configure the match and capture registers 1. select how many match and capture registers are needed by the application (total of up to 16): ? in the regmode register, select for each of the 16 match/capture register pairs whether the register is used as a ma tch register or capture register. 2. define match conditions for each match register selected: ? each match register match allows to set one match value if a 32-bit counter is used or two match values if the l and h 16-bit counters are used. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 616 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) ? each match reload register matchreload allows to set a rel oad value that is loaded into the match register when the counter reaches a limit condition or the value 0. 24.7.10.1.3 configure events and event responses 1. define when each event can occur in the following way in the evctrl registers (up to 16, one register per event): ? select whether the event occurs on an input or output changing, on an input or output level, a match condition of the counter, or a combination of match and input/output conditions in field combmode. ? for a match condition: select the match register that contains the match condition for the event to occur. enter the number of the selected match register in field matchsel. if using l and h counters, define whether the event occurs on matching the l or the h counter in field hevent. ? for an sct input or output level or transition: select the input number or the output number that is associated with this event in fields iosel and outsel. define how the selected input or output triggers the event (edge or level sensitive) in field iocond. 2. define what the effect of each event is on the sct?s outputs in the outputset or outputclr registers (up to 16 outputs, one register per output): ? for each sct output, select which events se t or clear this output. an output can be changed by more than one event, and each event can change multiple outputs. 3. define how each event affects the counter: ? set the corresponding event bit in the limit register for the event to set an upper limit for the counter. when a limit event occurs in unidirectional mode, the counter is cleared to zero and begins counting up on the next clock edge. when a limit event occurs in bidirectional mode, the counter begins to count down from the current value on the next clock edge. ? set the corresponding event bit in the halt register for the event to halt the counter. if the counter is halted, it stop s counting and no new events can occur. the counter operation can only be restored by clearing the halt_l and/or the halt_h bits in the ctrl register. ? set the corresponding event bit in the stop register for the event to stop the counter. if the counter is stopped, it stop s counting but can be restarted by an event that is configured as an transition on an input/output. ? set the corresponding event bit in the start register for the event to restart the counting. only events that are defined by an input changing can be used to restart the counter. 4. define which events contribute to the sct interrupt: ? set the corresponding event bit in the even and the evflag registers to enable the event to contribute to the sct interrupt. 5. define whether an event triggers a dma request. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 617 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) ? set the corresponding event bit in the dmareq0/1 registers for the event to trigger dma requests 0 or 1. 24.7.10.1.4 configure multiple states 1. in the evstatemask register for each event (up to 16 events, one register per event), select the state or states (up to 31) this event is allowed to occur in. each state can be selected for more than one event. 2. determine how the event affects the system?s state: in the evctrl registers (up to 16 events, one register per event), set the new state value in the statev field for this event. if the event is the highest numbered in the current state, this value is either added to the existing state value or replaces the existing state value, depending on the field stateld. remark: if there are higher numbered events in the current state, the state cannot be changed by this event. if the statev and stateld values are set to zero, the state does not change. 24.7.10.1.5 misce llaneous options ? there are a certain (selectable) number of capture registers. ea ch capture register can be programmed to capture the counter contents when one or more events occur. ? if the counter is in bidirectional mode, the ef fect of set and clear of an output can be made to depend on whether the counter is counting up or down by writing to the outputdirctrl register. ? 24.7.10.2 operate the sct 1. configure the sct (see section 24.7.10.1 ? configure the sct ? ). a. configure the counter (see section 24.7.10.1.1 ). b. configure the match and capture registers (see section 24.7.10.1.2 ). c. configure the events and event responses (see section 24.7.10.1.3 ). d. configure multiple states ( section 24.7.10.1.4 ). 2. write to the state register to define the in itial state. by default this is state 0. 3. to start the sct, write to the ctrl register: ? clear the counters. ? clear or set the stop_l and/or stop_h bits. remark: the counter starts counting once the stop bit is cleared as well. if the stop bit is set, the sct will wait instead for an event to occur that is configured to start the counter. ? for each counter select unidirectional or bidirectional counting mode (field bidir_l and/or bidir_h). ? select the prescale factor for the counter clock (ctrl register). ? clear the halt_l and/or halt_h bit. by default, the counters are halted and no events can occur. 4. to stop the counters by software at any time, stop or halt the counter (write to stop_l and/or stop_h bits or halt_l and/or halt_h bits in the ctrl register). www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 618 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) ? when the counters are stopped, both an ev ent configured to clear the stop bit or software writing a zero to the stop bit can start the counter again. ? when the counter are halted, only a software write to clear the halt bit can start the counter again. no events can occur. ? when the counters are halted, software can set any sct output high or low directly by writing to the out register. the current state can be read at any time by reading the state register. to change the current state by software (that is independently of any event occurring), set the halt bit and write to the state register to change the state value. writing to the state register is only allowed when the coun ter is halted (the halt_l and/or halt_h bits are set) and no events can occur. 24.7.10.3 configure the sct without using states the sct can be used as standard counter/timer with external capture inputs and match outputs without using the state logic. to op erate the sct without states, configure the sct as follows: ? write zero to the state register (this is the default). ? write zero to the stateld and statev fields in the evctrl registers for each event. ? write 0x1 to the evstatemask register of each event. this enables the event. in effect, the event is allowed to occur in a single state which never changes while the counter is running. 24.7.10.4 example figure 69 shows a simple application of the sct using two sets of match events (ev0/1 and ev3/4) to set/clear sct output 0. a third match event (ev2) is used to reset the counter regardless of the current state. in the initial state 0, match event ev0 causes the output 0 to be set to high and match event ev1 causes output 0 to be cleared. the sct input 0 is monitored: if the input transitions from high to low (ev2), the state is changed to state 1, and ev3/4 are enabled, which create the same output but tr iggered by different match values. if input 0 transitions from low to high, the associat ed event (ev5) causes the state to change back to state 0. in state 0, the events ev0 and ev1 are enabled. the example uses the following sct configuration: ? 1 input ? 1 output ? 5 match registers ? 7 events ? 2 states www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 619 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) this application of the sct uses the following configuration (all register values not listed in table 529 are set to their default values): fig 69. sct configuration example state 0 state 1 state 0 sct output 0 sct counter sc input 0 match events ev0 ev4 ev4 ev5 ev5 ev1 ev1 ev1 ev1 ev3 ev2 ev6 ev0 ev0 ev0 input transition events ev2 ev2 ev2 ev2 ev2 table 529. sct configuration example configuration register(s) setting counter config uses one counter (unify = 1). ctrl uses unidirectional counter (bidir_l = 0). clock base config uses default values for clock configuration. match/capture registers regmode configure one match register for each match event by setting regmode_l bits 0,1, 2, 4, 5 to 0. this is the default. define match values match0/1/2/4/5 set a match value match0/1/2/4/5_l in each register. define match reload values matchrel0/1/2/4/5 set a match reload value reload0/1/2/4/5_l in each register (same as the match value in this example). define when event 0 occurs evctrl0 ? set combmode = 0x1. event 0 uses match condition only. ? set matchsel = 0. select match value of match register 0. define when event 1 occurs evctrl1 ? set combmode = 0x1. event 1 uses match condition only. ? set matchsel = 1. select match value of match register 1. define when event 2 occurs evctrl2 ? set combmode = 0x1. event 2 uses match condition only. ? set matchsel = 2. select match value of match register 2. define when event 3 occurs evctrl3 ? set combmode = 0x2. event 3 uses i/o condition only. ? set iosel = 0. select input 0. ? set iocond = 0x2. input 0 goes low. define how event 3 changes the state evctrl3 set statev bits to 1 and the stated bit to 1. event 3 changes the state to state 1. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 620 of 1164 nxp semiconductors UM10430 chapter 24: lpc18xx state configurable timer (sct) define when event 4 occurs evctrl4 ? set combmode = 0x1. event 4 uses match condition only. ? set matchsel = 0x3. select match value of match register 4. define when event 5 occurs evctrl5 ? set combmode = 0x1. event 5 uses match condition only. ? set matchsel = 0x3. select match value of match register 5. define when event 6 occurs evctrl6 ? set combmode = 0x2. event 6 uses i/o condition only. ? set iosel = 0. select input 0. ? set iocond = 0x1. input 0 goes high. define how event 6 changes the state evctrl6 set statev bits to 0 and the stated bit to 1. event 6 changes the state to state 0. define by which events output 0 is set outputset0 set set0 bits 0 (for event 0) and 4 (for event 4) to one to set the output when these events 0 and 4 occur. define by which events output 0 is cleared outputclr0 set clr0 bits 1 (for events 1) and 5 (for event 5) to one to clear the output when events 1 and 5 occur. define which event resets the counter limit set limmask_l bit 2 to 1 (for ev ent 2 to limit the counter). set all other bits to zero. configure states event 0 is enabled evstatemsk0 set statemsk0 bit 0 to 1. set al l other bits to 0. event 0 is enabled in state 0. configure states event 1 is enabled evstatemsk1 set statemsk1 bit 0 to 1. set al l other bits to 0. event 1 is enabled in state 0. configure states event 2 is enabled evstatemsk2 set statemsk2 bit 0 to 1 and bit 1 to 1. set all other bits to 0. event 2 is enabled in state 0 and state 1. configure states event 3 is enabled evstatemsk3 set statemsk3 bit 0 to 1. set al l other bits to 0. event 3 is enabled in state 0. configure states event 4 is enabled evstatemsk4 set statemsk4 bit 1 to 1. set al l other bits to 0. event 4 is enabled in state 1. configure states event 5 is enabled evstatemsk5 set statemsk5 bit 1 to 1. set al l other bits to 0. event 5 is enabled in state 1. configure states event 6 is enabled evstatemsk6 set statemsk6 bit 1 to 1. set al l other bits to 0. event 6 is enabled in state 1. table 529. sct configuration example configuration register(s) setting www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 621 of 1164 25.1 how to read this chapter the timers are available on all lpc18xx parts. the following configuration options apply to parts lpc1850_30_20_10 rev ?a? only: ? the timer capture inputs and match outputs are configured through the gima (see section 14.3 ). ? all timer capture inputs are also connected to dedicated external pins (see section 14.3 and section 13.3.6 ). 25.2 basic configuration the timers are configured as follows: ? see ta b l e 5 3 0 for clocking and power control. ? the timer0/1/2/3 are reset by the timer0/1/2/3_rst (reset #32/33/34/35). ? the timer0/1/2/3 interrupts are connected to slot # 12/13/14/15 in the nvic. match channels 2 of timer0/1/3 are connected to slots # 13, 14, 16 in the event router. (these outputs are ored with sct outputs 2, 6, 14.) ? for connecting the match channels 0 and 1 of timer0/1/2/3 to the gpdma, use the dmamux register in the creg block (see ta b l e 3 5 ) and enable the gpdma channel in the dma channel configuration registers ( section 16.6.20 ). ? inputs to timer1/2/3 capture inputs are controlled by the creg6 register in the creg block (see ta b l e 3 7 ). ? the timer capture inputs and match outputs are configured through the gima (see section 14.3 ). ? all timer capture inputs are also connected to dedicated external pins (see section 14.3 and section 13.3.6 ). 25.3 features ? a 32 bit timer/counter with a programmable 32 bit prescaler. UM10430 chapter 25: lpc18xx timer0/1/2/3 rev. 00.13 ? 20 july 2011 user manual table 530. timer0/1/2/3 cl ocking and power control base clock branch clock maximum frequency clock to the timer0 register interface and timer0 peripheral clock pclk. base_m3_clk clk_m3_timer0 150 mhz clock to the timer1 register interface and timer1 peripheral clock pclk. base_m3_clk clk_m3_timer1 150 mhz clock to the timer2 register interface and timer2 peripheral clock pclk. base_m3_clk clk_m3_timer2 150 mhz clock to the timer3 register interface and timer3 peripheral clock pclk. base_m3_clk clk_m3_timer3 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 622 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 ? counter or timer operation ? up to four 32 bit capture channels per timer, that can take a snapshot of the timer value when an input signal transitions. a capture event may also optionally generate an interrupt. ? four 32 bit match registers that allow: ? continuous operation with optional interrupt generation on match. ? stop timer on match with optional interrupt generation. ? reset timer on match with optional interrupt generation. ? up to four external outputs corresponding to match registers, with the following capabilities: ? set low on match. ? set high on match. ? toggle on match. ? do nothing on match. 25.4 general description the timer/counter is designed to count cycles of the peripheral clock (pclk) or an externally-supplied clock, and can optionally generate interrupts or perform other actions at specified timer values, based on four match registers. it also includes four capture inputs to trap the timer value when an input si gnal transitions, optionally generating an interrupt. 25.5 pin description remark: the capture inputs are shared between four sct inputs and the timer inputs. the timer match outputs are ored with the sct outputs (see figure 24 ). table 531. timer0/1/2/ 3 pin description function name direction description timer0 ctin_[2:0] i cap0_[2:0]; capture inputs 2 to 0 of timer 0. ctout_[3:0] o mat0_[3:0]; match outputs 3:0 of timer 0 are ored with sct outputs 3 to 0. timer1 ctin_0 i cap1_0; capture input 0 of timer 1. ctin_3 i cap1_1; capture input 1 of timer 1. ctin_4 i cap1_2; capture input 2 of timer 1. ctout_[7:4] o mat1_[3:0]; match outputs 3:0 of timer 1 are ored with sct outputs 7 to 4. timer2 ctin_0 i cap2_0; capture input 0 of timer 2. ctin_1 i cap2_1; capture input 1 of timer 2. ctin_5 i cap2_2; capture input 2 of timer 2. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 623 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 table 532 gives a brief summary of each of the timer/counter related pins. 25.6 dma connections 25.7 register description each timer/counter contains the registers shown in table 533 . ctout_[11:8] o mat2_[3:0]; match outputs 3:0 of timer 2 are ored with sct outputs 11 to 8. timer3 ctin_0 i cap3_0; capture input 0 of timer 3. ctin_6 i cap3_1; capture input 1 of timer 3. ctin_7 i cap3_2; capture input 2 of timer 3. ctout_[15:12] o mat3_[3:0]; match outputs 3:0 of timer 3 are ored with sct outputs 15 to 12. table 532. timer/counter function description pin type description cap0_[3:0] cap1_[3:0] cap2_[3:0] cap3_[3:0] input capture signals- a transition on a capture pin can be configured to load one of the capture registers with the value in the timer counter and optionally generate an interrupt. capture functionality can be selected from a number of pins. timer/counter block can select a c apture signal as a clock source instead of the pclk derived clock . for more details see section 25.7.11 . mat0_[3:0] mat1_[3:0] mat2_[3:0] mat3_[3:0] output external match output - when a match register (mr3:0) equals the timer counter (tc) this output can either toggle, go low, go high, or do nothing. the external match register (emr) controls the functionality of this output. match output functionality can be selected on a number of pins in parallel. table 531. timer0/1/2/ 3 pin description function name direction description table 533. register overview: timer0/1/2/3 (register base addresses 0x4008 4000 (timer0), 0x4008 5000 (timer1), 0x400c 3000 (timer2), 0x400c 4000 (timer3)) name access address offset description reset value [1] ir r/w 0x000 interrupt register. the ir can be written to clear interrupts. the ir can be read to identify which of eight possible interrupt sources are pending. 0 tcr r/w 0x004 timer control register. the tcr is used to control the timer counter functions. the timer counter can be di sabled or reset through the tcr. 0 tc r/w 0x008 timer counter. the 32 bit tc is incremented every pr+1 cycles of pclk. the tc is controlled through the tcr. 0 pr r/w 0x00c prescale register. the prescale counter (below) is equal to this value, the next clock increments the tc and clears the pc. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 624 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 [1] reset value reflects the data stored in used bi ts only. it does not include reserved bits content. 25.7.1 timer interrupt registers the interrupt register consists of four bits for the match interrupts and four bits for the capture interrupts. if an interrupt is g enerated then the corresponding bit in the ir will be high. otherwise, the bit will be low. writing a logic one to the corres ponding ir bit will reset the interrupt. writing a zero has no effect. the act of clearing an interrupt for a timer match also clears any corresponding dma request. pc r/w 0x010 prescale counter. the 32 bit pc is a counter which is incremented to the value stored in pr. when the value in pr is reached, the tc is incremented and the pc is cleared. the pc is observable and controllable through the bus interface. 0 mcr r/w 0x014 match control register. the mcr is used to control if an interrupt is generated and if the tc is reset when a match occurs. 0 mr0 r/w 0x018 match register 0. mr0 can be enabled through the mcr to reset the tc, stop both the tc and pc, and/or generate an interrupt every time mr0 matches the tc. 0 mr1 r/w 0x01c match register 1. see mr0 description. 0 mr2 r/w 0x020 match register 2. see mr0 description. 0 mr3 r/w 0x024 match register 3. see mr0 description. 0 ccr r/w 0x028 capture control register. the ccr controls which edges of the capture inputs are used to load the capture registers and whether or not an interrupt is generated when a capture takes place. 0 cr0 ro 0x02c capture register 0. cr0 is loaded with the value of tc when there is an event on the capn.0(cap0.0 or cap1.0 respectively) input. 0 cr1 ro 0x030 capture register 1. see cr0 description. 0 cr2 ro 0x034 capture register 2. see cr0 description. 0 cr3 ro 0x038 capture register 3. see cr0 description. 0 emr r/w 0x03c external match register. the emr controls the external match pins matn.0-3 (mat0.0-3 and mat1.0-3 respectively). 0 ctcr r/w 0x070 count control register. the ctcr selects between timer and counter mode, and in counter mode selects the signal and edge(s) for counting. 0 table 533. register overview: timer0/1/2/3 (register base addresses 0x4008 4000 (timer0), 0x4008 5000 (timer1), 0x400c 3000 (timer2), 0x400c 4000 (timer3)) name access address offset description reset value [1] table 534. timer interrupt registers ir(i r - addresses 0x4008 4000 (timer0), 0x4008 5000 (timer1), 0x400c 3000 (timer3), 0x400c 4000 (timer4)) bit description bit symbol description reset value 0 mr0int interrupt flag for match channel 0. 0 1 mr1int interrupt flag for match channel 1. 0 2 mr2int interrupt flag for match channel 2. 0 3 mr3int interrupt flag for match channel 3. 0 4 cr0int interrupt flag for capture channel 0 event. 0 5 cr1int interrupt flag for capture channel 1 event. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 625 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 25.7.2 timer control registers the timer control register (tcr) is used to control the operation of the timer/counter. 25.7.3 timer counter registers the 32-bit timer counter register is increm ented when the prescale counter reaches its terminal count. unless it is reset before reaching its upper limit, the timer counter will count up through the value 0xffff ffff and then wrap back to the value 0x0000 0000. this event does not cause an interrupt, but a match register can be used to detect an overflow if needed. 25.7.4 timer prescale registers the 32-bit timer prescale register specifie s the maximum value for the prescale counter. 6 cr2int interrupt flag for capture channel 2 event. 0 7 cr3int interrupt flag for capture channel 3 event. 0 31:8 - reserved. - table 534. timer interrupt registers ir(i r - addresses 0x4008 4000 (timer0), 0x4008 5000 (timer1), 0x400c 3000 (timer3), 0x400c 4000 (timer4)) bit description bit symbol description reset value table 535. timer control register tcr (tcr - addresses 0x4008 4004 (timer0), 0x4008 5004 (timer1), 0x400c 3003 (timer2), 0x400c 4004 (timer3)) bit description bit symbol description reset value 0 cen when one, the timer counter and prescale counter are enabled for counting. when zero, the counters are disabled. 0 1 crst when one, the timer counter and the prescale counter are synchronously reset on the next positive edge of pclk. the counters remain reset until tcr[1] is returned to zero. 0 31:2 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 536. timer counter registers tc (tc - addresses 0x4008 4008 (timer0), 0x4008 5008 (timer1), 0x400c 3008 (timer2), 0x400c 4008 (timer3)) bit description bit symbol description reset value 31:0 tc timer counter value. 0 table 537. timer prescale registers pr (pr - addresses 0x4008 400c (timer0), 0x4008 500c (timer1), 0x400c 300c (timer2), 0x400c 400c (timer3)) bit description bit symbol description reset value 31:0 pm prescale counter maximum value. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 626 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 25.7.5 timer prescale counter registers the 32-bit prescale counter controls division of pclk by some constant value before it is applied to the timer counter. this allows control of the relationship of the resolution of the timer versus the maximum time before the timer overflows. the prescale counter is incremented on every pclk. when it reaches the value stored in the prescale register, the timer counter is incremented and the prescale counter is reset on the next pclk. this causes the timer counter to increment on every pclk when pr = 0, every 2 pclks when pr = 1, etc. 25.7.6 timer match control registers the match control register is used to contro l what operations are performed when one of the match registers matches the timer counter. the function of each of the bits is shown in table 539 . table 538. timer prescale counter registers pc(pc - addresses 0x4008 4010 (timer0), 0x4008 5010 (timer1), 0x400c 3010 (timer2), 0x400c 4010 (timer3)) bit description bit symbol description reset value 31:0 pc prescale counter value. 0 table 539. timer match control registers mcr (mcr - addresses 0x4008 4014 (timer0), 0x4008 5014 (timer1), 0x400c 3014 (timer2), 0x400c 4014 (timer3)) bit description bit symbol value description reset value 0 mr0i interrupt on mr0 0 1 interrupt is generated when mr0 matches the value in the tc. 0 interrupt is disabled 1 mr0r reset on mr0 0 1 tc will be reset if mr0 matches it. 0 feature disabled. 2 mr0s 1 stop on mr0 0 1 tc and pc will be st opped and tcr[0] will be set to 0 if mr0 matches the tc. 0 feature disabled. 3 mr1i interrupt on mr1 0 1 interrupt is generated when mr1 matches the value in the tc. 0 interrupt is disabled. 4 mr1r reset on mr1 0 1 tc will be reset if mr1 matches it. 0 feature disabled. 5 mr1s stop on mr1 0 1 tc and pc will be st opped and tcr[0] will be set to 0 if mr1 matches the tc. 0 feature disabled. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 627 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 25.7.7 timer match registers (mr0 - mr3) the match register values are continuously compared to the timer counter value. when the two values are equal, acti ons can be triggere d automatically. the action possibilities are to generate an interrupt, reset the timer counter, or stop the timer. actions are controlled by the settings in the mcr register. 6 mr2i interrupt on mr2 0 1 interrupt is generated when mr2 matches the value in the tc. 0 interrupt is disabled 7 mr2r reset on mr2 0 1 tc will be reset if mr2 matches it. 0 feature disabled. 8 mr2s stop on mr2. 0 1 tc and pc will be st opped and tcr[0] will be set to 0 if mr2 matches the tc 0 feature disabled. 9 mr3i interrupt on mr3 0 1 interrupt is generated when mr3 matches the value in the tc. 0 this interrupt is disabled 10 mr3r reset on mr3 0 1 tc will be reset if mr3 matches it. 0 feature disabled. 11 mr3s stop on mr3 0 1 tc and pc will be st opped and tcr[0] will be set to 0 if mr3 matches the tc. 0 feature disabled. 31:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 539. timer match control registers mcr (mcr - addresses 0x4008 4014 (timer0), 0x4008 5014 (timer1), 0x400c 3014 (timer2), 0x400c 4014 (timer3)) bit description ?continued bit symbol value description reset value table 540. timer match registers mr0 to 3 (mr, addresses 0x4008 4018 (mr0) to 0x4008 4024 (m3) (timer0), 0x4008 5018 (mr0) to 0x4008 5024 (mr3)(timer1), 0x400c 3018 (mr0) to 0x400c 8024 (mr3) (timer2), 0x400c 4018 (mr0) to 0x400c 4024 (mr3)(timer3 )) bit description bit symbol description reset value 31:0 match timer counter match value. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 628 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 25.7.8 timer capture control registers the capture control register is used to cont rol whether one of the four capture registers is loaded with the value in the timer counter when the capture event occurs, and whether an interrupt is g enerated by the capture event. setting bo th the rising and falling bits at the same time is a valid configuration, resulting in a capture event for both edges. in the description below, n represents the timer number. remark: if counter mode is selected for a partic ular cap input in the ctcr, the 3 bits for that input in this register should be program med as 000, but capture and/or interrupt can be selected for the other 3 cap inputs. table 541. timer capture control registers (ccr - addresses 0x4008 4028 (timer0), 0x4008 5020 (timer1), 0x400c 3028 (timer2), 0x400c 4028 (timer3)) bit description bit symbol value description reset value 0 cap0re capture on capn.0 rising edge 0 1 a sequence of 0 then 1 on capn.0 will cause cr0 to be loaded with the contents of tc. 0 this feature is disabled. 1 cap0fe capture on capn.0 falling edge 0 1 a sequence of 1 then 0 on capn.0 will cause cr0 to be loaded with the contents of tc. 0 this feature is disabled. 2 cap0i interrupt on capn.0 event 0 1 a cr0 load due to a capn.0 event will generat e an interrupt. 0 this feature is disabled. 3 cap1re capture on capn.1 rising edge 0 1 a sequence of 0 then 1 on capn.1 will cause cr1 to be loaded with the contents of tc. 0 this feature is disabled. 4 cap1fe capture on capn.1 falling edge 0 1 a sequence of 1 then 0 on capn.1 will cause cr1 to be loaded with the contents of tc. 0 this feature is disabled. 5 cap1i interrupt on capn.1 event 0 1 a cr1 load due to a capn.1 event will generat e an interrupt. 0 this feature is disabled. 6 cap2re capture on capn.2 rising edge 0 1 a sequence of 0 then 1 on capn.2 will cause cr2 to be loaded with the contents of tc. 0 this feature is disabled. 7 cap2fe capture on capn.2 falling edge: 0 1 a sequence of 1 then 0 on capn.2 will cause cr2 to be loaded with the contents of tc. 0 this feature is disabled. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 629 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 25.7.9 timer capture registers (cr0 - cr3) each capture register is associated with a device pin and may be loaded with the timer counter value when a specified event occurs on that pin. the settings in the capture control register register determine whether the capture function is enabled, and whether a capture event happens on the rising edge of the associated pin, the falling edge, or on both edges. 25.7.10 timer external match registers the external match register provides both co ntrol and status of the external match pins. in the descriptions below, ?n? represents the timer number, 0 or 1, and ?m? represent a match number, 0 through 3. match events for match 0 and match 1 in each timer can cause a dma request, see section 25.7.12 . 8 cap2i interrupt on capn.2 event 0 1 a cr2 load due to a capn.2 event will generat e an interrupt. 0 this feature is disabled. 9 cap3re capture on capn.3 rising edge 0 1 a sequence of 0 then 1 on capn.3 will cause cr3 to be loaded with the contents of tc. 0 this feature is disabled. 10 cap3fe capture on capn.3 falling edge 0 1 a sequence of 1 then 0 on capn.3 will cause cr3 to be loaded with the contents of tc. 0 this feature is disabled. 11 cap3i interrupt on capn.3 event: 0 1 a cr3 load due to a capn.3 event will generat e an interrupt. 0 this feature is disabled. 31:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 541. timer capture control registers (ccr - addresses 0x4008 4028 (timer0), 0x4008 5020 (timer1), 0x400c 3028 (timer2), 0x400c 4028 (timer3)) bit description ?continued bit symbol value description reset value table 542. timer capture registers cr0 to 3 (cr, address 0x4008 402c (cr0) to 0x4008 4038 (cr3) (timer0), 0x4008 502c (cr0) to 0x4008 5038 (cr3) (timer1), 0x400c 302c (cr0) to 0x400c 3038 (cr3) (timer2), 0x400c 402c (cr0) to 0x400c 4038 (cr3) (timer3)) bit description bit symbol description reset value 31:0 cap timer counter capture value. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 630 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 table 543. timer external match registers (emr - addresses 0x4008 403c (timer0), 0x4008 503c (timer1), 0x400c 303c (timer2), 0x400c 403c (timer3)) bit description bit symbol value description reset value 0 em0 external match 0. when a match occurs between the tc and mr0, this bit can either toggle, go low, go high, or do nothing, depending on bits 5:4 of this register. this bit can be driven onto a matn.0 pin, in a positive-logic manner (0 = low, 1 = high). 0 1 em1 external match 1. when a match occurs between the tc and mr1, this bit can either toggle, go low, go high, or do nothing, depending on bits 7:6 of this register. this bit can be driven onto a matn.1 pin, in a positive-logic manner (0 = low, 1 = high). 0 2 em2 external match 2. when a match occurs between the tc and mr2, this bit can either toggle, go low, go high, or do nothing, depending on bits 9:8 of this register. this bit can be driven onto a matn.0 pin, in a positive-logic manner (0 = low, 1 = high). 0 3 em3 external match 3. when a match occurs between the tc and mr3, this bit can either toggle, go low, go high, or do nothing, depending on bits 11:10 of this register. this bit can be driven onto a matn.0 pin, in a positive-logic manner (0 = low, 1 = high). 0 5:4 emc0 external match control 0. determines the functionality of external match 0. 00 0x0 do nothing. 0x1 clear the corresponding external match bit/output to 0 (matn.m pin is low if pinned out). 0x2 set the corresponding external match bit/output to 1 (matn.m pin is high if pinned out). 0x3 toggle the corresponding external match bit/output. 7:6 emc1 external match control 1. determines the functionality of external match 1. 00 0x0 do nothing. 0x1 clear the corresponding external match bit/output to 0 (matn.m pin is low if pinned out). 0x2 set the corresponding external match bit/output to 1 (matn.m pin is high if pinned out). 0x3 toggle the corresponding external match bit/output. 9:8 emc2 external match control 2. determines the functionality of external match 2. 00 0x0 do nothing. 0x1 clear the corresponding external match bit/output to 0 (matn.m pin is low if pinned out). 0x2 set the corresponding external match bit/output to 1 (matn.m pin is high if pinned out). 0x3 toggle the corresponding external match bit/output. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 631 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 25.7.11 timer count control registers the count control register (ctcr) is used to select between timer and counter mode, and in counter mode to select the pin and edge(s) for counting. when counter mode is chosen as a mode of operation, the cap input (selected by the ctcr bits 3:2) is sampled on every rising edge of the pclk clock. after comparing two consecutive samples of this cap input, one of the following four events is recognized: rising edge, falling edge, either of edges or no changes in th e level of the selected cap input. only if the identified event correspond s to the one selected by bits 1:0 in the ctcr register, the timer counter register will be incremented. effective processing of the externally supplie d clock to the counter has some limitations. since two successive rising edges of the pclk clock are used to identify only one edge on the cap selected input, the frequency of the cap input can not exceed one quarter of the pclk clock. consequently, duration of th e high/low levels on the same cap input in this case can not be shorter than 1/(2 pclk). 11:10 emc3 external match control 3. determines the functionality of external match 3. 00 0x0 do nothing. 0x1 clear the corresponding external match bit/output to 0 (matn.m pin is low if pinned out). 0x2 set the corresponding external match bit/output to 1 (matn.m pin is high if pinned out). 0x3 toggle the corresponding external match bit/output. 15:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 544. external match control emr[11:10], emr[9:8], emr[7:6], or emr[5:4] function 00 do nothing. 01 clear the corresponding external match bit/output to 0 (matn.m pin is low if pinned out). 10 set the corresponding external match bit/output to 1 (matn.m pin is high if pinned out). 11 toggle the corresponding external match bit/output. table 543. timer external match registers (emr - addresses 0x4008 403c (timer0), 0x4008 503c (timer1), 0x400c 303c (timer2), 0x400c 403c (timer3)) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 632 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 25.7.12 dma operation dma requests are generated by 0 to 1 transitions of the external match 0 and 1 bits of each timer. in order to have an effect, the gpdma must be configured and the relevant timer dma request selected as a dm a source via the creg block, see table 35 . when a timer is initially set up to generate a dma request, the request may already be asserted before a match condition occurs. an initial dma request may be avoided by having software by write a one to the interrupt flag location, as if clearing a timer interrupt. see section 25.7.1 . a dma request will be cleared automati cally when it is acted upon by the gpdma controller. table 545. timer count control register ctcr(ctcr - addresses 0x4008 4070 (timer0), 0x4008 5070 (timer1), 0x400c 3070 (timer2), 0x400c 4070 (timer3)) bit description bit symbol value description reset value 1:0 ctmode counter/timer mode this field selects which rising pclk edges can increment timer?s prescale counter (pc), or clear pc and increment timer counter (tc). timer mode: the tc is incremented when the prescale counter matches the prescale register. 00 0x0 timer mode: every rising pclk edge 0x1 counter mode: tc is incremented on rising edges on the cap input selected by bits 3:2. 0x2 counter mode: tc is incremented on falling edges on the cap input selected by bits 3:2. 0x3 counter mode: tc is incremented on both edges on the cap input selected by bits 3:2. 3:2 cinsel count input select when bits 1:0 in this register are not 00, these bits select which cap pin is sampled for clocking: 00 0x0 capn.0 for timern 0x1 capn.1 for timern 0x2 capn.2 for timern 0x3 capn.3 for timern note: if counter mode is selected for a particular capn input in the tnctcr, the 3 bits for that input in the capture control register (tnccr) must be programmed as 000. however, capture and/or interrupt can be selected for the other 3 capn inputs in the same timer. 31:4 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 633 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 25.8 example timer operation figure 70 shows a timer configured to reset the count and generate an interrupt on match. the prescaler is set to 2 and the match register set to 6. at the end of the timer cycle where the match occurs, the timer count is re set. this gives a full length cycle to the match value. the interrupt indicating that a ma tch occurred is generated in the next clock after the timer reached the match value. figure 71 shows a timer configured to stop and generate an interrupt on match. the prescaler is again set to 2 and the match register set to 6. in the next clock after the timer reaches the match value, the timer enable bit in tcr is cleare d, and the interrupt indicating that a match occurred is generated. 25.9 architecture the block diagram for timer/counter0 and timer/counter1 is shown in figure 72 . fig 70. a timer cycle in which pr =2, mrx=6, and both interrupt and reset on match are enabled. pclk prescale counter interrupt timer counter timer counter reset 2 2 2 2000 0 1111 45 6 0 1 fig 71. a timer cycle in which pr=2, mrx=6, and both interrupt and stop on match are enabled pclk prescale counter interrupt timer counter tcr[0] (counter enable) 2 20 0 1 45 6 1 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 634 of 1164 nxp semiconductors UM10430 chapter 25: lpc18xx timer0/1/2/3 fig 72. timer block diagram reset maxval timer control register prescale register prescale counter pclk enable capture register 3 capture register 2 capture register 1 capture register 0 match register 3 match register 2 match register 1 match register 0 capture control register control timer counter csn tci ce = = = = interrupt register external match register match control register mat[3:0] interrupt cap[3:0] stop on match reset on match load[3:0] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 635 of 1164 26.1 how to read this chapter the motor control pwm is ava ilable on all lpc18xx parts. 26.2 basic configuration the pwm is configured as follows: ? see ta b l e 5 4 6 for clocking and power control. ? the pwm is reset by the motoconpwm_rst (reset #38). ? the pwm interrupt is connected to slot # 16 in the nvic. 26.3 introduction the motor control pwm (mcpwm) is optimized for three-phase ac and dc motor control applications, but can be used in many othe r applications that need timing, counting, capture, and comparison. 26.4 features the mcpwm contains three independent channels, each including: ? a 32-bit timer/counter (tc) ? a 32-bit limit register (lim) ? a 32-bit match register (mat) ? a 10-bit dead-time register (dt) and an associated 10-bit dead-time counter ? a 32-bit capture register (cap) ? two modulated outputs (mcoa and mcob) with opposite polarities ? a period interrupt, a pulse-width interrupt, and a capture interrupt input pins mci0-2 can trigger tc capture or increment a channel?s tc. a global abort input can force all of the channels into ?a passive? state and cause an interrupt. 26.5 general description section 26.8 includes detailed descriptions of t he various modes of mcpwm operation, but a quick preview here will provide backgro und for the r egister descriptions below. UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) rev. 00.13 ? 20 july 2011 user manual table 546. pwm clocking and power control base clock branch clock maximum frequency clock to the pwm motor control block and pwm motocon peripheral clock. base_apb1_ clk clk_apb1_ motocon 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 636 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) the mcpwm includes 3 channels, each of which co ntrols a pair of outputs that in turn can control something off-chip, like one set of coils in a motor. each channel includes a timer/counter (tc) register th at is incremented by a processor clock (timer mode) or by an input pin (counter mode). each channel has a limit register that is compared to the tc value, and when a match occurs the tc is ?recycled? in one of two ways. in ?edge-aligned mode? the tc is reset to 0, while in ?centered mode? a ma tch switches the tc into a st ate in which it decrements on each processor clock or input pin transition until it reaches 0, at which time it starts counting up again. each channel also includes a match register that holds a smaller value than the limit register. in edge-aligned mode the channel? s outputs are switched whenever the tc matches either the match or limit register, wh ile in center-aligned mode they are switched only when it matches the match register. so the limit register controls the period of th e outputs, while the match register controls how much of each period the outputs spend in each state. having a small value in the limit register minimizes ?ripple? if the output is integrated into a voltage, and allows the mcpwm to control devices that operate at high speed. the ?downside? of small values in the limit re gister is that they reduce the resolution of the duty cycle controlled by the match register . if you have 8 in the limit register, the match register can only select the duty cycl e among 0%, 12.5%, 25%, ?, 87.5%, or 100%. in general, the resolution of each step in the match value is 1 divided by the limit value. this trade-off between resolution and period/frequency is inherent in the design of pulse width modulators. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 637 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.5.1 block diagram 26.6 pin description table 547 lists the mcpwm pins. fig 73. mcpwm block diagram clock selection pclk mci0-2 clock selection clock selection tc0 event selection tc1 event selection tc2 event selection mccntcon mccapcon = mat0 (oper) mat0 (write) lim0 (oper) lim0 (write) = cap0 channel output control dead-time counter dt0 a0 b0 mccon rt0 cntl = mat1 (oper) mat1 (write) lim1 (oper) lim1 (write) = cap1 channel output control dead-time counter dt1 a1 b1 mccon rt1 mat2 (oper) mat2 (write) lim2 (oper) lim2 (write) global output control mccon mccp mcabort mcoa0 mcob0 mcoa1 mcob1 mcoa2 mcob2 mux acmode cntl cntl = = cap2 channel output control dead-time counter dt2 a2 b2 mccon rt2 mux acmode interrupt logic mcabort mcinten mcintf mux mux acmode acmode www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 638 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7 register description ?control? registers and ?interrupt? registers ha ve separate re ad, set, and clear addresses. reading such a register?s read address (e.g. mc con) yields the state of the register bits. writing ones to the set address (e.g. mccon_set) sets register bit(s), and writing ones to the clear address (e.g. mccon_clr) clears register bit(s). the capture registers (mccap) are read-onl y, and the write-only mccap_clr address can be used to clear one or more of th em. all the other mcpwm registers (mctim, mcper, mcpw, mcdeadtime, and mccp) are normal read-write registers. table 547. pin summary pin type description mcoa0/1/2 o output a for channels 0, 1, 2 mcob0/1/2 o output b for channels 0, 1, 2 mcabort i low-active fast abort mci0/1/2 i input for channels 0, 1, 2 table 548. register overview: motor control pulse width modulator (mcpwm) (base address 0x400a 0000) name access address offset description reset value con ro 0x000 pwm control read address 0 con_set wo 0x004 pwm control set address - con_clr wo 0x008 pwm control clear address - capcon ro 0x00c capture control read address 0 capcon_set wo 0x010 capture control set address - capcon_clr wo 0x014 event control clear address - tc0 r/w 0x018 timer counter register, channel 0 0 tc1 r/w 0x01c timer counter register, channel 1 0 tc2 r/w 0x020 timer counter register, channel 2 0 lim0 r/w 0x024 limit register, channel 0 0xffff ffff lim1 r/w 0x028 limit register, channel 1 0xffff ffff lim2 r/w 0x02c limit register, channel 2 0xffff ffff mat0 r/w 0x030 match register, channel 0 0xffff ffff mat1 r/w 0x034 match register, channel 1 0xffff ffff mat2 r/w 0x038 match register, channel 2 0xffff ffff dt r/w 0x03c dead time register 0x3fff ffff mccp r/w 0x040 communication pattern register 0 cap0 ro 0x044 capture register, channel 0 0 cap1 ro 0x048 capture register, channel 1 0 cap2 ro 0x04c capture register, channel 2 0 inten ro 0x050 interrupt enable read address 0 inten_set wo 0x054 interrupt enable set address - inten_clr wo 0x058 interrupt enable clear address - cntcon ro 0x05c count control read address 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 639 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.1 mcpwm control register 26.7.1.1 mcpwm control read address the con register controls the operation of all channels of the pwm. this address is read-only, but the underlying register can be modified by writing to addresses con_set and con_clr. cntcon_set wo 0x060 count control set address - cntcon_clr wo 0x064 count control clear address - intf ro 0x068 interrupt flags read address 0 intf_set wo 0x06c interrupt flags set address - intf_clr wo 0x070 interrupt flags clear address - cap_clr wo 0x074 capture clear address - table 548. register overview: motor control pulse width modulator (mcpwm) (base address 0x400a 0000) name access address offset description reset value table 549. mcpwm control read address (con - 0x400a 0000) bit description bit symbol value description reset value 0 run0 stops/starts timer channel 0. 0 0stop. 1run. 1 center0 edge/center aligned operation for channel 0. 0 0 edge-aligned. 1 center-aligned. 2 pola0 selects polarity of the mcoa0 and mcob0 pins. 0 0 passive state is low, active state is high. 1 passive state is high, active state is low. 3 dte0 controls the dead-time feature for channel 0. 0 0 dead-time disabled. 1 dead-time enabled. 4 disup0 enable/disable updates of functional registers for channel 0 (see section 26.8.2 ). 0 0 functional registers are updated from the write registers at the end of each pwm cycle. 1 functional registers remain the same as long as the timer is running. 7:5 - - reserved. 8 run1 stops/starts timer channel 1. 0 0stop. 1run. 9 center1 edge/center aligned operation for channel 1. 0 0 edge-aligned. 1 center-aligned. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 640 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 10 pola1 selects polarity of the mcoa1 and mcob1 pins. 0 0 passive state is low, active state is high. 1 passive state is high, active state is low. 11 dte1 controls the dead-time feature for channel 1. 0 0 dead-time disabled. 1 dead-time enabled. 12 disup1 enable/disable updates of functional registers for channel 1 (see section 26.8.2 ). 0 0 functional registers are updated from the write registers at the end of each pwm cycle. 1 functional registers remain the same as long as the timer is running. 15:13 - - reserved. 0 16 run2 stops/starts timer channel 2. 0 0stop. 1run. 17 center2 edge/center aligned operation for channel 2. 0 0 edge-aligned. 1 center-aligned. 18 pola2 selects polarity of the mcoa2 and mcob2 pins. 0 0 passive state is low, active state is high. 1 passive state is high, active state is low. 19 dte2 controls the dead-time feature for channel 1. 0 0 dead-time disabled. 1 dead-time enabled. 20 disup2 enable/disable updates of functional registers for channel 2 (see section 26.8.2 ). 0 0 functional registers are updated from the write registers at the end of each pwm cycle. 1 functional registers remain the same as long as the timer is running. 28:21 - - reserved. 29 invbdc controls the polarity of the mcob outputs for all 3 channels. this bit is typically set to 1 only in 3-phase dc mode. 0 the mcob outputs have opposite polarity from the mcoa outputs (aside from dead time). 1 the mcob outputs have the same basic polarity as the mcoa outputs. (see section 26.8.6 ) 30 acmode 3-phase ac mode select (see section 26.8.7 ). 0 0 3-phase ac-mode off: each pwm channel uses its own timer-counter and period register. 1 3-phase ac-mode on: all pwm channels use the timer-counter and period register of channel 0. table 549. mcpwm control read address (con - 0x400a 0000) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 641 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.1.2 mcpwm control set address writing ones to this write-only address sets the corresponding bits in mccon. 26.7.1.3 mcpwm control clear address writing ones to this write-only address clears the corresponding bits in con. 31 dcmode 3-phase dc mode select (see section 26.8.6 ). 0 0 3-phase dc mode off: pwm channels are independent (unless bit acmode = 1) 1 3-phase dc mode on: the internal mcoa0 output is routed through the cp register (i.e. a mask) register to all six pwm outputs. table 549. mcpwm control read address (con - 0x400a 0000) bit description bit symbol value description reset value table 550. mcpwm control set address (con_set - 0x400a 0004) bit description bit symbol description reset value 0 run0_set writing a one sets the corresponding bit in the con register. - 1 center0_set writing a one sets the corresponding bit in the con register. - 2 pola0_set writing a one sets the corresponding bit in the con register. - 3 dte0_set writing a one sets the corresponding bit in the con register. - 4 disup0_set writing a one sets the corresponding bit in the con register. - 7:5 - writing a one sets the corresponding bit in the con register. - 8 run1_set writing a one sets the corresponding bit in the con register. - 9 center1_set writing a one sets the corresponding bit in the con register. - 10 pola1_set writing a one sets the corresponding bit in the con register. - 11 dte1_set writing a one sets the corresponding bit in the con register. - 12 disup1_set writing a one sets the corresponding bit in the con register. - 15:13 - writing a one sets the corresponding bit in the con register. - 16 run2_set writing a one sets the corresponding bit in the con register. - 17 center2_set writing a one sets the corresponding bit in the con register. - 18 pola2_set writing a one sets the corresponding bit in the con register. - 19 dte2_set writing a one sets the corresponding bit in the con register. - 20 disup2_set writing a one sets the corresponding bit in the con register. - 28:21 - writing a one sets the corresponding bit in the con register. - 29 invbdc_set writing a one sets the corresponding bit in the con register. - 30 acmode_set writing a one sets the corresponding bit in the con register. - 31 dcmode_set writing a one sets the corresponding bit in the con register. - table 551. mcpwm control clear address (con_clr - 0x400a 0008) bit description bit symbol description reset value 0 run0_clr writing a one clears the corresponding bit in the con register. - 1 center0_clr writing a one clears the corresponding bit in the con register. - 2 pola0_clr writing a one clears the corresponding bit in the con register. - 3 dte0_clr writing a one clears the corresponding bit in the con register. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 642 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.2 pwm capture control register 26.7.2.1 mcpwm capture control read address the mccapcon register controls detection of events on the mci0-2 inputs for all mcpwm channels. any of the three mci inputs can be used to trigger a capture event on any or all of the three channels. this address is read-only, but the underlying register can be modified by writing to addresses capcon_set and capcon_clr. 4 disup0_clr writing a one clears the corresponding bit in the con register. - 7:5 - writing a one clears the corresponding bit in the con register. - 8 run1_clr writing a one clears the corresponding bit in the con register. - 9 center1_clr writing a one clears the corresponding bit in the con register. - 10 pola1_clr writing a one clears the corresponding bit in the con register. - 11 dte1_clr writing a one clears the corresponding bit in the con register. - 12 disup1_clr writing a one clears the corresponding bit in the con register. - 15:1 3 - writing a one clears the corresponding bit in the con register. - 16 run2_clr writing a one clears the corresponding bit in the con register. - 17 center2_clr writing a one clears the corresponding bit in the con register. - 18 pola2_clr writing a one clears the corresponding bit in the con register. - 19 dte2_clr writing a one clears the corresponding bit in the con register. - 20 disup2_clr writing a one clears the corresponding bit in the con register. - 28:2 1 - writing a one clears the corresponding bit in the con register. - 29 invbdc_clr writing a one clears the corresponding bit in the con register. - 30 acmod_clr writing a one clears the corresponding bit in the con register. - 31 dcmode_clr writing a one clears the corresponding bit in the con register. table 551. mcpwm control clear address (con_clr - 0x400a 0008) bit description bit symbol description reset value table 552. mcpwm capture control read address (capcon - 0x400a 000c) bit description bit symbol description reset value 0 cap0mci0_re a 1 in this bit enables a channel 0 capture event on a rising edge on mci0. 0 1 cap0mci0_fe a 1 in this bit enables a channel 0 capture event on a falling edge on mci0. 0 2 cap0mci1_re a 1 in this bit enables a channel 0 capture event on a rising edge on mci1. 0 3 cap0mci1_fe a 1 in this bit enables a channel 0 capture event on a falling edge on mci1. 0 4 cap0mci2_re a 1 in this bit enables a channel 0 capture event on a rising edge on mci2. 0 5 cap0mci2_fe a 1 in this bit enables a channel 0 capture event on a falling edge on mci2. 0 6 cap1mci0_re a 1 in this bit enables a channel 1 capture event on a rising edge on mci0. 0 7 cap1mci0_fe a 1 in this bit enables a channel 1 capture event on a falling edge on mci0. 0 8 cap1mci1_re a 1 in this bit enables a channel 1 capture event on a rising edge on mci1. 0 9 cap1mci1_fe a 1 in this bit enables a channel 1 capture event on a falling edge on mci1. 0 10 cap1mci2_re a 1 in this bit enables a channel 1 capture event on a rising edge on mci2. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 643 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.2.2 mcpwm capture control set address writing ones to this write-only address sets the corresponding bits in capcon. 11 cap1mci2_fe a 1 in this bit enables a channel 1 capture event on a falling edge on mci2. 0 12 cap2mci0_re a 1 in this bit enables a channel 2 capture event on a rising edge on mci0. 0 13 cap2mci0_fe a 1 in this bit enables a channel 2 capture event on a falling edge on mci0. 0 14 cap2mci1_re a 1 in this bit enables a channel 2 capture event on a rising edge on mci1. 0 15 cap2mci1_fe a 1 in this bit enables a channel 2 capture event on a falling edge on mci1. 0 16 cap2mci2_re a 1 in this bit enables a channel 2 capture event on a rising edge on mci2. 0 17 cap2mci2_fe a 1 in this bit enables a channel 2 capture event on a falling edge on mci2. 0 18 rt0 if this bit is 1, tc0 is reset by a channel 0 capture event. 0 19 rt1 if this bit is 1, tc1 is reset by a channel 1 capture event. 0 20 rt2 if this bit is 1, tc2 is reset by a channel 2 capture event. 0 21 hnfcap0 hardware noise filter: if this bit is 1, channel 0 capture events are delayed as described in section 26.8.4 . 0 22 hnfcap1 hardware noise filter: if this bit is 1, channel 1 capture events are delayed as described in section 26.8.4 . 0 23 hnfcap2 hardware noise filter: if this bit is 1, channel 2 capture events are delayed as described in section 26.8.4 . 0 31:24 - reserved. - table 552. mcpwm capture control read address (capcon - 0x400a 000c) bit description bit symbol description reset value table 553. mcpwm capture control set address (capcon_set - 0x400a 0010) bit description bit symbol description reset value 0 cap0mci0_re_set writing a one sets the corresponding bits in the capcon register. - 1 cap0mci0_fe_set writing a one sets the corresponding bits in the capcon register. - 2 cap0mci1_re_set writing a one sets the corresponding bits in the capcon register. - 3 cap0mci1_fe_set writing a one sets the corresponding bits in the capcon register. - 4 cap0mci2_re_set writing a one sets the corresponding bits in the capcon register. - 5 cap0mci2_fe_set writing a one sets the corresponding bits in the capcon register. - 6 cap1mci0_re_set writing a one sets the corresponding bits in the capcon register. - 7 cap1mci0_fe_set writing a one sets the corresponding bits in the capcon register. - 8 cap1mci1_re_set writing a one sets the corresponding bits in the capcon register. - 9 cap1mci1_fe_set writing a one sets the corresponding bits in the capcon register. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 644 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.2.3 mcpwm capture control clear address writing ones to this write-only address clears the corresponding bits in mccapcon. 10 cap1mci2_re_set writing a one sets the corresponding bits in the capcon register. - 11 cap1mci2_fe_set writing a one sets the corresponding bits in the capcon register. - 12 cap2mci0_re_set writing a one sets the corresponding bits in the capcon register. - 13 cap2mci0_fe_set writing a one sets the corresponding bits in the capcon register. - 14 cap2mci1_re_set writing a one sets the corresponding bits in the capcon register. - 15 cap2mci1_fe_set writing a one sets the corresponding bits in the capcon register. - 16 cap2mci2_re_set writing a one sets the corresponding bits in the capcon register. - 17 cap2mci2_fe_set writing a one sets the corresponding bits in the capcon register. - 18 rt0_set writing a one sets the corresponding bits in the capcon register. - 19 rt1_set writing a one sets the corresponding bits in the capcon register. - 20 rt2_set writing a one sets the corresponding bits in the capcon register. - 21 hnfcap0_set writing a one sets the corresponding bits in the capcon register. - 22 hnfcap1_set writing a one sets the corresponding bits in the capcon register. - 23 hnfcap2_set writing a one sets the corresponding bits in the capcon register. - 31:24 - reserved. - table 553. mcpwm capture control set address (capcon_set - 0x400a 0010) bit description bit symbol description reset value table 554. mcpwm capture control clear regi ster (capcon_clr - address 0x400a 0014) bit description bit symbol description reset value 0 cap0mci0_re_clr writing a one clears the corresponding bits in the capcon register. - 1 cap0mci0_fe_clr writing a one clears the corresponding bits in the capcon register. - 2 cap0mci1_re_clr writing a one clears the corresponding bits in the capcon register. - 3 cap0mci1_fe_clr writing a one clears the corresponding bits in the capcon register. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 645 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 4 cap0mci2_re_clr writing a one clears the corresponding bits in the capcon register. - 5 cap0mci2_fe_clr writing a one clears the corresponding bits in the capcon register. - 6 cap1mci0_re_clr writing a one clears the corresponding bits in the capcon register. - 7 cap1mci0_fe_clr writing a one clears the corresponding bits in the capcon register. - 8 cap1mci1_re_clr writing a one clears the corresponding bits in the capcon register. - 9 cap1mci1_fe_clr writing a one clears the corresponding bits in the capcon register. - 10 cap1mci2_re_clr writing a one clears the corresponding bits in the capcon register. - 11 cap1mci2_fe_clr writing a one clears the corresponding bits in the capcon register. - 12 cap2mci0_re_clr writing a one clears the corresponding bits in the capcon register. - 13 cap2mci0_fe_clr writing a one clears the corresponding bits in the capcon register. - 14 cap2mci1_re_clr writing a one clears the corresponding bits in the capcon register. - 15 cap2mci1_fe_clr writing a one clears the corresponding bits in the capcon register. - 16 cap2mci2_re_clr writing a one clears the corresponding bits in the capcon register. - 17 cap2mci2_fe_clr writing a one clears the corresponding bits in the capcon register. - 18 rt0_clr writing a one clears the corresponding bits in the capcon register. - 19 rt1_clr writing a one clears the corresponding bits in the capcon register. - 20 rt2_clr writing a one clears the corresponding bits in the capcon register. - 21 hnfcap0_clr writing a one clears the corresponding bits in the capcon register. - 22 hnfcap1_clr writing a one clears the corresponding bits in the capcon register. - 23 hnfcap2_clr writing a one clears the corresponding bits in the capcon register. - 31:24 - reserved. - table 554. mcpwm capture control clear regi ster (capcon_clr - address 0x400a 0014) bit description bit symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 646 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.3 mcpwm timer/counter 0-2 registers these registers hold the current values of the 32-bit counter/timers for channels 0-2. each value is incremented on every pclk, or by edges on the mci0-2 pins, as selected by cntcon. the timer/counter counts up from 0 until it reaches the value in its corresponding per register (or is stopped by writing to con_clr). a tc register can be read at any time. in order to write to the tc register, its channel must be stopped. if not, the write will not ta ke place, no exception is generated. 26.7.4 mcpwm limi t 0-2 registers these registers hold the limiting values fo r timer/counters 0-2. when a timer/counter reaches its corresponding limiting value: 1) in edge-aligned mode, it is reset and starts over at 0; 2) in center-aligned mode, it begins counting down until it reaches 0, at which time it begins counting up again. if the channel?s center bit in con is 0 se lecting edge-aligned mode, the match between tc and lim switches the channel?s a output from ?active? to ?passive? state. if the channel?s center and dte bits in con are both 0, the match simultaneously switches the channel?s b output from ?p assive? to ?active? state. if the channel?s center bit is 0 but the dte bit is 1, the match triggers the channel?s deadtime counter to begin counting -- when the deadtime counter expires, the channel?s b output switches from ?pas sive? to ?active? state. in center-aligned mode, matches between a channel?s tc and lim registers have no effect on its a and b outputs. writing to either a limit or a match ( 26.7.5 ) register loads a ?write ? register, and if the channel is stopped it also loads an ?operating? register that is compared to the tc. if the channel is running and its ?disable update? bi t in con is 0, the operating registers are loaded from the write registers: 1) in edge-aligned mode, when the tc matches the operating limit register; 2) in center-aligned mo de, when the tc counts back down to 0. if the channel is running and the ?disable update? bit is 1, the operating registers are not loaded from the write registers until software stops the channel. reading an lim address always returns the operating value. remark: in timer mode, the period of a channel?s modulated mco outputs is determined by its limit register, and the pulse width at the start of the period is determined by its match register. if it suits your way of thinking , consider the limit register to be the ?period register? and the match register to be the ?pulse width register?. table 555. mcpwm timer/counter 0 to 2 registers (tc - 0x400a 0018 (tc0), 0x400a 001c (tc1), 0x400a 0020) (tc2)bit description bit symbol description reset value 31:0 mctc timer/counter value. 0 table 556. mcpwm limit 0 to 2 registers (lim - 0x400a 0024 (lim0), 0x400a 0028 (lim1), 0x400a 002c (lim2)) bit description bit symbol description reset value 31:0 mclim limit value. 0xffff ffff www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 647 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.5 mcpwm match 0-2 registers these registers also have ?write? and ?opera ting? versions as described above for the limit registers, and the operat ing registers are also compared to the channels? tcs. see 26.7.4 above for details of reading and wr iting both limit and match registers. the match and limit registers control the mco0-2 outputs. if a match register is to have any effect on its channel?s operation, it must contain a smaller value than the corresponding limit register. 26.7.5.1 match register in edge-aligned mode if the channel?s center bit in con is 0 selecting edge-aligned mode, a match between tc and mat switches the channel?s b output from ?active? to ?passive? state. if the channel?s center and dte bits in con are both 0, the match simultaneously switches the channel?s a output from ?p assive? to ?active? state. if the channel?s center bit is 0 but the dte bit is 1, the match triggers the channel?s deadtime counter to begin counting -- when the deadtime counter expires, the channel?s a output switches from ?pas sive? to ?active? state. 26.7.5.2 match register in center-aligned mode if the channel?s center bit in con is 1 selecting center-aligned mode, a match between tc and mat while the tc is incrementing switches the channel?s b output from ?active? to ?passive? state, and a match while the tc is decrementing switches the a output from ?active? to ?passive?. if the channel?s center bit in con is 1 but the dte bit is 0, a match simultaneously switches the channel?s ot her output in the opposite direction. if the channel?s center and dte bits are both 1, a match between tc and mat triggers the channel?s deadtime counter to begin counting -- when the deadtime counter expires, the channel?s b output switches from ?passive? to ?active? if the tc was counting up at the time of the match, and the channel?s a output s witches from ?passive? to ?active? if the tc was counting down at the time of the match. 26.7.5.3 0 and 100% duty cycle to lock a channel?s mco outputs at the state ?b active, a passive?, write its match register with a higher value than you write to it s limit register. the match never occurs. to lock a channel?s mco outputs at the opposite state, ?a active, b passive?, simply write 0 to its match register. 26.7.6 mcpwm dead-time register this register holds the dead-time values for the three channels. if a channel?s dte bit in con is 1 to enable its dead-time counter, the counter counts dow n from this value whenever one its channel?s outputs changes fr om ?active? to ?passive? state. when the dead-time counter reaches 0, the channel ch anges its other output from ?passive? to ?active? state. table 557. mcpwm match 0 to 2 registers (mat - addresses 0x400a 0030 (mat0), 0x400a 0034 (mat1), 0x400a 0038 (mat2)) bit description bit symbol description reset value 31:0 mcmat match value. 0xffff ffff www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 648 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) the motivation for the dead-time feature is that power transistors, like those driven by the a and b outputs in a motor-control application, take longer to fully turn off than they take to start to turn on. if the a and b transistors are ever turned on at the same time, a wasteful and damaging current will flow between the power rails throug h the transistors. in such applications, the dead-time r egister should be programmed with the number of pclk periods that is greater than or equal to the transistors? maximum turn-off time minus their minimum turn-on time. [1] if acmode is 1 selecting ac-mode, this fi eld controls the dead time for all three channels. [2] if acmode is 0. 26.7.7 mcpwm communication pattern register this register is used in dc mode only. the inte rnal mcoa0 signal is routed to any or all of the six output pins under the control of the bi ts in this register. like the match and limit registers, this register has ?wri te? and ?operational? versions. see 26.7.4 and 26.8.2 for more about this subject. table 558. mcpwm dead-time register (d t - address 0x400a 003c) bit description bit symbol description reset value 9:0 dt0 dead time for channel 0. [1] 0x3ff 19:10 dt1 dead time for channel 1. [2] 0x3ff 29:20 dt2 dead time for channel 2. [2] 0x3ff 31:30 - reserved table 559. mcpwm communication pattern register (cp - address 0x400a 0040) bit description bit symbol value description reset value 0 ccpa0 communication pattern output a, channel 0. 0 0 mcoa0 passive. 1 internal mcoa0. 1 ccpb0 communication pattern output b, channel 0. 0 0 mcob0 passive. 1 mcob0 tracks internal mcoa0. 2 ccpa1 communication pattern output a, channel 1. 0 0 mcoa1 passive. 1 mcoa1 tracks internal mcoa0. 3 ccpb1 communication pattern output b, channel 1. 0 0 mcob1 passive. 1 mcob1 tracks internal mcoa0. 4 ccpa2 communication pattern output a, channel 2. 0 0 mcoa2 passive. 1 mcoa2 tracks internal mcoa0. 5 ccpb2 communication pattern output b, channel 2. 0 0 mcob2 passive. 1 mcob2 tracks internal mcoa0. 31:6 - reserved. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 649 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.8 mcpwm capt ure read addresses the capcon register ( table 552 ) allows software to select any edge(s) on any of the mci0-2 inputs as a capture event for each channel. when a channel?s capture event occurs, the current tc value for that channel is stored in its read-only capture register. these addresses are read-only, but the underly ing registers can be cleared by writing to the cap_clr address 26.7.9 mcpwm interrupt registers the motor control pwm module includes the following interrupt sources: 7.9.1 mcpwm interrupt enable read address the inten register controls which of the mc pwm interrupts are enabled. this address is read-only, but the underlying register can be modified by writing to addresses inten_set and inten_clr. table 560. mcpwm capture read addresses (cap - 0x400a 0044 (cap0), 0x400a 0048 (cap1), 0x400a 004c 9cap2)) bit description bit symbol description reset value 31:0 cap current tc value at a capture event. 0x0000 00 00 table 561. motor control pwm interrupts symbol description ilim0/1/2 limit interrupts for channels 0, 1, 2. imat0/1/2 match interrupts for channels 0, 1, 2. icap0/1/2 capture interrupts for channels 0, 1, 2. abort fast abort interrupt table 562. mcpwm interrupt enable read address (inten - 0x400a 0050) bit description bit symbol value description reset value 0 ilim0 limit interrupt for channel 0. 0 0 interrupt disabled. 1 interrupt enabled. 1 imat0 match interrupt for channel 0. 0 0 interrupt disabled. 1 interrupt enabled. 2 icap0 capture interrupt for channel 0. 0 0 interrupt disabled. 1 interrupt enabled. 3- reserved. - 4 ilim1 limit interrupt for channel 1. 0 0 interrupt disabled. 1 interrupt enabled. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 650 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.9.2 mcpwm interrupt enable set address writing ones to this write-only address sets the corresponding bits in inten, thus enabling interrupts. 5 imat1 match interrupt for channel 1. 0 0 interrupt disabled. 1 interrupt enabled. 6 icap1 capture interrupt for channel 1. 0 0 interrupt disabled. 1 interrupt enabled. 7- reserved. - 8 ilim2 limit interrupt for channel 2. 0 0 interrupt disabled. 1 interrupt enabled. 9 imat2 match interrupt for channel 2. 0 0 interrupt disabled. 1 interrupt enabled. 10 icap2 capture interrupt for channel 2. 0 0 interrupt disabled. 1 interrupt enabled. 14:11 - reserved. - 15 abort fast abort interrupt. 0 0 interrupt disabled. 1 interrupt enabled. 31:16 - reserved. - table 562. mcpwm interrupt enable read address (inten - 0x400a 0050) bit description bit symbol value description reset value table 563. mcpwm interrupt enable set regist er (inten_set - address 0x400a 0054) bit description bit symbol description reset value 0 ilim0_set writing a one sets the corresponding bit in inten, thus enabling the interrupt. - 1 imat0_set writing a one sets the corresponding bit in inten, thus enabling the interrupt. - 2 icap0_set writing a one sets the corresponding bit in inten, thus enabling the interrupt. - 3- reserved. - 4 ilim1_set writing a one sets the corresponding bit in inten, thus enabling the interrupt. - 5 imat1_set writing a one sets the corresponding bit in inten, thus enabling the interrupt. - 6 icap1_set writing a one sets the corresponding bit in inten, thus enabling the interrupt. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 651 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.9.3 mcpwm interrupt enable clear address writing ones to this write-only address clears the corresponding bits in inten, thus disabling interrupts. 7- reserved. - 9 ilim2_set writing a one sets the corresponding bit in inten, thus enabling the interrupt. - 10 imat2_set writing a one sets the corresponding bit in inten, thus enabling the interrupt. - 11 icap2_set writing a one sets the corresponding bit in inten, thus enabling the interrupt. - 14:12 - reserved. - 15 abort_set writing a one sets the corresponding bit in inten, thus enabling the interrupt. - 31:16 - reserved. - table 563. mcpwm interrupt enable set regist er (inten_set - address 0x400a 0054) bit description bit symbol description reset value table 564. pwm interrupt enable clear register (inten_clr - address 0x400a 0058) bit description bit symbol description reset value 0 ilim0_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 1 imat0_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 2 icap0_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 3 - reserved. - 4 ilim1_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 5 imat1_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 6 icap1_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 7 - reserved. - 8 ilim2_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 9 imat2_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 10 icap2_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 14:11 - reserved. - 15 abort_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 31:16 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 652 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.9.4 mcpwm interrupt flags read address the intf register includes all mcpwm interrupt flags, which are set when the corresponding hardware event occurs, or when ones are written to the intf_set address. when corresponding bits in this register and inten are both 1, the mcpwm asserts its interrupt re quest to the interrupt controller module. this address is read-only, but the bits in the underlying register can be modified by writing ones to addresses intf_set and intf_clr. table 565. mcpwm interrupt flags read address (intf - 0x400a 0068) bit description bit symbol value description reset value 0 ilim0_f limit interrupt flag for channel 0. 0 0 this interrupt source is not contributing to the mcpwm interrupt request. 1 if the corresponding bit in inten is 1, the mcpwm module is asserting its interrupt request to the interrupt controller. 1 imat0_f match interrupt flag for channel 0. 0 0 this interrupt source is not contributing to the mcpwm interrupt request. 1 if the corresponding bit in inten is 1, the mcpwm module is asserting its interrupt request to the interrupt controller. 2 icap0_f capture interrupt flag for channel 0. 0 0 this interrupt source is not contributing to the mcpwm interrupt request. 1 if the corresponding bit in inten is 1, the mcpwm module is asserting its interrupt request to the interrupt controller. 3 - reserved. - 4 ilim1_f limit interrupt flag for channel 1. 0 0 this interrupt source is not contributing to the mcpwm interrupt request. 1 if the corresponding bit in inten is 1, the mcpwm module is asserting its interrupt request to the interrupt controller. 5 imat1_f match interrupt flag for channel 1. 0 0 this interrupt source is not contributing to the mcpwm interrupt request. 1 if the corresponding bit in inten is 1, the mcpwm module is asserting its interrupt request to the interrupt controller. 6 icap1_f capture interrupt flag for channel 1. 0 0 this interrupt source is not contributing to the mcpwm interrupt request. 1 if the corresponding bit in inten is 1, the mcpwm module is asserting its interrupt request to the interrupt controller. 7 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 653 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.9.5 mcpwm interrupt flags set address writing one(s) to this write-on ly address sets the corresponding bit(s) in intf, thus possibly simulating hardware interrupt(s). 8 ilim2_f limit interrupt flag for channel 2. 0 0 this interrupt source is not contributing to the mcpwm interrupt request. 1 if the corresponding bit in inten is 1, the mcpwm module is asserting its interrupt request to the interrupt controller. 9 imat2_f match interrupt flag for channel 2. 0 0 this interrupt source is not contributing to the mcpwm interrupt request. 1 if the corresponding bit in inten is 1, the mcpwm module is asserting its interrupt request to the interrupt controller. 10 icap2_f capture interrupt flag for channel 2. 0 0 this interrupt source is not contributing to the mcpwm interrupt request. 1 if the corresponding bit in inten is 1, the mcpwm module is asserting its interrupt request to the interrupt controller. 14:11 - reserved. - 15 abort_f fast abort interrupt flag. 0 0 this interrupt source is not contributing to the mcpwm interrupt request. 1 if the corresponding bit in inten is 1, the mcpwm module is asserting its interrupt request to the interrupt controller. 31:16 - reserved. - table 565. mcpwm interrupt flags read address (intf - 0x400a 0068) bit description bit symbol value description reset value table 566. mcpwm interrupt flags set address (intf_set - 0x400a 006c) bit description bit symbol description reset value 0 ilim0_f_set writing a one sets the corresponding bit in the intf register, thus possibly simulating hardware interrupt. - 1 imat0_f_set writing a one sets the corresponding bit in the intf register, thus possibly simulating hardware interrupt. - 2 icap0_f_set writing a one sets the corresponding bit in the intf register, thus possibly simulating hardware interrupt. - 3 - reserved. - 4 ilim1_f_set writing a one sets the corresponding bit in the intf register, thus possibly simulating hardware interrupt. - 5 imat1_f_set writing a one sets the corresponding bit in the intf register, thus possibly simulating hardware interrupt. - 6 icap1_f_set writing a one sets the corresponding bit in the intf register, thus possibly simulating hardware interrupt. - 7 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 654 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.9.6 mcpwm interrupt flags clear address writing one(s) to this write-on ly address sets the corresponding bit(s) in intf, thus clearing the corresponding interrupt request(s). this is typically done in interrupt service routines. 8 ilim2_f_set writing a one sets the corresponding bit in the intf register, thus possibly simulating hardware interrupt. - 9 imat2_f_set writing a one sets the corresponding bit in the intf register, thus possibly simulating hardware interrupt. - 10 icap2_f_set writing a one sets the corresponding bit in the intf register, thus possibly simulating hardware interrupt. - 14:11 - reserved. - 15 abort_f_set writing a one sets the corresponding bit in the intf register, thus possibly simulating hardware interrupt. - 31:16 - reserved. - table 566. mcpwm interrupt flags set address (intf_set - 0x400a 006c) bit description bit symbol description reset value table 567. mcpwm interrupt flags clear addres s (intf_clr - 0x400a 0070) bit description bit symbol description reset value 0 ilim0_f_clr writing a one clears the corresponding bit in the intf register, thus clearing the corresponding interrupt request. - 1 imat0_f_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 2 icap0_f_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 3- reserved. - 4 ilim1_f_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 5 imat1_f_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 6 icap1_f_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 7- reserved. - 8 ilim2_f_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 9 imat2_f_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 10 icap2_f_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 14:11 - writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 15 abort_f_clr writing a one clears the corresponding bit in inten, thus disabling the interrupt. - 31:16 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 655 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.10 mcpwm count control register 26.7.10.1 mcpwm count control read address the cntcon register controls whether t he mcpwm channels are in timer or counter mode, and in coun ter mode whether the coun ter advances on rising and/or falling edges on any or all of the three mci inputs. if timer mode is selected, the counter advances based on the pclk clock. this address is read-only. to set or clear the register bits, write ones to the cntcon_set or cntcon_clr address. table 568. mcpwm count control read addr ess (cntcon - 0x400a 005c) bit description bit symbol value description reset value 0 tc0mci0_re counter 0 rising edge mode, channel 0. 0 0 a rising edge on mci0 does not affect counter 0. 1 if mode0 is 1, counter 0 advances on a rising edge on mci0. 1 tc0mci0_fe counter 0 falling edge mode, channel 0. 0 0 a falling edge on mci0 does not affect counter 0. 1 if mode0 is 1, counter 0 advances on a falling edge on mci0. 2 tc0mci1_re counter 0 rising edge mode, channel 1. 0 0 a rising edge on mci1 does not affect counter 0. 1 if mode0 is 1, counter 0 advances on a rising edge on mci1. 3 tc0mci1_fe counter 0 falling edge mode, channel 1. 0 0 a falling edge on mci1 does not affect counter 0. 1 if mode0 is 1, counter 0 advances on a falling edge on mci1. 4 tc0mci2_re counter 0 rising edge mode, channel 2. 0 0 a rising edge on mci0 does not affect counter 0. 1 if mode0 is 1, counter 0 advances on a rising edge on mci2. 5 tc0mci2_fe counter 0 falling edge mode, channel 2. 0 0 a falling edge on mci0 does not affect counter 0. 1 if mode0 is 1, counter 0 advances on a falling edge on mci2. 6 tc1mci0_re counter 1 rising edge mode, channel 0. 0 0 a rising edge on mci0 does not affect counter 1. 1 if mode1 is 1, counter 1 advances on a rising edge on mci0. 7 tc1mci0_fe counter 1 falling edge mode, channel 0. 0 0 a falling edge on mci0 does not affect counter 1. 1 if mode1 is 1, counter 1 advances on a falling edge on mci0. 8 tc1mci1_re counter 1 rising edge mode, channel 1. 0 0 a rising edge on mci1 does not affect counter 1. 1 if mode1 is 1, counter 1 advances on a rising edge on mci1. 9 tc1mci1_fe counter 1 falling edge mode, channel 1. 0 0 a falling edge on mci0 does not affect counter 1. 1 if mode1 is 1, counter 1 advances on a falling edge on mci1. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 656 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.10.2 mcpwm count control set address writing one(s) to this write- only address sets the corresponding bit(s) in cntcon. 10 tc1mci2_re counter 1 rising edge mode, channel 2. 0 0 a rising edge on mci2 does not affect counter 1. 1 if mode1 is 1, counter 1 advances on a rising edge on mci2. 11 tc1mci2_fe counter 1 falling edge mode, channel 2. 0 0 a falling edge on mci2 does not affect counter 1. 1 if mode1 is 1, counter 1 advances on a falling edge on mci2. 12 tc2mci0_re counter 2 rising edge mode, channel 0. 0 0 a rising edge on mci0 does not affect counter 2. 1 if mode2 is 1, counter 2 advances on a rising edge on mci0. 13 tc2mci0_fe counter 2 falling edge mode, channel 0. 0 0 a falling edge on mci0 does not affect counter 2. 1 if mode2 is 1, counter 2 advances on a falling edge on mci0. 14 tc2mci1_re counter 2 rising edge mode, channel 1. 0 0 a rising edge on mci1 does not affect counter 2. 1 if mode2 is 1, counter 2 advances on a rising edge on mci1. 15 tc2mci1_fe counter 2 falling edge mode, channel 1. 0 0 a falling edge on mci1 does not affect counter 2. 1 if mode2 is 1, counter 2 advances on a falling edge on mci1. 16 tc2mci2_re counter 2 rising edge mode, channel 2. 0 0 a rising edge on mci2 does not affect counter 2. 1 if mode2 is 1, counter 2 advances on a rising edge on mci2. 17 tc2mci2_fe counter 2 falling edge mode, channel 2. 0 0 a falling edge on mci2 does not affect counter 2. 1 if mode2 is 1, counter 2 advances on a falling edge on mci2. 28:18 - - reserved. - 29 cntr0 channel 0 counter/timer mode. 0 0 channel 0 is in timer mode. 1 channel 0 is in counter mode. 30 cntr1 channel 1 counter/timer mode. 0 0 channel 1 is in timer mode. 1 channel 1 is in counter mode. 31 cntr2 channel 2 counter/timer mode. 0 0 channel 2 is in timer mode. 1 channel 2 is in counter mode. table 568. mcpwm count control read addr ess (cntcon - 0x400a 005c) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 657 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.10.3 mcpwm count control clear address writing one(s) to this write- only address clears the corresponding bit(s) in cntcon. table 569. mcpwm count control set address (cntcon_set - 0x400a 0060) bit description bit symbol description reset value 0 tc0mci0_re_set writing a one sets the corresponding bit in the cntcon register. - 1 tc0mci0_fe_set writing a one sets the corresponding bit in the cntcon register. - 2 tc0mci1_re_set writing a one sets the corresponding bit in the cntcon register. - 3 tc0mci1_fe_set writing a one sets the corresponding bit in the cntcon register. - 4 tc0mci2_re_set writing a one sets the corresponding bit in the cntcon register. - 5 tc0mci2_fe_set writing a one sets the corresponding bit in the cntcon register. - 6 tc1mci0_re_set writing a one sets the corresponding bit in the cntcon register. - 7 tc1mci0_fe_set writing a one sets the corresponding bit in the cntcon register. - 8 tc1mci1_re_set writing a one sets the corresponding bit in the cntcon register. - 9 tc1mci1_fe_set writing a one sets the corresponding bit in the cntcon register. - 10 tc1mci2_re_set writing a one sets the corresponding bit in the cntcon register. - 11 tc1mci2_fe_set writing a one sets the corresponding bit in the cntcon register. - 12 tc2mci0_re_set writing a one sets the corresponding bit in the cntcon register. - 13 tc2mci0_fe_set writing a one sets the corresponding bit in the cntcon register. - 14 tc2mci1_re_set writing a one sets the corresponding bit in the cntcon register. - 15 tc2mci1_fe_set writing a one sets the corresponding bit in the cntcon register. - 16 tc2mci2_re_set writing a one sets the corresponding bit in the cntcon register. - 17 tc2mci2_fe_set writing a one sets the corresponding bit in the cntcon register. - 28:18 - reserved. 29 cntr0_set writing a one sets the corresponding bit in the cntcon register. - 30 cntr1_set writing a one sets the corresponding bit in the cntcon register. - 31 cntr2_set writing a one sets the corresponding bit in the cntcon register. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 658 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) table 570. mcpwm count control clear address (cntcon_clr - 0x400a 0064) bit description bit symbol description reset value 0 tc0mci0_re_clr writing a one clears the corresponding bit in the cntcon register. - 1 tc0mci0_fe_clr writing a one clears the corresponding bit in the cntcon register. - 2 tc0mci1_re_clr writing a one clears the corresponding bit in the cntcon register. - 3 tc0mci1_fe_clr writing a one clears the corresponding bit in the cntcon register. - 4 tc0mci2_re writing a one clears the corresponding bit in the cntcon register. - 5 tc0mci2_fe_clr writing a one clears the corresponding bit in the cntcon register. - 6 tc1mci0_re_clr writing a one clears the corresponding bit in the cntcon register. - 7 tc1mci0_fe_clr writing a one clears the corresponding bit in the cntcon register. - 8 tc1mci1_re_clr writing a one clears the corresponding bit in the cntcon register. - 9 tc1mci1_fe_clr writing a one clears the corresponding bit in the cntcon register. - 10 tc1mci2_re_clr writing a one clears the corresponding bit in the cntcon register. - 11 tc1mci2_fe_clr writing a one clears the corresponding bit in the cntcon register. - 12 tc2mci0_re_clr writing a one clears the corresponding bit in the cntcon register. - 13 tc2mci0_fe_clr writing a one clears the corresponding bit in the cntcon register. - 14 tc2mci1_re_clr writing a one clears the corresponding bit in the cntcon register. - 15 tc2mci1_fe_clr writing a one clears the corresponding bit in the cntcon register. - 16 tc2mci2_re_clr writing a one clears the corresponding bit in the cntcon register. - 17 tc2mci2_fe_clr writing a one clears the corresponding bit in the cntcon register. - 28:18 - reserved. 29 cntr0_clr writing a one clears the corresponding bit in the cntcon register. - 30 cntr1_clr writing a one clears the corresponding bit in the cntcon register. - 31 cntr2_clr writing a one clears the corresponding bit in the cntcon register. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 659 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.7.11 mcpwm capture clear address writing ones to this write- only address clears the selected cap register(s). table 571. mcpwm capture clear address (cap_clr - 0x400a 0074) bit description bit symbol description 0 cap_clr0 writing a 1 to this bit clears the cap0 register. 1 cap_clr1 writing a 1 to this bit clears the cap1 register. 2 cap_clr2 writing a 1 to this bit clears the cap2 register. 31:3 - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 660 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.8 functional description 26.8.1 pulse-width modulation each channel of the mcpwm has two outputs, a and b, that can drive a pair of transistors to switch a controlled point between two power rails. most of the time the two outputs have opposite polarity, but a dead-time feature can be enabled (on a per-channel basis) to delay both signals? transitions from ?passive? to ?active? state so that the transistors are never both turned on simultaneously. in a more general view, the states of each output pair can be thought of ?high?, ?low?, and ?floating? or ?up?, ?down?, and ?center-off?. each channel?s mapping from ?active? and ?passive? to ?high? and ?low? is programmable. after reset, the three a outputs are passive/low, and the b outputs are active/high. the mcpwm can perform edge-aligned and center-aligned pulse-width modulation. remark: in timer mode, the period of a channel?s modulated mco outputs is determined by its limit register, and the pulse width at the start of the period is determined by its match register. if it suits your way of thinking , consider the limit register to be the ?period register? and the match register to be the ?pulse width register?. edge-aligned pwm without dead-time in this mode the timer tc counts up from 0 to the value in the lim register. as shown in figure 74 , the mco state is ?a passive? until the tc matches the match register, at which point it changes to ?a active?. when the tc matches the limit register, the mco state changes back to ?a passive?, and the tc is reset and starts counting up again. center-aligned pwm without dead-time in this mode the timer tc counts up from 0 to the value in the lim register, then counts back down to 0 and repeats. as shown in figure 75 , while the timer counts up, the mco state is ?a passive? until the tc matches the ma tch register, at which point it changes to ?a active?. when the tc matches the limit register it starts counting down. when the tc matches the match register on the way down, the mco state changes back to ?a passive?. fig 74. edge-aligned pwm waveform without dead time, pola = 0 mat mat lim lim 0 pola = 0 timer reset timer reset mcoa mcob active active passive passive passive passive active active www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 661 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) dead-time counter when the a channel?s dte bit is set in con, the dead-time counter delays the passive-to-active transitions of both mco outp uts. the dead-time counter starts counting down, from the channel?s dt value (in the dt register) to 0, whenever the channel?s a or b output changes from active to passive. the tr ansition of the other output from passive to active is delayed until the dead-time counte r reaches 0. during the dead time, the mcoa and mcob output levels are both passive. figure 76 shows operation in edge aligned mode with dead time, and figure 77 shows center-aligned operation with dead time. fig 75. center-aligned pwm waveform without dead time, pola = 0 fig 76. edge-aligned pwm wavefo rm with dead time, pola = 0 mat mat lim lim 0 0 pola = 0 mcoa mcob active active passive passive passive passive active active mat mat lim lim 0 pola = 0 timer reset timer reset mcoa mcob active active passive passive passive passive active active dt dt dt dt www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 662 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.8.2 shadow registers and simultaneous updates the limit, match, and communication pattern registers (lim, mat, and cp) are implemented as register pairs, each consisti ng of a write register and an operational register. software writes into the write regi sters. the operational registers control the actual operation of each channel and are loaded with the current value in the write registers when the tc starts counting up from 0. updating of the functional registers can be di sabled by setting a channel?s disup bit in the con register. if the disup bits are set, the functional register s are not updated until software stops the channel. if a channel is not running when software writes to its lim or mat register, the functional register is updated immediately. software can write to a tc register only when its channel is stopped. 26.8.3 fast abort (abort) the mcpwm has an external input mcabort . when this input goes low, all six mco outputs assume their ?a passive? states, and the abort interrupt is generated if enabled. the outputs remain locked in ?a passive? stat e until the abort interrupt flag is cleared or the abort interrupt is disabled. the abort flag may not be cleared before the mcabort input goes high. in order to clear an abort flag, a 1 must be written to bit 15 of the intf_clr register. this will remove the interrupt re quest. the interrupt can also be disabled by writing a 1 to bit 15 of the inten_clr register. 26.8.4 capture events each pwm channel can take a snapshot of its tc when an input signal transitions. any channel may use any comb ination of rising and/ or falling edges on any or all of the mci0-2 inputs as a capture even t, under control of the capcon register. rising or falling edges on the inputs are detected synchronously with respect to pclk. fig 77. center-aligned waveform with dead time, pola = 0 mat mat lim lim 0 0 pola = 0 mcoa mcob active active passive passive passive passive active active dt dt dt www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 663 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) if a channel?s hnf bit in the capcon register is set to enable ?noise filtering?, a selected edge on an mci pin starts the dead-time counter for that channel, and the capture event actions described below are delayed until the de ad-time counter reaches 0. this function is targeted specifically fo r performing three-phase brushless dc motor control with hall sensors. a capture event on a channel (possibly delayed by hnf) causes the following: ? the current value of the tc is stored in the capture register (cap). ? if the channel?s capture event interrupt is enabled (see ta b l e 5 6 2 ), the capture event interrupt flag is set. ? if the channel?s rt bit is set in the capcon register, enabling reset on a capture event, the input event has the same effect as matching the channel?s tc to its lim register. this includes resetting the tc and switching the mco pin(s) in edge-aligned mode as described in 26.7.4 and 26.8.1 . 26.8.5 external event c ounting (counter mode) if a channel?s mode bit is 1 in cntcon, its tc is incremented by rising and/or falling edge(s) (synchronously detected) on the mci0 -2 input(s), rather than by pclk. the pwm functions and capture functions are unaffected. 26.8.6 three-phase dc mode the three-phase dc mode is selected by setting the dcmode bit in the con register. in this mode, the internal mcoa0 signal can be routed to any or all of the mco outputs. each mco output is masked by a bit in the current commutation pattern register cp. if a bit in the cp register is 0, its output pin ha s the logic level for the passive state of output mcoa0. the polarity of the off stat e is determined by the pola0 bit. all mco outputs that have 1 bits in the cp register are controlled by the internal mcoa0 signal. the three mcob output pins are inverted when the invbdc bit is 1 in the con register. this feature accommodates bridge-drivers that have active-low inputs for the low-side switches. the cp register is implemented as a shadow re gister pair, so that changes to the active communication pattern occur at the beginning of a new pwm cycle. see 26.7.4 and 26.8.2 for more about writing and reading such registers. figure 78 shows sample waveforms of the mco outputs in three-phase dc mode. bits 1 and 3 in the cp register (corresponding to outputs mcob1 and mcob0) are set to 0 so that these outputs are masked and in the off st ate. their logic level is determined by the pola0 bit (here, pola0 = 0 so the passive state is logic low). the invbdc bit is set to 0 (logic level not inverted) so that the b output have the same polarity as the a outputs. note that this mode differs from othe r modes in that the mcob outputs are not the opposite of the mcoa outputs. in the situation shown in figure 78 , bits 0, 2, 4, and 5 in the cp register are set to 1. that means that mcoa1 and both mco outputs for channel 2 follow the mcoa0 signal. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 664 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.8.7 three phase ac mode the three-phase ac-mode is selected by se tting the acmode bit in the con register. in this mode, the value of channel 0?s tc is routed to all channels for comparison with their mat registers. (the lim1-2 registers are not used.) each channel controls its mco output by comparing its mat value to tc0. figure 79 shows sample waveforms for the six mco outputs in three-phase ac mode. the pola bits are set to 0 for all three channels, so that for all mco outputs the active levels are high and the passive levels are low. each channel has a different mat value which is compared to the tc0 va lue. in this mode the period va lue is identical for all three channels and is determined by lim0. the dead-time mode is disabled. fig 78. three-phase dc mode sample waveforms pola0 = 0, invbdc = 0 mcoa2 mcob1 mcoa1 mcob0 mcoa0 mcob2 ccpb1 = 0, off-state ccpb0 = 0, off-state ccpa0 = 1, on-state ccpa2 = 1, on-state ccpa1 = 1, on-state ccpb2 = 1, on-state www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 665 of 1164 nxp semiconductors UM10430 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.8.8 interrupts the mcpwm includes 10 possible interrupt sources: ? when any channel?s tc matches its match register. ? when any channel?s tc matches its limit register. ? when any channel captures the value of its tc into its capture register, because a selected edge occurs on any of mci0-2. ? when all three channels? outputs are fo rced to ?a passive? state because the mcabort pin goes low. section 26.7.9 ? mcpwm interrupt registers ? explains how to enable these interrupts, and section 26.7.2 ? pwm capture control register ? describes how to map edges on the mci0-2 inputs to ?capture events? on the three channels. fig 79. three-phase ac mode sample waveforms, edge aligned pwm mode pola0 = 0 pola2 = 0 pola1 = 0 mcoa2 mcob1 mcoa1 mcob0 mcoa0 mcob2 mat0 mat1 mat1 mat2 mat2 lim0 lim0 0 timer reset timer reset www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 666 of 1164 27.1 how to read this chapter the qei is available on all lpc18xx parts. 27.2 basic configuration the qei is configured as follows: ? see ta b l e 5 7 2 for clocking and power control. ? the qei is reset by the qei_rst (reset #39). ? the qei interrupt is connected to slot # 15 in the event router. 27.3 features this quadrature encoder interface (qei) has the following features: ? tracks encoder position. ? increments/ decrements depending on direction. ? programmable for 2x or 4x position counting. ? velocity capture using built-in timer. ? velocity compare function with less than interrupt. ? uses 32-bit registers for position and velocity. ? three position compare registers with interrupts. ? index counter for revolution counting. ? index compare register with interrupts. ? can combine index and position interrupts to produce an interrupt for whole and partial revolution displacement. ? digital filter with programmable delays for encoder input signals. ? can accept decoded signal inputs (clock and direction). UM10430 chapter 27: lpc18xx quadratur e encoder interface (qei) rev. 00.13 ? 20 july 2011 user manual table 572. qei clocking and power control base clock branch clock maximum frequency clock to the qei register interface and qei peripheral clock. base_m3_clk clk_m3_qei 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 667 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.4 introduction a quadrature encoder, also known as a 2-chan nel incremental encoder, converts angular displacement into two pulse signals. by mo nitoring both the number of pulses and the relative phase of the two signals, you can tr ack the position, direction of rotation, and velocity. in addition, a third channel, or index signal, can be used to reset the position counter. this quadrature encoder interfac e module decodes the digital pulses from a quadrature encoder wheel to integrate positi on over time and determine direction of rotation. in addition, it can captur e the velocity of the encoder wheel. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 668 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) fig 80. encoder interface block diagram digital filter dir clk _ pulse inx gating windowing inx_ pulse idx pha phb quad decoder velocity counter velocity capture velocity compare velocity reload velocity timer tim _int rst rst rst position counter position compare index counter index compare velc _int rev 0_ int rev 1_ int rev 2_ int max _pos _int err _int enclk _int dir _int inx _int maxpos compare pos 0rev _int pos 1rev _int pos 2rev _int pclk pos 0rev _int pos 1rev _int pos 2rev _int www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 669 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.5 pin description 27.6 register description table 573. qei pin description pin name i/o description qei_a i used as the phase a (pha) input to the quadrature encoder interface. qei_b i used as the phase b (phb) input to the quadrature encoder interface. qei_idx i used as the index (idx) input to the quadrature encoder interface. table 574. register overview: qei (base address 0x400c 6000) name access address offset description reset value control registers con wo 0x000 control register 0 stat ro 0x004 encoder status register 0 conf r/w 0x008 configuration register 0x000f 0000 position, index, and timer registers pos ro 0x00c position register 0 maxpos r/w 0x010 maximum position register 0 cmpos0 r/w 0x014 position compare register 0 0xffff ffff cmpos1 r/w 0x018 position compare register 1 0xffff ffff cmpos2 r/w 0x01c position compare register 2 0xffff ffff inxcnt ro 0x020 index count register 0 inxcmp0 r/w 0x024 index compare register 0 0xffff ffff load r/w 0x028 velocity timer reload register 0xffff ffff time ro 0x02c velocity timer register 0xffff ffff vel ro 0x030 velocity counter register 0 cap ro 0x034 velocity capture register 0xffff ffff velcomp r/w 0x038 velocity compare register 0 filterpha r/w 0x03c digital filter register on input phase a (qei_a) 0 filterphb r/w 0x040 digital filter register on input phase b (qei_b) 0 filterinx r/w 0x044 digital filter register on input index (qei_idx) 0 window r/w 0x048 index acceptance window register 0x0000 0000 inxcmp1 r/w 0x04c index compare register 1 0xffff ffff inxcmp2 r/w 0x050 index compare register 2 0xffff ffff interrupt registers iec wo 0xfd8 interrupt enable clear register 0 ies wo 0xfdc interrupt enable set register 0 intstat ro 0xfe0 interrupt status register 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 670 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) ie ro 0xfe4 interrupt enable register 0 clr wo 0xfe8 interrupt status clear register 0 set wo 0xfec interrupt status set register 0 table 574. register overview: qei (base address 0x400c 6000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 671 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.6.1 control registers 27.6.1.1 qei control register this register contains bits which control the operation of the position and velocity counters of the qei module. 27.6.1.2 qei configuration register this register contains the configuration of the qei module. table 575: qei control register (con - address 0x400c 6000) bit description bit symbol description reset value 0 resp reset position counter. when set = 1, resets the position counter to all zeros. autoclears when the position counter is cleared. 0 1 respi reset position counter on index. when set = 1, re sets the position counter to all zeros when an inde x pulse occurs. autoclears when the position counter is cleared. 0 2 resv reset velocity. when set = 1, rese ts the velocity counter to all zeros and reloads the velocity timer. autoclears when the velocity counter is cleared. 0 3 resi reset index counter. when set = 1, resets the index counter to all zeros. autoclears when the index counter is cleared. 0 31:4 - reserved 0 table 576: qei configuration register (c onf - address 0x400c 6008) bit description bit symbol description reset value 0 dirinv direction invert. when = 1, complements the dir bit. 0 1 sigmode signal mode. when = 0, pha and phb function as quadrature encoder inputs. when = 1, pha functions as the direction signal and phb functions as the clock signal. 0 2 capmode capture mode. when = 0, only pha edges are counted (2x). when = 1, both pha and phb edges are counted (4x), increasing resolution but decreasing range. 0 3 invinx invert index. when set, inverts the sense of the index input. 0 4 crespi continuously reset position counter on index. when set = 1, resets the position counter to all zeros when an index pulse occurs at the next position increase (recalibration). auto-clears when the position counter is cleared. 0 15:5 - reserved 0 19:16 inxgate index gating configuration: when inxgate(19)=1, pass the index when pha=0 and phb=0, else block. when inxgate(18)=1, pass the index when pha=0 and phb=1, else block. when inxgate(17)=1, pass the index when pha=1 and phb=1, else block. when inxgate(16)=1, pass the index when pha=1 and phb=0, else block. 1111 31:20 - reserved 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 672 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.6.1.3 qei status register this register provides the st atus of the encoder interface. table 577: qei interrupt status register (stat - address 0x400c 6004) bit description bit symbol description reset value 0 dir direction bit. in combination with dirinv bit indicates forward or reverse direction. see table 604 . 31:1 - reserved 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 673 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.6.2 position, index and timer registers 27.6.2.1 qei position register this register contains the current value of the encoder position. increments or decrements when encoder counts occur, depending on the direction of rotation. 27.6.2.2 qei maximum position register this register contains the maximum value of the encoder position. in forward rotation the position register resets to zero when the pos ition register exceeds this value. in reverse rotation the position register resets to th is value when the position register decrements from zero. 27.6.2.3 qei position compare register 0 this register contains a position compare value. this value is compared against the current value of the position register. interrupts can be enabled to interrupt when the compare value is less than, equal to, or greater than the current value of the position register. 27.6.2.4 qei position compare register 1 this register contains a position compare value. this value is compared against the current value of the position register. interrupts can be enabled to interrupt when the compare value is less than, equal to, or greater than the current value of the position register. 27.6.2.5 qei position compare register 2 this register contains a position compare value. this value is compared against the current value of the position register. interrupts can be enabled to interrupt when the compare value is less than, equal to, or greater than the current value of the position register. table 578. qei position re gister (pos - address 0x400c 600c) bit description bit symbol description reset value 31:0 pos current position value. 0 table 579. qei maximum position register (maxpos - address 0x400c 6010) bit description bit symbol description reset value 31:0 maxpos maximum position value. 0 table 580. qei position compare register 0 ( cmpos0 - address 0x400c 6014) bit description bit symbol description reset value 31:0 pcmp0 position compare value 0. 0xffff ffff table 581. qei position compare register 1 ( cmpos1 - address 0x400c 6018) bit description bit symbol description reset value 31:0 pcmp1 position compare value 1. 0xffff ffff table 582. qei position compare register 2 (cmpos2 - address 0x400c 601c) bit description bit symbol description reset value 31:0 pcmp2 position compare value 2. 0xffff ffff www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 674 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.6.2.6 qei index count register this register contains the current value of the encoder position. increments or decrements when encoder counts occur, depending on the direction of rotation. 27.6.2.7 qei index compare register 0 this register contains an index compare value. this value is compared against the current value of the index count register. interrupts can be enabled to interrupt when the compare value is less than, equal to, or greater than the current value of the index count register. 27.6.2.8 qei timer reload register this register contains the reload value of th e velocity timer. when the timer (qeitime) overflows or the resv bit is asserted, this value is loaded into the timer (qeitime). 27.6.2.9 qei timer register this register contains the current value of the velocity timer. when this timer overflows the value of velocity counter (qeivel) is stored in the velocity capture register (qeicap), the velocity counter is reset to ze ro, the timer is reloaded with the value stored in the velocity reload register (qeiload), and the velo city interrupt (tim_int) is asserted. 27.6.2.10 qei velocity register this register contains the running count of velocity pulses for the current time period. when the velocity timer (qeitime) overflows the contents of this register is captured in the velocity capture register (qeicap). after capture, this register is set to zero. this register is also reset when the ve locity reset bit (resv) is asserted. table 583. qei index count register (inx cnt- address 0x400c 6020) bit description bit symbol description reset value 31:0 encpos current encoder position value. 0 table 584. qei index compare register 0(in xcmp0 - address 0x400c 6024) bit description bit symbol description reset value 31:0 icmp0 index compare value. 0xffff ffff table 585. qei timer load register (lo ad - address 0x400c 6028) bit description bit symbol description reset value 31:0 velload current velocity timer load value. 0xffff ffff table 586. qei timer register (time - address 0x400c 602c) bit description bit symbol description reset value 31:0 velval current velocity timer value. 0xffff ffff table 587. qei velocity register (vel - address 0x400c 6030) bit description bit symbol description reset value 31:0 velpc current velocity pulse count. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 675 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.6.2.11 qei velocity capture register this register contains the most recently measured velocity of the encoder. this corresponds to the number of velocity puls es counted in the previous velocity timer period.the current velocity co unt is latched into this register when the velocity timer overflows. 27.6.2.12 qei velocity compare register this register contains a velocity compare value. this value is compared against the captured velocity in the veloci ty capture register. if the capt ure velocity is less than the value in this compare register, a velocity comp are interrupt (vel c_int) will be asserted, if enabled. 27.6.2.13 qei digital filter on phase a input register this register contains the sampling count for the digital filter. a sampling count of zero bypasses the filter. 27.6.2.14 qei digital filter on phase b input register this register contains the sampling count for the digital filter. a sampling count of zero bypasses the filter. 27.6.2.15 qei digital filter on index input register this register contains the sampling count for the digital filter. a sampling count of zero bypasses the filter. table 588. qei velocity capture register (cap - address 0x400c 6034) bit description bit symbol description reset value 31:0 velcap velocity capture value. 0xffff ffff table 589. qei velocity compare register ( velcomp - address 0x400c 6038) bit description bit symbol description reset value 31:0 velcmp velocity compare value. 0x0 table 590. qei digital filter on phase a input register (filterpha - 0x400c 603c) bit description bit symbol description reset value 31:0 filta digital filter sampling delay 0x0 table 591. qei digital filter on phase b input register (filterphb - 0x400c 6040) bit description bit symbol description reset value 31:0 filtb digital filter sampling delay 0x0 table 592. qei digital filter on index input register (filterinx - 0x400c 6044) bit description bit symbol description reset value 31:0 fitlinx digital filter sampling delay 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 676 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.6.2.16 qei index acceptance window register this register contains the width of the index acceptance window, when the index and the phase / clock edges fall nearly together. if the activating phase / clock edge falls before the index, but within the window, the (re)calib ration will be activated on that clock/phase edge. 27.6.2.17 qei index compare register 1 this register contains an index compare value. this value is compared against the current value of the index count register. interrupts can be enabled to interrupt when the compare value is less than, equal to, or greater than the current value of the index count register. 27.6.2.18 qei index compare register 2 this register contains an index compare value. this value is compared against the current value of the index count register. interrupts can be enabled to interrupt when the compare value is less than, equal to, or greater than the current value of the index count register. table 593. qei index acceptance window regi ster (window - 0x400c 6048) bit description bit symbol description reset value 31:0 window index acceptance window width 0x0 table 594. qei index compare register 1 (i nxcmp1 - address 0x400c 604c) bit description bit symbol description reset value 31:0 icmp1 index compare value 1. 0xffff ffff table 595. qei index compare register 0 (i nxcmp2 - address 0x400c 6050) bit description bit symbol description reset value 31:0 icmp2 index compare value 2. 0xffff ffff www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 677 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.6.3 interrupt registers 27.6.3.1 qei interrupt enable clear register writing a 1 to a bit in this register clears th e corresponding bit in the qei interrupt enable register (qeiie). 27.6.3.2 qei interrupt enable set register writing a 1 to a bit in this register sets the corresponding bit in the qei interrupt enable register (qeiie). table 596: qei interrupt enable clear register (iec - address 0x400c 6fd8) bit description bit symbol description reset value 0 inx_en indicates that an index pulse was detected. 0 1 tim_en indicates that a velocity timer overflow occurred 0 2 velc_en indicates that captured velo city is less than compare velocity. 0 3 dir_en indicates that a change of direction was detected. 0 4 err_en indicates that an encoder phase error was detected. 0 5 enclk_en indicates that and encoder clock pulse was detected. 0 6 pos0_int indicates that the position 0 compare value is equal to the current position. 0 7 pos1_int indicates that the position 1compare value is equal to the current position. 0 8 pos2_int indicates that the position 2 compare value is equal to the current position. 0 9 rev_int indicates that the index compare value is equal to the current index count. 0 10 pos0rev_int combined position 0 and revolution count interrupt. set when both the pos0_int bit is set and the rev_int is set. 0 11 pos1rev_int combined position 1 and revolution count interrupt. set when both the pos1_int bit is set and the rev_int is set. 0 12 pos2rev_int combined position 2 and revolution count interrupt. set when both the pos2_int bit is set and the rev_int is set. 0 13 rev1_int indicates that the index 1 compare value is equal to the current index count. 0 14 rev2_int indicates that the index 2 compare value is equal to the current index count. 0 15 maxpos_int indicates that the current position count goes through the maxpos value to zero in forward direction, or through zero to maxpos in backward direction. 0 31:16 - reserved 0 table 597: qei interrupt enable set register (ies - address 0x400c 6fdc) bit description bit symbol description reset value 0 inx_en indicates that an index pulse was detected. 0 1 tim_en indicates that a velocity timer overflow occurred 0 2 velc_en indicates that captured velo city is less than compare velocity. 0 3 dir_en indicates that a change of direction was detected. 0 4 err_en indicates that an encoder phase error was detected. 0 5 enclk_en indicates that and encoder clock pulse was detected. 0 6 pos0_int indicates that the position 0 compare value is equal to the current position. 0 7 pos1_int indicates that the position 1compare value is equal to the current position. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 678 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.6.3.3 qei interrupt status register this register provides the status of the enco der interface and the current set of interrupt sources that are asserted to the controller. bits set to 1 indicate the latched events that have occurred; a zero bit indicates that the event in question has not occurred. writing a 0 to a bit position clears the corresponding interrupt. 8 pos2_int indicates that the position 2 compare value is equal to the current position. 0 9 rev_int indicates that the index compare value is equal to the current index count. 0 10 pos0rev_int combined position 0 and revolution count interrupt. set when both the pos0_int bit is set and the rev_int is set. 0 11 pos1rev_int combined position 1 and revolution count interrupt. set when both the pos1_int bit is set and the rev_int is set. 0 12 pos2rev_int combined position 2 and revolution count interrupt. set when both the pos2_int bit is set and the rev_int is set. 0 13 rev1_int indicates that the index 1 compare value is equal to the current index count. 0 14 rev2_int indicates that the index 2 compare value is equal to the current index count. 0 15 maxpos_int indicates that the current position count goes through the maxpos value to zero in forward direction, or through zero to maxpos in backward direction. 0 31:16 - reserved 0 table 597: qei interrupt enable set register (ies - address 0x400c 6fdc) bit description bit symbol description reset value table 598: qei interrupt status register (intstat - address 0x400c 6fe0) bit description bit symbol description reset value 0 inx_int indicates that an index pulse was detected. 0 1 tim_int indicates that a velocity timer overflow occurred 0 2 velc_int indicates that captured velo city is less than compare velocity. 0 3 dir_int indicates that a change of direction was detected. 0 4 err_int indicates that an encoder phase error was detected. 0 5 enclk_int indicates that and encoder clock pulse was detected. 0 6 pos0_int indicates that the position 0 compare value is equal to the current position. 0 7 pos1_int indicates that the position 1compare value is equal to the current position. 0 8 pos2_int indicates that the position 2 compare value is equal to the current position. 0 9 rev_int indicates that the index compare value is equal to the current index count. 0 10 pos0rev_int combined position 0 and revolution count interrupt. set when both the pos0_int bit is set and the rev_int is set. 0 11 pos1rev_int combined position 1 and revolution count interrupt. set when both the pos1_int bit is set and the rev_int is set. 0 12 pos2rev_int combined position 2 and revolution count interrupt. set when both the pos2_int bit is set and the rev_int is set. 0 13 rev1_int indicates that the index 1 compare value is equal to the current index count. 0 14 rev2_int indicates that the index 2 compare value is equal to the current index count. 0 15 maxpos_int indicates that the current position count goes through the maxpos value to zero in forward direction, or through zero to maxpos in backward direction. 0 31:16 - reserved 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 679 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.6.3.4 qei interrupt enable register this register enables interrupt sources. bits set to 1 enable the corresponding interrupt; a 0 bit disables the corresponding interrupt. 27.6.3.5 qei interrupt clear register writing a 1 to a bit in this register clears th e corresponding bit in the qei interrupt status register (qeistat). table 599: qei interrupt enable register (ie - address 0x400c 6fe4) bit description bit symbol description reset value 0 inx_int indicates that an index pulse was detected. 0 1 tim_int indicates that a velocity timer overflow occurred 0 2 velc_int indicates that captured velo city is less than compare velocity. 0 3 dir_int indicates that a change of direction was detected. 0 4 err_int indicates that an encoder phase error was detected. 0 5 enclk_int indicates that and encoder clock pulse was detected. 0 6 pos0_int indicates that the position 0 compare value is equal to the current position. 0 7 pos1_int indicates that the position 1compare value is equal to the current position. 0 8 pos2_int indicates that the position 2 compare value is equal to the current position. 0 9 rev_int indicates that the index compare value is equal to the current index count. 0 10 pos0rev_int combined position 0 and revolution count interrupt. set when both the pos0_int bit is set and the rev_int is set. 0 11 pos1rev_int combined position 1 and revolution count interrupt. set when both the pos1_int bit is set and the rev_int is set. 0 12 pos2rev_int combined position 2 and revolution count interrupt. set when both the pos2_int bit is set and the rev_int is set. 0 13 rev1_int indicates that the index 1 compare value is equal to the current index count. 0 14 rev2_int indicates that the index 2 compare value is equal to the current index count. 0 15 maxpos_int indicates that the current position count goes through the maxpos value to zero in forward direction, or through zero to maxpos in backward direction. 0 31:16 - reserved 0 table 600: qei interrupt clear register (clr - 0x400c 6fe8) bit description bit symbol description reset value 0 inx_int indicates that an index pulse was detected. 0 1 tim_int indicates that a velocity timer overflow occurred 0 2 velc_int indicates that captured velo city is less than compare velocity. 0 3 dir_int indicates that a change of direction was detected. 0 4 err_int indicates that an encoder phase error was detected. 0 5 enclk_int indicates that and encoder clock pulse was detected. 0 6 pos0_int indicates that the position 0 compare value is equal to the current position. 0 7 pos1_int indicates that the position 1compare value is equal to the current position. 0 8 pos2_int indicates that the position 2 compare value is equal to the current position. 0 9 rev_int indicates that the index compare value is equal to the current index count. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 680 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.6.3.6 qei interrupt set register writing a one to a bit in this register sets th e corresponding bit in the qei interrupt status register (stat). 27.7 functional description the qei module interprets the two-bit gray code produced by a quadrature encoder wheel to integrate position over time and determine direction of rotation. in addition, it can capture the velocity of the encoder wheel. 10 pos0rev_int combined position 0 and revolution count interrupt. set when both the pos0_int bit is set and the rev_int is set. 0 11 pos1rev_int combined position 1 and revolution count interrupt. set when both the pos1_int bit is set and the rev_int is set. 0 13 rev1_int indicates that the index 1 compare value is equal to the current index count. 0 14 rev2_int indicates that the index 2 compare value is equal to the current index count. 0 15 maxpos_int indicates that the current position count goes through the maxpos value to zero in forward direction, or through zero to maxpos in backward direction. 0 31:16 - reserved 0 table 600: qei interrupt clear register (clr - 0x400c 6fe8) bit description bit symbol description reset value table 601: qei interrupt set register (set - address 0x400c 6fec) bit description bit symbol description reset value 0 inx_int indicates that an index pulse was detected. 0 1 tim_int indicates that a velocity timer overflow occurred 0 2 velc_int indicates that captured velocity is less than compare velocity. 0 3 dir_int indicates that a change of direction was detected. 0 4 err_int indicates that an encoder phase error was detected. 0 5 enclk_int indicates that and encoder clock pulse was detected. 6 pos0_int indicates that the position 0 compare value is equal to the current position. 0 7 pos1_int indicates that the position 1compare value is equal to the current position. 0 8 pos2_int indicates that the position 2 compare value is equal to the current position. 0 9 rev_int indicates that the index compare value is equal to the current index count. 0 10 pos0rev_int combined position 0 and revolution count interrupt. set when both the pos0_int bit is set and the rev_int is set. 0 11 pos1rev_int combined position 1 and revolution count interrupt. set when both the pos1_int bit is set and the rev_int is set. 0 12 pos2rev_int combined position 2 and revolution count interrupt. set when both the pos2_int bit is set and the rev_int is set. 0 13 rev1_int indicates that the index 1 compare value is equal to the current index count. 0 14 rev2_int indicates that the index 2 compare value is equal to the current index count. 0 15 maxpos_int indicates that the current position count goes thro ugh the maxpos value to zero in forward direction, or through zero to maxpos in backward direction. 0 31:16 - reserved 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 681 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) 27.7.1 input signals the qei module supports two modes of signal operation: quadrature phase mode and clock/direction mode. in quadrature phase mode, the encoder produ ces two clocks that are 90 degrees out of phase; the edge relation ship is used to determine the direction of rotation. in clock/direction mode, the encoder produces a clock signal to indicate steps and a direction signal to indica te the direction of rotation.). this mode is determined by the sigmode bi t of the qei control (con) register (see table 575 ). when the sigmode bit = 1, the quadr ature decoder is bypassed and the pha pin functions as the direction signal and phb pin functions as the clock signal for the counters, etc. when the sigmode bit = 0, t he pha pin and phb pins are decoded by the quadrature decoder. in this mode the quad rature decoder produces the direction and clock signals for the counters, etc. in both mo des the direction signal is subject to the effects of the directio n invert (dirinv) bit. 27.7.1.1 quadrature input signals when edges on pha lead edges on phb, the position counter is incremented. when edges on phb lead edges on pha, the positi on counter is decremented. when a rising and falling edge pair is seen on one of the phases without any ed ges on the other, the direction of rotation has changed. [1] all other state transitions are illegal and should set the err bit. interchanging of the pha and phb input signals are compensated by complementing the dir bit. when set = 1, the direction invers ion bit (dirinv) complements the dir bit. table 602. encoder states phase a phase b state 101 112 013 004 table 603. encoder state transitions [1] from state to state direction 1 2 positive 23 34 41 4 3 negative 32 21 14 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 682 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) figure 81 shows how quadrature encoder signals equate to direction and count. 27.7.1.2 digital input filtering all three encoder inputs (pha, phb, and index) require digital filtering. the number of sample clocks is user programmable from 1 to 4,294,967,295 (0xffff ffff). in order for a transition to be accepted, the input signal must remain in new state for the programmed number of sample clocks. 27.7.2 position capture the capture mode for the position integrator can be set to update the position counter on every edge of the pha signal or to update on every edge of both pha and phb. updating the position counter on every pha and phb provid es more positional resolution at the cost of less range in the positional counter. the position integrator and velocity captur e can be independently enabled. alternatively, the phase signals can be interpreted as a clo ck and direction signal as output by some encoders. the position counter is automatically reset on one of three conditions. incrementing past the maximum position value (maxpos) will reset the position counter to zero. if the reset on index bit (respi) is set, se nsing the index pulse for the first time will once reset the position counter to zero after the next positi onal increase (calibrate). if the continuously reset on index bit (crespi) is set, sensing the index pulse will cont inuously reset the position counter to zero after the next positional increase (recalibrate). 27.7.3 velocity capture the velocity capture has a programmable timer and a capture register. it counts the number of phase edges (using the same confi guration as for the position integrator) in a given time period. when the velocity timer (t ime) overflows the contents of the velocity counter (vel) are transferred to the capture (cap) register. the velocity counter is then table 604. encoder direction dir bit dirinv bit direction 00forward 1 0 reverse 0 1 reverse 11forward fig 81. quadrature encoder basic operation pha phb direction position -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +1 +1 +1 +1 +1 +1 +1 +1 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 683 of 1164 nxp semiconductors UM10430 chapter 27: lpc18xx quadrature encoder interface (qei) cleared. the velocity timer is loaded with th e contents of the velocity reload register (load). finally, the velocity interrupt (tim_int ) is asserted. the number of edges counted in a given time period is directly proportional to the velocity of the encoder. setting the reset velocity bi t (resv) will clear the velocity counter, reset the velocity capture register to 0xffff ffff, and load the velocity timer with the contents of the velocity reload register (load). the following equation converts the veloci ty counter value in to an rpm value: rpm = (pclk ? speed ? 60) / load ? ppr ? edges) where: ? pclk is the qei controller clock. ? ppr is the number of pulses per revolution of the physical encoder. ? edges is 2 or 4, based on the capture mode set in the con register (2 for capmode set to 0 and 4 for capmode set to 1) for example, consider a motor running at 600 rpm. a 2048 pulse per revolution quadrature encoder is attached to the moto r, producing 8192 phase edges per revolution. with clocking on both pha and phb edges, this results in 81,920 pulses per second (the motor turns 10 times per second). if the time r were clocked at 10,000 hz, and the load value was 2,500 (? of a second), it would count 20,480 pulses per update. using the above equation: rpm = (10000 ? 20480 ? 60) / (2500 ? 2048 ? 4) = 600 rpm now, consider that the motor is sped up to 3000 rpm. this results in 409,600 pulses per second, or 102,400 every ? of a sec ond. again, the above equation gives: rpm = (10000 ? 102400 ? 60) / (2500 ? 2048 ? 4) = 3000 rpm 27.7.4 velocity compare in addition to velocity capture, the velocity measurement system includes a programmable velocity compare register. after every velocity captur e event the contents of the velocity capture register (cap) is compared with the contents of the velocity compare register (velcomp). if the captured velocity is less than the compare value an interrupt is asserted provided that the velocity compare interrupt enable bit is set. this can be used to determine if a motor shaft is either stalled or moving too slow. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 684 of 1164 28.1 how to read this chapter the rit is available on all lpc18xx parts. 28.2 basic configuration the rit is configured as follows: ? see ta b l e 6 0 5 for clocking and power control. ? the rit is reset by the ritimer_rst (reset #36). ? the rit interrupt is connected to slot # 11 in the nvic. 28.3 features ? 32-bit counter running from pclk. counter can be free-running, or be reset by a generated interrupt. ? 32-bit compare value. ? 32-bit compare mask. an interrupt is generated when the counter value equals the compare value, after masking. this allows for co mbinations not poss ible with a simple compare. 28.4 general description the repetitive interrupt timer provides a ve rsatile means of generating interrupts at specified time intervals, without using a st andard timer. it is intended for repeating interrupts that aren?t related to operating syst em interrupts. however, it could be used as an alternative to the cort ex-m3 system tick timer if there are different system requirements. UM10430 chapter 28: lpc18xx repetiti ve interrupt timer (rit) rev. 00.13 ? 20 july 2011 user manual table 605. rit clocking and power control base clock branch clock maximum frequency clock to the ri timer register interface and ri timer peripheral clock. base_m3_clk clk_m3_ritimer 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 685 of 1164 nxp semiconductors UM10430 chapter 28: lpc18xx repetitive interrupt timer (rit) 28.5 register description [1] reset value reflects the data stored in used bits only. it does not include content of reserved bits. 28.5.1 ri compare value register 28.5.2 ri mask register 28.5.3 ri control register table 606. register overview: repetitive inte rrupt timer (rit) (base address 0x400c 0000) name access address description reset value [1] compval r/w 0x000 compare register 0xffff ffff mask r/w 0x004 mask register. this register holds the 32-bit mask value. a ?1? written to any bit will force a compare on the corresponding bit of the counter and compare register. 0 ctrl r/w 0x008 control register. 0xc counter r/w 0x00c 32-bit counter 0 table 607. ri compare value register (compval - address 0x400c 0000) bit description bit symbol description reset value 31:0 ricomp compare register. holds the compare value which is compared to the counter. 0xffff ffff table 608. ri mask register (mask - address 0x400c 0004) bit description bit symbol description reset value 31:0 rimask mask register. this register ho lds the 32-bit mask value. a one written to any bit overrides the result of the comparison for the corresponding bit of the counter and compare regist er (causes the comparison of the register bits to be always true). 0 table 609. ri control register (ctrl - address 0x400c 0008) bit description bit symbol value description reset value 0 ritint interrupt flag 0 1 this bit is set to 1 by hardware whenever the counter value equals the masked compare value specified by the contents of ricompval and rimask registers. writing a 1 to this bit will clear it to 0. writing a 0 has no effect. 0 the counter value does not equal the masked compare value. 1 ritenclr timer enable clear 1 the timer will be cleared to 0 whenever the counter value equals the masked compare value specified by the contents of ricompval and rimask registers. this will occur on the same clock that se ts the interrupt flag. 0 0 the timer will not be cleared to 0. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 686 of 1164 nxp semiconductors UM10430 chapter 28: lpc18xx repetitive interrupt timer (rit) 28.5.4 ri counter register 28.6 ri timer operation following reset, the counter begins counting up from 0x00000000. whenever the counter value equals the value progra mmed into the ricompval regist er the interrupt flag will be set. any bit or combination of bits can be removed from this comparison (i.e. forced to compare) by writing a ?1? to the corresponding bit(s) in the rimask register. if the enable_clr bit is low (default state), a valid comparison only causes the interrupt flag to be set. it has no effect on the count seque nce. counting continues as usual. when the counter reaches 0xffffffff it rolls-over to 0x00000000 on the next clock and continues counting. if the enable_clr bit is set to ?1? a valid comparison will also cause the counter to be reset to zero. counting will resume from there on the next clock edge. counting can be halted in soft ware by writing a ?0? to the enable_timer bit - rictrl(2). counting will also be halted wh en the processor is halted for debugging provided the enable_break bit ? rictrl(1) is set. both the enable_timer and enable_break bits are set on reset. the interrupt flag can be cleared in software by writing a ?1? to the interrupt bit ? rictrl(0). software can load the counter to any value at any time by writing to ricounter. the counter (ricounter), rico mpval register, rimask regi ster and rictrl register can all be read by software at any time. 2 ritenbr timer enable for debug 1 1 the timer is halted when the processor is halted for debugging. 0 debug has no effect on the timer operation. 3riten timer enable. 1 1 timer enabled. remark: this can be overruled by a debug halt if enabled in bit 2. 0 timer disabled. 31:4 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 609. ri control register (ctrl - address 0x400c 0008) bit description bit symbol value description reset value table 610. ri counter register (counter - address 0x400c 000c) bit description bit symbol description reset value 31:0 ricounter 32-bit up counter. counts continuously unless riten bit in rictrl register is cleared or debug mode is entered (if enabled by the ritnebr bit in rictrl). can be loaded to any value in software. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 687 of 1164 nxp semiconductors UM10430 chapter 28: lpc18xx repetitive interrupt timer (rit) fig 82. ri timer block diagram 32-bit counter clr ena comparator compare register set mask register set 3 2 s c clr eq 0 enable_timer enable_break break intr pbus pbus pbus reset reset reset set_int 32 32 32 32 pbus write '1' to clear pbus pbus pbus clr reset pbus pbus pbus cnt_ena ctrl register clr reset enable_clk www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 688 of 1164 29.1 how to read this chapter the alarm timer is identical on all lpc18xx parts. 29.2 basic configuration the alarm timer is configured as follows: ? see ta b l e 6 11 for clocking and power control. the 32 khz output of the 32 khz oscillator must be enabled in the cr eg0 register in the creg block (see ta b l e 3 1 ). ? ? the alarm timer interrupt is connected to slot # 4 in the event router. 29.3 general description the alarm timer is a 16-bit timer and counts down from a preset value. the counter triggers a status bit when it reaches 0x00 and asserts an interrupt if enabled. the alarm timer operates in the rtc power domain. it consists of a 16-bit counter (downcounter) running at a 1024 hz clock. the 1024 hz clock is derived from the 32 khz crystal clock. the alarm timer is inactive when this clock is not active. the alarm timer counts down from an initia l value preset. when it reaches 0x0 and the interrupt is enabled (via set_en), bit st atus is triggered. the counter continues counting down starting from preset. status is propagated to the interrupt output. the interrupt is connected to the event router and can be used to wake up the device from a low power mode. UM10430 chapter 29: lpc18xx alarm timer rev. 00.13 ? 20 july 2011 user manual table 611. alarm timer cloc king and power control base clock branch clock maximum frequency clock to alarm timer register in terface base_m3_clk clk_m3_bus 150 mhz 32 khz crystal osci llator output for the counter/timer clock - - 1024 hz (fixed frequency) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 689 of 1164 nxp semiconductors UM10430 chapter 29: lpc18xx alarm timer 29.4 register description 29.4.1 downcounter register 29.4.2 preset value register 29.4.3 interrupt clear enable register table 612. register overview: alarm timer (base address 0x4004 0000) name access address offset description reset value downcounter r/w 0x000 downcounter register 0x000 preset r/w 0x004 preset value register 0x000 - - 0x008 - 0xfd4 reserved - clr_en w 0xfd8 interrupt clear enable register 0x0 set_en w 0xfdc interrupt set enable register 0x0 status r 0xfe0 status register 0x0 enable r 0xfe4 enable register 0x0 clr_stat w 0xfe8 clear register 0x0 set_stat w 0xfec set register 0x0 table 613. downcounter register (dow ncounter - 0x4004 0000) bit description bit symbol description reset value 15:0 cval when equal to zero an interrupt is raised. when equal to zero preset is loaded and counting continues. 0x0 31:16 - reserved. - table 614. preset value register (p reset - 0x4004 0004) bit description bit symbol description reset value 15:0 presetval value loaded in downcounter when downcounter equals zero 31:16 - reserved. - table 615. interrupt clear enable register (clr_en - 0x4004 0fd8) bit description bit symbol description reset value 0 clr_en writing a 1 to this bit clears the interrupt enable bit in the enable register. - 31:1 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 690 of 1164 nxp semiconductors UM10430 chapter 29: lpc18xx alarm timer 29.4.4 interrupt set enable register 29.4.5 interrupt status register 29.4.6 interrupt enable register 29.4.7 clear status register 29.4.8 set status register table 616. interrupt set enable register (set_en - 0x4004 0fdc) bit description bit symbol description reset value 0 set_en writing a 1 to this bit sets the interrupt enable bit in the enable register. 0 31:1 - reserved. - table 617. interrupt status register (status - 0x4004 0fe0) bit description bit symbol description reset value 0 stat a 1 in this bit shows that the status interrupt has been raised. 0 31:1 - reserved. - table 618. interrupt enable register (enable - 0x4004 0fe4) bit description bit symbol description reset value 0 en a 1 in this bit shows that the status interrupt has been enabled and that the status interrupt request signal is asserted when stat = 1 in the status register. 0 31:1 - reserved. - table 619. interrupt clear status register (clr_stat - 0x4004 0fe8) bit description bit symbol description reset value 0 cstat writing a 1 to this bit clears the status interrupt bit in the status register. 0 31:1 - reserved. - table 620. interrupt set status register (set_stat - 0x4004 0fec) bit description bit symbol description reset value 0 sstat writing a 1 to this bit sets the status interrupt bit in the status register. 0 31:1 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 691 of 1164 30.1 how to read this chapter the wwdt is identical for all lpc18xx parts. 30.2 basic configuration the wwdt is configured as follows: ? see ta b l e 6 2 1 for clocking and power control. the only clock source for the wwdt clock (wdclk) is the irc. ? the wwdt cannot be reset by software. ? the wwdt interrupt is connected to slot # 7 in the event router. 30.3 features ? internally resets chip if not reloaded during the programmable time-out period. ? optional windowed operation requires reload to occur between a minimum and maximum time-out period, both programmable. ? optional warning interrupt can be generated at a programmable time prior to watchdog time-out. ? programmable 24 bit timer with internal fixed pre-scaler. ? selectable time period from 1,024 watchdog clocks (t wdclk ? 256 ? 4) to over 67 million watchdog clocks (t wdclk ? 2 24 ? 4) in increments of 4 watchdog clocks. ? safe watchdog operation. once enabled, requires a hardware reset or a watchdog reset to be disabled. ? incorrect feed sequence causes i mmediate watchdog reset if enabled. ? the watchdog reload value can optionally be protected such that it can only be changed after the ?warning interrupt? time is reached. ? flag to indicate watchdog reset. ? the wwdt uses the irc as a fixed clock source. UM10430 chapter 30: lpc18xx windowe d watchdog timer (wwdt) rev. 00.13 ? 20 july 2011 user manual table 621. wwdt clocking and power control base clock branch clock maximum frequency clock to wwdt register interface (pclk) base_m3_clk clk_m3_wwdt 150 mhz watchdog clock (wdclk) base_safe_clk - 12 mhz (fixed frequency) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 692 of 1164 nxp semiconductors UM10430 chapter 30: lpc18xx windowed watchdog timer (wwdt) 30.4 applications the purpose of the watchdog timer is to reset the microcontroller within a reasonable amount of time if it enters an erroneous state. when enabled, a watchdog event will be generated if the user program fails to feed (or reload) the watchdog within a predetermined amoun t of time. the watchdog event will ca use a chip reset if configured to do so. when a watchdog window is programmed, an early watchdog feed is also treated as a watchdog event. this allows preventing situat ions where a system failure may still feed the watchdog. for example, application code co uld be stuck in an interrupt service that contains a watchdog feed. setting the window su ch that this would result in an early feed will generate a watchdog event, a llowing for system recovery. 30.5 description the watchdog consists of a fixed divide by 4 pre-scaler and a 24-bit counter which decrements on every clock cycle. the minimum value from which the counter decrements is 0xff. setting a value lower than 0xff causes 0xff to be loaded in the counter. hence the minimum watchdog interval is (t wdclk ? 256 ? 4) and the maximum watchdog interval is (t wdclk ? 2 24 ? 4) in multiples of (t wdclk ? 4). the watchdog should be used in the following manner: ? set the watchdog time-out value in tc register. ? setup the watchdog timer operating mode in mod register. ? set a value for the watchdog window time in window register if windowed operation is required. ? set a compare value for the watchdog warni ng interrupt in the warnint register if a warning interrup t is required. ? enable the watchdog by writing 0xaa followed by 0x55 to the feed register. ? the watchdog must be fed again before the watchdog counter reaches zero in order to prevent a watchdog event. if a window value is programmed, the feed must also occur after the watchdog co unter passes that value. when the watchdog timer is co nfigured so that a watchdo g event will caus e a reset and the counter reaches zero, t he cpu will be reset, loading th e stack pointer and program counter from the vector table as in the case of external reset. the watchdog time-out flag (wdtof) can be examined to determine if the watchdog has caused the reset condition. the wdtof flag must be cleared by software. when the watchdog timer is co nfigured to genera te a warning interr upt, the interrupt will occur when the counter matches the compare value defined by the warnint register. 30.5.1 wwdt behavior in debug mode if code execution is halted in debug mode, the wwdt stops counting until code execution resumes. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 693 of 1164 nxp semiconductors UM10430 chapter 30: lpc18xx windowed watchdog timer (wwdt) 30.6 clocking the watchdog timer block uses two clocks: pc lk and wdclk. pclk is used for the apb accesses to the watchdog registers and is derived from the base_m3_clk. the wdclk is used for the watchdog timer counting and is derived from the irc. the clock source (the irc) is fixed to ensure that the wdt always has a valid clock. there is some synchronization logic between these two clock domains. when the mod and tc registers are updated by apb operatio ns, the new value will ta ke effect in three wdclk cycles on the logic in the wdclk cl ock domain. when the watchdog timer is counting the wdclk clock cycles , the synchronization logic will first lock the value of the counter on wdclk and then synchronize it with the pclk for reading as the tv register by the cpu. 30.7 register description the watchdog contains six registers as shown in table 622 below. [1] reset value reflects the data stored in used bi ts only. it does not include reserved bits content. 30.7.1 watchdog mode register the wdmod register controls the operation of the watchdog as per the combination of wden and reset bits. note that a watchdog feed must be performed before any changes to the wdmod register take effect. table 622. register overview: watchdog timer (base address 0x4008 0000) name access address offset description reset value [1] mod r/w 0x000 watchdog mode register. this register contains the basic mode and status of the watchdog timer. 0 tc r/w 0x004 watchdog timer constant register. this register determines the time-out value. 0xff feed wo 0x008 watchdog feed sequence register. writing 0xaa followed by 0x55 to this register reloads the watchdog timer with the value contained in wdtc. na tv ro 0x00c watchdog timer value register. this register reads out the current value of the watchdog timer. 0xff - - 0x010 reserved - warnint r/w 0x014 watchdog warning interrupt register. this register contains the watchdog warning interrupt compare value. 0 window r/w 0x018 watchdog timer window register. this register contains the watchdog window value. 0xff ffff www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 694 of 1164 nxp semiconductors UM10430 chapter 30: lpc18xx windowed watchdog timer (wwdt) once the wden , wdprotect , or wdreset bits are set they can not be cleared by software. both flags are cleared by an external reset or a watchdog timer reset. wdtof the watchdog time-out flag is set when the watchdog times out, when a feed error occurs, or when wdprotect =1 and an attempt is made to write to the tc register. this flag is cleared by software writing a 0 to this bit. wdint the watchdog interrupt flag is set when the watchdog counter reaches the value specified by wdwarnint. this flag is cleared when any reset occurs, and is cleared by software by writing a 1 to this bit. watchdog reset or interrupt will occur any ti me the watchdog is running and has an operating clock source. any clock source works in sleep mode, and the irc works in deep-sleep mode. if a watchdog interrupt occurs in sleep or deep-sleep mode, it will wake up the device. table 623. watchdog mode register (mod - 0x4008 0000) bit description bit symbol value description reset value 0 wden watchdog enable bit. this bit is set only. 0 0 the watchdog timer is stopped. 1 the watchdog timer is running. 1 wdreset watchdog reset enable bit. this bit is set only. 0 0 a watchdog time-out will not cause a chip reset. 1 a watchdog time-out will cause a chip reset. 2 wdtof watchdog time-out flag. set when the watchdog timer times out, by a feed error, or by events associated with wdpr otect, cleared by software. causes a chip reset if wdreset = 1. this flag is cleared by software writing a 0 to this bit. 0 (only after external reset) 3 wdint watchdog interrupt flag. set when the timer reaches the value in the warnint register. cleared by software by writing a 1 to this bit. 0 4 wdprotect watchdog update mode. this bit is set only. 0 0 the watchdog time-out value (wdtc) can be changed at any time. 1 the watchdog time-out value (wdtc) can be changed only after the counter is below the value of wdwarnint and wdwindow. 7:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 695 of 1164 nxp semiconductors UM10430 chapter 30: lpc18xx windowed watchdog timer (wwdt) 30.7.2 watchdog timer constant register the tc register determines the time-out valu e. every time a feed sequence occurs, the tc register content is reloaded into the watchdog timer. this is pre-loaded with the value 0x00 00ff upon reset. writing values belo w 0xff will cause 0x00 00ff to be loaded into the tc register. thus the minimum time-out interval is t wdclk ? 256 ? 4. if the wdprotect bit in mod register is set to one, an attempt to change the value of tc before the watchdog counter is below the values of wdwarnint and wdwindow will cause a watchdog reset and set the wdtof flag. 30.7.3 watchdog feed register writing 0xaa followed by 0x55 to this regist er will reload the watchdog timer with the time-out value in the tc regist er. this operation will also start the watchdog if it is enabled via the mod register. setting th e wden bit in the wdmod register is not sufficient to enable the watchdog. a valid feed sequence must be completed after setting wden before the watchdog is capable of generating a reset. until then, the watchdog will ignore feed errors. after writing 0xaa to feed register, access to any watchdog register other than writing 0x55 to feed register caus es an immediate reset/interrupt when the watchdog is enabled, and sets the wdtof fl ag. the reset will be generated during the second pclk following an incorrect access to a watchdog register during a feed sequence. interrupts should be disabled during the feed sequence. an abo rt condition will occur if an interrupt happens during the feed sequence. table 624. watchdog operating modes selection wden wdreset mode of operation 0 x (0 or 1) debug/operate without the watchdog running. 1 0 watchdog interrupt mode: the watchdog warning interrupt will be generated but watchdog reset will not. when this mode is selected, the wa tchdog counter reaching the value specified by wdwarnint will set the wdint flag and the watchdog interrupt request will be generated. 1 1 watchdog reset mode: both the watc hdog interrupt and watchdog reset are enabled. when this mode is selected, the wa tchdog counter reaching the value specified by wdwarnint will set the wdint flag and the watchdog interrupt request will be generated. the watchdog counter reaching zero will reset the microcontroller. remark: other causes for a watchdog reset are: a watchdog feed or changing the wdtc value (if the wdprotect bit is set in the mod register) before reaching the value of wdwindow. table 625. watchdog timer constant register (tc - 0x4008 0004) bit description bit symbol description reset value 23:0 wdtc watchdog time-out value. 0x00 00ff 31:24 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 696 of 1164 nxp semiconductors UM10430 chapter 30: lpc18xx windowed watchdog timer (wwdt) 30.7.4 watchdog timer value register the wdtv register is used to read the current value of watchdog timer counter. when reading the value of the 24 bit counter, the lock and synchronization procedure takes up to 6 wdclk cycles plus 6 pclk cycles, so the value of wdtv is older than the actual value of the timer when it's being read by the cpu. 30.7.5 watchdog timer warn ing interrupt register the wdwarnint register determines t he watchdog timer counter value that will generate a watchdog interrupt. when the watchdog timer counter matches the value defined by wdwarnint, an interrupt will be generated af ter the subseq uent wdclk. a match of the watchdog timer counter to wdwarnint occurs when the bottom 10 bits of the counter have the same value as the 10 bits of warnint, and the remaining upper bits of the counter are all 0. this gives a maximum time of 1,023 watchdog timer counts (4,096 watchdog clocks) for the interrupt to occur prior to a watchdog event. if wdwarnint is set to 0, the interrupt will occu r at the same time as the watchdog event. 30.7.6 watchdog time r window register the wdwindow register determines the high est wdtv value allowed when a watchdog feed is performed. if a feed valid sequence comp letes prior to wdtv reaching the value in wdwindow, a watchdog event will occur. wdwindow resets to the maximum possible wdtv value, so windowing is not in effect. values of wdwindow below 0x100 will make it impossible to ever feed the watchdog successfully. table 626. watchdog feed register (f eed - 0x4008 0008) bit description bit symbol description reset value 7:0 feed feed value should be 0xaa followed by 0x55. na table 627. watchdog timer value register (tv - 0x4008 000c) bit description bit symbol description reset value 23:0 count counter timer value. 0x00 00ff 31:24 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 628. watchdog timer wa rning interrupt register (warnint - 0x4008 0014) bit description bit symbol description reset value 9:0 wdwarnint watchdog warning interrupt compare value. 0 31:10 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 697 of 1164 nxp semiconductors UM10430 chapter 30: lpc18xx windowed watchdog timer (wwdt) 30.8 block diagram the block diagram of the watchdog is shown below in the figure 83 . the synchronization logic (pclk - wdclk) is not shown in the block diagram. 30.9 watchdog timing examples the following figures illu strate several aspects of watc hdog timer operation is shown below in figure 84 . table 629. watchdog timer window register (window - 0x4008 0018) bit description bit symbol description reset value 23:0 wdwindow watchdog window value. 0xff ffff 31:24 - reserved, user software shou ld not write ones to reserved bits. the value read from a reserved bit is not defined. na fig 83. watchdog block diagram watchdog interrupt wdreset (wdmod[1]) wdtof (wdmod[2]) wdint (wdmod[3]) wden (wdmod[0]) chip reset 4 feed error feed ok wd_clk enable count wdmod register compare wdtv compare in range underflow feed sequence detect and protection wdfeed feed ok feed ok compare 0 interrupt compare wdclksel clock select 24-bit down counter wdintval wdwind wdtc shadow bit wdprotect (wdmod[4]) wdtc write www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 698 of 1164 nxp semiconductors UM10430 chapter 30: lpc18xx windowed watchdog timer (wwdt) fig 84. early watchdog feed with windowed mode enabled 125a 1258 1259 1257 wdclk / 4 watchdog counter early feed event watchdog reset conditions: wdwindow = 0x1200 wdwarnint = 0x3ff wdtc = 0x2000 fig 85. correct watchdog feed with windowed mode enabled correct feed event 1201 11ff 1200 wdclk / 4 watchdog counter watchdog reset 11fc 11fd 2000 1ffe 1fff 11fe 1ffd 1ffc conditions: wdwindow = 0x1200 wdwarnint = 0x3ff wdtc = 0x2000 fig 86. watchdog warning interrupt watchdog interrupt 0403 0401 0402 wdclk / 4 watchdog counter 03fe 03ff 03fd 03fb 03fc 0400 03fa 03f9 conditions: wdwindow = 0x1200 wdwarnint = 0x3ff wdtc = 0x2000 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 699 of 1164 31.1 how to read this chapter on parts lpc1850/30/20/10 rev ?a?, the func tion of the alarm pin rtc_alarm must be configured in the creg0 register ( table 31 ). 31.2 basic configuration the rtc is configured as follows: ? see ta b l e 6 3 0 for clocking and power control. the 1 khz output of the 32 khz oscillator must be enabled in the cr eg0 register in the creg block (see ta b l e 3 1 ). ? the rtc interrupt is connected to slot # 5 in the event router. ? remark: after initializing the 32 khz oscillator, wait for 2 sec before writin g to the rtc registers. 31.3 features ? measures the passage of time to maintain a calendar and clock. provides seconds, minutes, hours, day of month, month, year, day of week, and day of year. ? ultra-low power design to support batter y powered systems. uses power from the cpu power supply when it is present. ? dedicated battery power supply pin. ? rtc power supply is isolated from the rest of the chip. ? calibration counter allows adjustment to better than ? 1 sec/day with 1 sec resolution. ? periodic interrupts can be generated from increments of any field of the time registers and selected fractional second values. ? alarm interrupt can be generated for a specific date/time. 31.4 general description the real time clock (rtc) is a set of count ers for measuring time when system power is on, and optionally when it is off. it uses very little power when its registers are not being accessed by the cpu, especially reduced power modes. on the lpc18xx, the rtc is clocked by a separate 32 khz oscillator that pr oduces a 1 hz internal time reference. the rtc is powered by its own power supply pin, vbat, . UM10430 chapter 31: lpc18xx real-time clock (rtc) rev. 00.13 ? 20 july 2011 user manual table 630. rtc clocking and power control base clock branch clock maximum frequency clock to alarm timer register in terface base_m3_clk clk_m3_bus 150 mhz 32 khz crystal osci llator output for the counter/timer clock - - 1024 hz (fixed frequency) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 700 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) 31.5 pin description fig 87. rtc functional block diagram day of year second minute hour day month year alarm compare second minute hour day month year day of week calibration counter calibration compare register calibration control logic calibration compare sign bit match counter reset lsb set lsb out time registers alarm registers calibration alarm out and alarm interrupts counter increment interrupts 1 hz clock table 631. rtc pin description pin direction description rtc_alarm o rtc controlled output. this is a 1.8 v pin. it goes high when a rtc alarm is generated. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 701 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) 31.6 register description [1] this register value is not changed by reset. in addition to the rtc registers, 64 general purpose registers are available to store data when the main power supply is switched off. the general purpose registers reside in the rtc power domain and can be battery powered. table 632. register overview: rtc (base address 0x4004 6000) name access address offset description reset value ilr w 0x000 interrupt location register 0x0 - - 0x004 reserved 0x00 ccr r/w 0x008 clock control register 0x00 ciir r/w 0x00c counter increment interrupt register 0x00 amr r/w 0x010 alarm mask register - [1] ctime0 r 0x014 consolidated time register 0 - [1] ctime1 r 0x018 consolidated time register 1 - [1] ctime2 r 0x01c consolidated time register 2 - [1] sec r/w 0x020 seconds register - [1] min r/w 0x024 minutes register - [1] hrs r/w 0x028 hours register - [1] dom r/w 0x02c day of month register - [1] dow r/w 0x030 day of week register - [1] doy r/w 0x034 day of year register - [1] month r/w 0x038 months register - [1] year r/w 0x03c years register - [1] calibration r/w 0x040 calibration value register - [1] - - 0x044 - 0x05c - asec r/w 0x060 alarm value for seconds - [1] amin r/w 0x064 alarm value for minutes - [1] ahrs r/w 0x068 alarm value for hours - [1] adom r/w 0x6c alarm value for day of month - [1] adow r/w 0x070 alarm value for day of week - [1] adoy r/w 0x074 alarm value for day of year - [1] amon r/w 0x078 alarm value for months - [1] ayrs r/w 0x07c alarm value for year - [1] table 633. register overview: regfile (base address 0x4004 1000) name access address offset description reset value regfile0 r/w 0x000 general purpose storage register 0x0 to regfile63 r/w 0x0fc general purpose storage register 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 702 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) 31.6.1 interrupt loc ation register the interrupt location register is a 2-bit register that specifies which blocks are generating an interrupt (see ta b l e 6 3 4 ). writing a one to the appropriate bit clears the corresponding interrupt. writing a zero has no effect. this allows the programmer to read this register and write back the same value to clear only the interrupt that is detected by the read. 31.6.2 clock control register the clock register is a 4-bit regi ster that controls the operation of the clock divide circuit. each bit of the clock r egister is described in ta b l e 6 3 5 . bits 0, 1, and 4 in this register should be initialized when the rtc is first turned on. [1] this register value is not changed by reset. table 634. interrupt location register (ilr - address 0x4004 6000) bit description bit symbol description reset value 0 rtccif when one, the counter increment interrupt block generated an interrupt. writing a one to this bit location clears the counter increment interrupt. 0 1 rtcalf when one, the alarm registers generated an interrupt. writing a one to this bit location clears the alarm interrupt. 0 31:2 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 635. clock control register (ccr - address 0x4004 6008) bit description bit symbol value description reset value 0 clken clock enable. - [1] 0 the time counters are disabled so that they may be initialized. 1 the time counters are enabled. 1 ctcrst ctc reset. 0 0no effect. 1 when one, the elements in the internal oscillator divider are reset, and remain reset until ccr[1] is changed to zero. this is the divider that generates the 1 hz clock from the 32.768 khz crystal. the state of the divider is not visible to software. 3:2 - internal test mode controls. these bits must be 0 for normal rtc operation. - [1] 4 ccalen calibration counter enable. - [1] 0 the calibration counter is enabled and counting, using the 1 hz clock. when the calibration counter is equal to the value of the calibration register, the counter resets and repeats counting up to the value of the calibration register. see section 31.6.6.2 and section 31.7.1 . 1 the calibration counter is disabled and reset to zero. 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 703 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) 31.6.3 counter increment interrupt register the counter increment interrupt register (ciir) give s the ability to gene rate an interrupt every time a counter is incremented. this inte rrupt remains valid until cleared by writing a 1 to bit 0 of the interrupt location register (ilr[0]). 31.6.4 alarm mask register the alarm mask register (amr) allows the us er to mask any of the alarm registers. table 637 shows the relationship between the bits in the amr and the alarms. for the alarm function, every non-masked alarm register must match the corresponding time counter for an interrupt to be generated. the interrupt is generated only when the counter comparison first changes from no match to match. the interrupt is removed when a one is written to the appropriate bit of the interrupt location register (ilr). if all mask bits are set, then the alarm is disabled. table 636. counter increment interrupt register (ciir - address 0x4004 600c) bit description bit symbol description reset value 0 imsec when 1, an increment of the second value generates an interrupt. 0 1 immin when 1, an increment of the minute value generates an interrupt. 0 2 imhour when 1, an increment of the hour value generates an interrupt. 0 3 imdom when 1, an increment of the day of month value generates an interrupt. 0 4 imdow when 1, an increment of the day of week value generates an interrupt. 0 5 imdoy when 1, an increment of the day of year value generates an interrupt. 0 6 immon when 1, an increment of the month value generates an interrupt. 0 7 imyear when 1, an increment of t he year value generates an interrupt. 0 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 637. alarm mask register (amr - address 0x4004 6010) bit description bit symbol description reset value 0 amrsec when 1, the second value is not compared for the alarm. 0 1 amrmin when 1, the minutes value is not compared for the alarm. 0 2 amrhour when 1, the hour value is not compared for the alarm. 0 3 amrdom when 1, the day of month value is not compared for the alarm. 0 4 amrdow when 1, the day of week value is not compared for the alarm. 0 5 amrdoy when 1, the day of year value is not compared for the alarm. 0 6 amrmon when 1, the month value is not compared for the alarm. 0 7 amryear when 1, the year value is not compared for the alarm. 0 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 704 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) 31.6.5 consolidated time registers the values of the time counters can optionally be read in a consolidated format which allows the programmer to read all time counters with only three read operations. the various registers are packed into 32-bit values as shown in ta b l e 6 3 8 , table 639 , and table 640 . the least significant bit of each regist er is read back at bit 0, 8, 16, or 24. the consolidated time registers are read-o nly. to write new values to the time counters, the time counter addresses should be used. 31.6.5.1 consolidated time register 0 the consolidated time register 0 contains th e low order time values: seconds, minutes, hours, and day of week. [1] this register value is not changed by reset. 31.6.5.2 consolidated time register 1 the consolidate time register 1 contains t he day of month, month, and year values. [1] this register value is not changed by reset. table 638. consolidated time register 0 (ctime0 - address 0x4004 6014) bit description bit symbol description reset value 5:0 seconds seconds value in the range of 0 to 59 - [1] 7:6 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 13:8 minutes minutes value in the range of 0 to 59 - [1] 15:14 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 20:16 hours hours value in the range of 0 to 23 - [1] 23:21 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - [1] 26:24 dow day of week value in the range of 0 to 6 - [1] 31:27 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 639. consolidated time register 1 (ctime1 - address 0x4004 6018) bit description bit symbol description reset value 4:0 dom day of month value in the range of 1 to 28, 29, 30, or 31 (depending on the month and whether it is a leap year). - [1] 7:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 11:8 month month value in the range of 1 to 12. - [1] 15:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 27:16 year year value in the range of 0 to 4095. - [1] 31:28 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 705 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) 31.6.5.3 consolidated time register 2 the consolidate time register 2 contains just the day of year value. [1] this register value is not changed by reset. 31.6.6 time counter group the time value consists of the eight counters shown in table 641 and table 642 . these counters can be read or writte n at the locations shown in table 642 . [1] these values are simply incremented at the appropr iate intervals and reset at the defined overflow point. they are not calculated and must be correctly initialized in order to be meaningful. table 640. consolidated time register 2 (ctime2 - address 0x4004 601c) bit description bit symbol description reset value 11:0 doy day of year value in the range of 1 to 365 (366 for leap years). - [1] 31:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 641. time counter relationships and values counter size enabled by minimum value maximum value second 6 1 hz clock 0 59 minute 6 second 0 59 hour 5 minute 0 23 day of month 5 hour 1 28, 29, 30 or 31 day of week 3 hour 0 6 day of year 9 hour 1 365 or 366 (for leap year) month 4 day of month 1 12 year 12 month or day of year 0 4095 table 642. time counter registers name size description access address sec 6 seconds value in the range of 0 to 59 r/w 0x4004 6020 min 6 minutes value in the range of 0 to 59 r/w 0x4004 6024 hrs 5 hours value in the range of 0 to 23 r/w 0x4004 6028 dom 5 day of month value in the range of 1 to 28, 29, 30, or 31 (depending on the month and whether it is a leap year). [1] r/w 0x4004 602c dow 3 day of week value in the range of 0 to 6 [1] r/w 0x4004 6030 doy 9 day of year value in the range of 1 to 365 (366 for leap years) [1] r/w 0x4004 6034 month 4 month value in the range of 1 to 12 r/w 0x4004 6038 year 12 year value in the range of 0 to 4095 r/w 0x4004 603c www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 706 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) [1] this register value is not changed by reset. [1] this register value is not changed by reset. [1] this register value is not changed by reset. [1] this register value is not changed by reset. [1] this register value is not changed by reset. table 643. second register (sec - address 0x4004 6020) bit description bit symbol description reset value 5:0 seconds seconds value in the range of 0 to 59 - [1] 31:6 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 644. minute register (min - address 0x4004 6024) bit description bit symbol description reset value 5:0 minutes minutes value in the range of 0 to 59 - [1] 31:6 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 645. hour register (hrs - address 0x4004 6028) bit description bit symbol description reset value 4:0 hours hours value in the range of 0 to 23 - [1] 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 646. days of month register (dom - address 0x4004 602c) bit description bit symbol description reset value 4:0 dom day of month value in the range of 1 to 28, 29, 30, or 31 (depending on the month and whether it is a leap year). - [1] 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 647. days of week register (dow - address 0x4004 6030) bit description bit symbol description reset value 2:0 dow day of week value in the range of 0 to 6. - [1] 31:3 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 707 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) [1] this register value is not changed by reset. [1] this register value is not changed by reset. [1] this register value is not changed by reset. 31.6.6.1 leap year calculation the rtc does a simple bit comparison to see if the two lowest order bits of the year counter are zero. if true, then the rtc consider s that year a leap year. the rtc considers all years evenly divisible by 4 as leap years. this algorithm is accurate from the year 1901 through the year 2099, but fails for the year 2 100, which is not a leap year. the only effect of leap year on the rtc is to alter the length of the month of february for the month, day of month, and year counters. 31.6.6.2 calibration register the following register is used to calibrate the time counter. the bits in this register are not changed by reset. table 648. days of year register (doy - address 0x4004 6034) bit description bit symbol description reset value 8:0 doy day of year value in the range of 1 to 365 (366 for leap years). - [1] 31:9 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 649. month register (month - address 0x4004 6038) bit description bit symbol description reset value 3:0 month month value in the range of 1 to 12. - [1] 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 650. year register (year - address 0x4004 603c) bit description bit symbol description reset value 11:0 year year value in the range of 0 to 4095. - [1] 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 651. calibration register (calibration - address 0x4004 6040) bit description bit symbol value description reset value 16:0 calval - if enabled, the calibration counter counts up to this value. the maximum value is 131072 corresponding to about 36.4 hours. calibration is disabled if calval = 0. - [1] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 708 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) [1] this register value is not changed by reset. 31.6.7 alarm register group the alarm registers are shown in table 652 . the values in these registers are compared with the time counters. if all the unmasked (see section 31.6.4 ? alarm mask register ? on page 703 ) alarm registers match their corresponding time counters then an interrupt is generated. the interrupt is cleared when a 1 is written to bit 1 of the interrupt location register (ilr[1]). [1] this register value is not changed by reset. [1] this register value is not changed by reset. 17 caldir calibration direction - [1] 0 forward calibration. when calval is equal to the calibration counter, the rtc timers will jump by 2 seconds. 1 backward calibration. when calval is equal to the calibration counter, the rtc timers will stop incrementing for 1 second. 31:12 reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 651. calibration register (calibration - address 0x4004 6040) bit description bit symbol value description reset value table 652. alarm registers name size description access address alsec 6 alarm value for seconds r/w 0x4004 6060 almin 6 alarm value for minutes r/w 0x4004 6064 alhrs 5 alarm value for hours r/w 0x4004 6068 aldom 5 alarm value for day of month r/w 0x4004 606c aldow 3 alarm value for day of week r/w 0x4004 6070 aldoy 9 alarm value for day of year r/w 0x4004 6074 almon 4 alarm value for months r/w 0x4004 6078 alyear 12 alarm value for years r/w 0x4004 607c table 653. alarm second register (asec - address 0x4004 6060) bit description bit symbol description reset value 5:0 seconds seconds value in the range of 0 to 59 - [1] 31:6 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 654. alarm minute register (amin - address 0x4004 6064) bit description bit symbol description reset value 5:0 minutes minutes value in the range of 0 to 59 - [1] 31:6 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 709 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) [1] this register value is not changed by reset. [1] this register value is not changed by reset. [1] this register value is not changed by reset. [1] this register value is not changed by reset. [1] this register value is not changed by reset. table 655. alarm hour register (ahrs - address 0x4004 6068) bit description bit symbol description reset value 4:0 hours hours value in the range of 0 to 23 - [1] 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 656. alarm days of month register (adom - address 0x4004 606c) bit description bit symbol description reset value 4:0 dom day of month value in the range of 1 to 28, 29, 30, or 31 (depending on the month and whether it is a leap year). - [1] 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 657. alarm days of week register (adow - address 0x4004 6070) bit description bit symbol description reset value 2:0 dow day of week value in the range of 0 to 6. - [1] 31:3 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 658. alarm days of year register (adoy - address 0x4004 6074) bit description bit symbol description reset value 8:0 doy day of year value in the range of 1 to 365 (366 for leap years). - [1] 31:9 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 659. alarm month register (amon - address 0x4004 6078) bit description bit symbol description reset value 3:0 month month value in the range of 1 to 12. - [1] 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 710 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) [1] this register value is not changed by reset. 31.7 functional description 31.7.1 calibration procedure the calibration logic can periodically adjust the time counter either by not incrementing the counter, or by incrementing the counter by 2 instead of 1. this allows calibrating the rtc oscillator under some typi cal voltage and temperature co nditions withou t the need to externally trim the rtc oscillator. a recommended method for determining the calibration value is to use the clkout feature to unintrusively observe the rtc oscillator frequency under the conditions it is to be trimmed for, and calculating th e number of clocks th at will be seen before the time is off by one second. that value is used to determine calval. the exact method of calibration depends on whether calval is even or odd. for even values, the hardware performs a two calibrations sequentially multiple times (one calibration at calval+1 and one calibration at calval - 1) and averages both calibration values. for odd values of calval, the calibration time is accurate. if the rtc oscillator is trimmed externally, the same method of unintru sively observing the rtc oscillator frequency may be helpful in that process. backward calibration enable the rtc timer and calibration in the ccr register (set bits clken = 1 and ccalen = 0). in the calibration register, set the calibration value calval ? 1 and select caldir = 1. ? the sec timer and the calibration counte r count up for every 1 hz clock cycle. ? when the calibration counter reaches calval, a calibration match occurs and all rtc timers will be stop ped for one clock cycle so that the timers will not increment in the next cycle. ? if an alarm match event occurs in the same cycle as the calibration match, the alarm interrupt will be delayed by one cycle to avoid a double alarm interrupt. forward calibration enable the rtc timer and calibration in the ccr register (set bits clken = 1 and ccalen = 0). in the calibration register, set the calibration value calval ? 1 and select caldir = 0. ? the sec timer and the calibration counte r count up for every 1 hz clock cycle. ? when the calibration counter reaches calv al, a calibration match occurs and the rtc timers are incremented by 2. table 660. alarm year register (ayrs - address 0x4004 607c) bit description bit symbol description reset value 11:0 year year value in the range of 0 to 4095. - [1] 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 711 of 1164 nxp semiconductors UM10430 chapter 31: lpc18xx real-time clock (rtc) ? when the calibration event occurs, the lsb of the alsec register is forced to be one so that the alarm interr upt will not be missed when skipping a second. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 712 of 1164 32.1 how to read this chapter the usart0/2/3 controllers are available on all lpc18xx parts. 32.2 basic configuration the usart0/2/3 are configured as follows: ? see ta b l e 6 6 1 for clocking and power control. ? the usart0/2/3 are reset by the uart0/2/3_rst (reset #44/46/47). ? the usart0/2/3 interrupts are connected to slots # 24/26/27 in the nvic. ? for connecting the usart0/2/3 receive and transmit lines to the gpdma, use the dmamux register in the creg block (see ta b l e 3 5 ) and enable the gpdma channel in the dma channel configuration registers ( section 16.6.20 ). 32.3 features ? 16-byte receive and transmit fifos. ? register locations conform to ?550 industry standard. ? receiver fifo trigger points at 1, 4, 8, and 14 bytes. ? built-in baud rate generator. ? uart allows for implementation of either software or hardware flow control. ? rs-485/eia-485 9-bit mode support with output enable. ? support for synchronous mode uart (usart). ? irda interface (usart3 only). ? dma support. ? smart card interface. UM10430 chapter 32: lpc18xx usart0_2_3 rev. 00.13 ? 20 july 2011 user manual table 661. usart0/2/3 clocking and power control base clock branch clock maximum frequency usart0 clock to register interf ace base_m3_clk clk_m3_uart0 150 mhz usart0 peripheral clock (pclk) base_ uart0_clk clk_apb0_uart0 150 mhz usart2 clock to register interf ace base_m3_clk clk_m3_uart2 150 mhz usart2 peripheral clock (pclk) base_ uart2_clk clk_apb2_uart2 150 mhz usart3 clock to register interf ace base_m3_clk clk_m3_uart3 150 mhz usart3 peripheral clock (pclk) base_ uart3_clk clk_apb2_uart3 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 713 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.4 pin description 32.5 register description the uart contains registers organized as shown in table 663 . the divisor latch access bit (dlab) is contained in lcr[7] and enables access to the divisor latches. reset value reflects the data stored in used bits only. it does not include the content of reserved bits. table 662. usart0/2/3 pin description function name direction description usart0 u0_rxd i serial input. serial receive data. u0_txd o serial output. serial transmit data. u0_dir i/o rs-485/eia-485 output enable/direction control. u0_uclk i/o serial clock input/output for usart0 in synchronous mode. usart2 u2_rxd i serial input. serial receive data. u2_txd o serial output. serial transmit data. u2_dir i/o rs-485/eia-485 output enable/direction control. u2_uclk i/o serial clock input/output for usart2 in synchronous mode. usart3 u3_rxd i serial input. serial receive data. u3_txd o serial output. serial transmit data. u3_dir i/o rs-485/eia-485 output enable/direction control. u3_uclk i/o serial clock input/output for usart3 in synchronous mode. u3_baud table 663. register overview: uart0/2/3 (base address: 0x4008 1000, 0x400c 1000, 0x400c 2000) name access address offset description reset value rbr ro 0x000 receiver buffer register. contains the next received character to be read (dlab = 0). na thr wo 0x000 transmit holding register. the next character to be transmitted is written here (dlab = 0). na dll r/w 0x000 divisor latch lsb. least significant byte of the baud rate divisor value. the full divisor is used to generate a baud rate from the fractional rate divider (dlab = 1). 0x01 dlm r/w 0x004 divisor latch msb. most significant byte of the baud rate divisor value. the full divisor is used to generate a baud rate from the fractional rate divider (dlab = 1). 0x00 ier r/w 0x004 interrupt enable register. contains individual interrupt enable bits for the 7 potential uart interrupts (dlab = 0). 0x00 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 714 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 iir ro 0x008 interrupt id register. identifies which interrupt(s) are pending. 0x01 fcr wo 0x008 fifo control register. controls uart fifo usage and modes. 0x00 lcr r/w 0x00c line control register. contains controls for frame formatting and break generation. 0x00 - - 0x010 reserved - lsr ro 0x014 line status register. contains flags for transmit and receive status, including line errors. 0x60 - - 0x018 reserved - scr r/w 0x01c scratch pad register. eight-bit temporary storage for software. 0x00 acr r/w 0x020 auto-baud control register. contains controls for the auto-baud feature. 0x00 icr r/w 0x024 irda control register (uart3 only) 0x00 fdr r/w 0x028 fractional divider register. generates a clock input for the baud rate divider. 0x10 --0x02c - 0x03c reserved - hden r/w 0x040 half-duplex enable register - - 0x044 reserved - scictrl r/w 0x048 smart card interface control register rs485ctrl r/w 0x04c rs-485/eia-485 control. contains controls to configure various aspects of rs-485/eia-485 modes. 0x00 rs485adrma tch r/w 0x050 rs-485/eia-485 address match. contains the address match value for rs-485/eia-485 mode. 0x00 rs485dly r/w 0x054 rs-485/eia-485 direction control delay. 0x00 syncctrl r/w 0x058 synchronous mode control register. 0x00 ter r/w 0x05c transmit enable register. turns off uart transmitter for use with software flow control. 0x01 table 663. register overview: uart0/2/3 (base address: 0x4008 1000, 0x400c 1000, 0x400c 2000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 715 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.5.1 uart receiver buffer register the rbr is the top byte of the uart rx fifo . the top byte of the rx fifo contains the oldest character received and can be read via the bus interface. the lsb (bit 0) represents the ?oldest? received data bit. if the character received is less than 8 bits, the unused msbs are padded with zeroes. the divisor latch access bit (dlab) in lcr mu st be zero in order to access the rbr. the rbr is always read only. since pe, fe and bi bits (see table 673 ) correspond to the byte sitting on the top of the rbr fifo (i.e. the one that will be read in the next read from the rbr) , the right approach for fetching the valid pair of received byte and its status bits is first to read the content of the lsr register, and then to read a byte from the rbr. 32.5.2 uart transmitter holding register the thr is the top byte of the uart tx fifo. the top byte is the newest character in the tx fifo and can be written via the bus inte rface. the lsb represents the first bit to transmit. the divisor latch access bit (dlab) in lcr mu st be zero in order to access the thr. the thr is always write only. 32.5.3 uart divisor latch lsb and msb registers the uart divisor latch is part of the uart baud rate generator and holds the value used, along with the fractional divider, to divide the uart_pclk clock in order to produce the baud rate clock, which must be 16x the desired baud rate. the dll and dlm registers together form a 16-b it divisor where dll contains the lower 8 bits of the divisor and dlm contains the higher 8 bits of the divisor. a 0x0000 value is treated like a 0x0001 value as division by zero is not allowed.the divisor latch access bit (dlab) in lcr must be one in order to access the uart divisor latches. details on how to select the right value for dll and dlm can be found in section 32.5.12 . table 664. uart receiver buffer registers wh en dlab = 0, read only (rbr - addresses 0x4008 1000 (uart0), 0x400c 1000 (uart2), 0x400c 2000 (uart3)) bit description bit symbol description reset value 7:0 rbr receiver buffer. the uart receiver buffer register contains the oldest received byte in the uart rx fifo. undefined 31:8 - reserved - table 665. uart transmitter ho lding register when dlab = 0 , write only(thr - addresses 0x4008 1000 (uart0), 0x400c 1000 (uart2), 0x400c 2000 (uart3)) bit description bit symbol description reset value 7:0 thr transmit holding register. writing to the uart transmit holding register causes the data to be stored in the uart transmit fifo. the byte will be sent when it reaches the bottom of the fifo and the transmitter is available. na 31:8 - reserved - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 716 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.5.4 uart interrupt enable register the ier is used to enable the four uart interrupt sources. table 666. uart divisor latch lsb register when dlab = 1 (dll - addresses 0x4008 1000 (uart0), 0x400c 1000 (uart2), 0x400c 2000 (uart3)) bit description bit symbol description reset value 7:0 dllsb divisor latch lsb. the uart divisor latch lsb register, along with the dlm register, determines the baud rate of the uart. 0x01 31:8 - reserved - table 667. uart divisor latch msb register when dlab = 1 (dlm - addresses 0x4008 1004 (uart0), 0x400c 1004 (uart2), 0x400c 2004 (uart3)) bit description bit symbol description reset value 7:0 dlmsb divisor latch msb. the uart divisor latch msb register, along with the dll register, determines the baud rate of the uart. 0x00 31:8 - reserved - table 668. uart interrupt enable register when dlab = 0 (ier - addresses 0x4008 1004 (uart0), 0x400c 1004 (uart2), 0x400c 2004 (uart3) ) bit description bit symbol value description reset value 0 rbrie rbr interrupt enable. enables the receive data available interrupt for uart. it also controls the character receive time-out interrupt. 0 0 disable the rda interrupt. 1 enable the rda interrupt. 1 threie thre interrupt enable. enables the thre interrupt for uart. the status of this interrupt can be read from lsr[5]. 0 0 disable the thre interrupt. 1 enable the thre interrupt. 2 rxie rx line interrupt enable. enables the uart rx line status interrupts. the status of this interrupt can be read from lsr[4:1]. 0 0 disable the rx line status interrupts. 1 enable the rx line status interrupts. 3- -reserved - 6:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na 7- -reserved 0 8 abeointen enables the end of auto-baud interrupt. 0 0 disable end of auto-baud interrupt. 1 enable end of auto-baud interrupt. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 717 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.5.5 uart interrupt identification register iir provides a status code that denotes the pr iority and source of a pending interrupt. the interrupts are frozen during a iir access. if an interrupt occurs during a iir access, the interrupt is recorded for the next iir access. bits iir[9:8] are set by the auto-baud function and signal a time-out or end of auto-baud condition. the auto-baud interrupt conditions are cleared by setting the corresponding clear bits in the auto-baud control register. 9 abtointen enables the auto-baud time-out interrupt. 0 0 disable auto-baud time-out interrupt. 1 enable auto-baud time-out interrupt. 31:10 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 668. uart interrupt enable register when dlab = 0 (ier - addresses 0x4008 1004 (uart0), 0x400c 1004 (uart2), 0x400c 2004 (uart3) ) bit description ?continued bit symbol value description reset value table 669. uart interrupt identification register, read only (iir - addresses 0x4008 1008 (uart0), 0x400c 1008 (uart2), 0x400c 2008 (uart3)) bit description bit symbol value description reset value 0 intstatus interrupt status. note that iir[0] is active low. the pending interrupt can be determined by evaluating iir[3:1]. 1 0 at least one interrupt is pending. 1 no interrupt is pending. 3:1 intid interrupt identification. ier[3:1] identifies an interrupt corresponding to the uart rx fifo. all other combinations of ier[3:1] not listed below are reserved (100,101,111). 0 0x3 priority 1 (highest) - receive line status (rls). 0x2 priority 2 - receive data available (rda). 0x6 priority 2 - character time-out indicator (cti). 0x1 priority 3 - thre interrupt. 0x0 priority 4 (lowest) - reserved. 5:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na 7:6 fifoenable copies of fcr[0]. 0 8 abeoint end of auto-baud interrupt. true if auto-baud has finished successfully and interrupt is enabled. 0 9 abtoint auto-baud ti me-out interrupt. true if auto-baud has timed out and interrupt is enabled. 0 31:10 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 718 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 if the intstatus bit is one and no interrupt is p ending and the intid bits will be zero. if the intstatus is 0, a non auto-baud interrupt is pend ing in which case the in tid bits identify the type of interrupt and handling as described in table 670 . given the status of iir[3:0], an interrupt handler routine can determine the ca use of the interrupt and how to clear the active interrupt. the iir must be read in order to clear the interrupt prior to exiting the interrupt service routine. the uart rls interrupt (iir[3:1] = 011) is the highest priority interrupt and is set whenever any one of four error conditions occur on the uart rx input: overrun error (oe), parity error (pe), framing error (fe) and break interrupt (bi) . the uart rx error condition that set the interrupt can be observed via lsr[4:1]. the interrupt is cleared upon a lsr read. the uart rda interrupt (iir[3:1] = 010) shares the second level priority with the cti interrupt (iir[3:1] = 110). the rda is activa ted when the uart rx fifo reaches the trigger level defined in fcr7:6 and is reset when the uart rx fifo depth falls below the trigger level. when the rda interrupt goes active, the cpu can read a block of data defined by the trigger level. the cti interrupt (iir[3:1] = 110) is a second level interrupt and is set when the uart rx fifo contains at least one character and no ua rt rx fifo activity has occurred in 3.5 to 4.5 character times. any uart rx fifo activity (read or writ e of uart rsr) will clear the interrupt. this interrupt is intended to flush the uart rbr after a message has been received that is not a multiple of the trigger level size. for example, if a peripheral wished to send a 105 character message and the tri gger level was 10 characters, the cpu would receive 10 rda interrupts resulting in the transfer of 100 characters and 1 to 5 cti interrupts (depending on the service routine) re sulting in the transfer of the remaining 5 characters. table 670. uart interrupt handling iir[3:0] value [1] priority interrupt type interrupt source interrupt reset 0001 - none none - 0110 highest rx line status / error oe [2] or pe [2] or fe [2] or bi [2] lsr read [2] 0100 second rx data available rx data available or trigger level reached in fifo (fcr0=1) rbr read [3] or uart fifo drops below trigger level 1100 second character time-out indication minimum of one character in the rx fifo and no character input or removed during a time period depending on how many characters are in fifo and what the trigger level is set at (3.5 to 4.5 character times). the exact time will be: [(word length) ? 7 - 2] ? 8 + [(trigger level - number of characters) ? 8 + 1] rclks rbr read [3] 0010 third thre thre [2] iir read [4] (if source of interrupt) or thr write www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 719 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 [1] values 0000, 0011, 010, 0111, 1000, 1001, 1010, 1011,1101, 1110,1111 are reserved. [2] for details see section 32.5.8 ? uart line status register ? [3] for details see section 32.5.1 ? uart receiver buffer register ? [4] for details see section 32.5.5 ? uart interrupt identification register ? and section 32.5.2 ? uart transmitter holding register ? the uart thre interrupt (iir[3:1] = 001) is a third level inte rrupt and is activated when the uart thr fifo is empty provided certain initialization conditions have been met. these initialization conditions are intended to give the uart thr fifo a chance to fill up with data to eliminate many thre interrupt s from occurring at system start-up. the initialization conditions implement a one c haracter delay minus the stop bit whenever thre = 1 and there have not been at least tw o characters in the thr at one time since the last thre = 1 event. this de lay is provided to give the cp u time to write data to thr without a thre interrupt to decode and service. a thre interrupt is set immediately if the uart thr fifo has held two or more characters at one time and currently, the thr is empty. the thre interrupt is reset when a t hr write occurs or a re ad of the iir occurs and the thre is the highest interrupt (iir[3:1] = 001). 32.5.6 uart fifo control register the fcr controls the operation of the uart rx and tx fifos. table 671. uart fifo control register write only (fcr - addresses 0x4008 1008 (uart0), 0x400c 1008 (uart2), 0x400c 2008 (uart3)) bit description bit symbol value description reset value 0 fifoen fifo enable. 0 0 uart fifos are disabled. must not be used in the application. 1 active high enable for both uart rx and tx fifos and fcr[7:1] access. this bit must be set for proper uart operation. any transition on this bit will automatically clear the uart fifos. 1rxfifo res rx fifo reset. 0 0 no impact on either of uart fifos. 1 writing a logic 1 to fcr[1] will clear all bytes in uart rx fifo, reset the pointer logic. this bit is self-clearing. 2txfifo res tx fifo reset. 0 0 no impact on either of uart fifos. 1 writing a logic 1 to fcr[2] will clear all bytes in uart tx fifo, reset the pointer logic. this bit is self-clearing. 3dmamo de dma mode select. when the fifo enable bit (bit 0 of this register) is set, this bit selects the dma mode. 0 5:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 720 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.5.6.1 dma operation the user can optionally operate the uart tr ansmit and/or receive using dma. the dma mode is determined by the dma mode select bit in the fcr register. note that for dma operation as for any operation of the uart, the fifos must be enabled via the fifo enable bit in the fcr register. uart receiver dma in dma mode, the receiver dm a request is asserted when the receiver fifo level becomes equal to or greater than trigger level, or if a character time-out occurs. see the description of the rx trigger level above. the receiver dma request is cleared by the dma controller. uart transmitter dma in dma mode, the transmitter dma request is asserted when the transmitter fifo transitions to not full. the transmitter dma request is cleared by the dma controller. 32.5.7 uart line control register the lcr determines the format of the data character that is to be transmitted or received. 7:6 rxtrig lvl rx trigger level. these two bits determine how many receiver uart fifo characters must be written before an interrupt is activated. 0 0x0 trigger level 0 (1 character or 0x01). 0x1 trigger level 1 (4 characters or 0x04). 0x2 trigger level 2 (8 characters or 0x08). 0x3 trigger level 3 (14 characters or 0x0e). 31:8 - - reserved - table 671. uart fifo control register write only (fcr - addresses 0x4008 1008 (uart0), 0x400c 1008 (uart2), 0x400c 2008 (uart3)) bit description bit symbol value description reset value table 672. uart line contro l register (lcr - addresses 0x4008 100c (uart0), 0x400c 100c (uart2), 0x400c 200c (uart3)) bit description bit symbol value description reset value 1:0 wls word length select. 0 0x0 5-bit character length. 0x1 6-bit character length. 0x2 7-bit character length. 0x3 8-bit character length. 2 sbs stop bit select. 0 0 1 stop bit. 1 2 stop bits (1.5 if lcr[1:0]=00). www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 721 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.5.8 uart line status register the lsr is a read only register that provides status information on the uart tx and rx blocks. 3 pe parity enable 0 0 disable parity generation and checking. 1 enable parity generation and checking. 5:4 ps parity select. 0 0x0 odd parity. number of 1s in the transmitted character and the attached parity bit will be odd. 0x1 even parity. number of 1s in the transmitted character and the attached parity bit will be even. 0x2 forced "1" stick parity. 0x3 forced "0" stick parity. 6bc break control. 0 0 disable break transmission. 1 enable break transmission. output pin uart txd is forced to logic 0 when lcr[6] is active high. 7 dlab divisor latch access bit. 0 0 disable access to divisor latches. 1 enable access to divisor latches. 31: 8 --reserved - table 672. uart line contro l register (lcr - addresses 0x4008 100c (uart0), 0x400c 100c (uart2), 0x400c 200c (uart3)) bit description ?continued bit symbol value description reset value table 673. uart line status register read only (lsr - addresses 0x4008 1014 (uart0), 0x400c 1014 (uart2), 0x400c 2014 (uart3) ) bit description bit symbol value description reset value 0 rdr receiver data ready. lsr[0] is set when the rbr holds an unread character and is cleared when the uart rbr fifo is empty. 0 0 rbr is empty. 1 rbr contains valid data. 1oe overrun error. the overrun error condition is set as soon as it occurs. a lsr read clears lsr[1]. lsr[1] is set when uart rsr has a new character assembled and the uart rbr fifo is full. in this case, the uart rbr fifo will not be overwritten and the character in the uart rsr will be lost. 0 0 overrun error status is inactive. 1 overrun error status is active. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 722 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 2 pe parity error. when the parity bit of a received character is in the wrong state, a parity error occurs. a lsr read clears lsr[2]. time of parity error detection is dependent on fcr[0]. note: a parity error is associated with the character at the top of the uart rbr fifo. 0 0 parity error status is inactive. 1 parity error status is active. 3 fe framing error. when the stop bit of a received character is a logic 0, a framing error occurs. a lsr read clears lsr[3]. the time of the framing error detection is dependent on fcr0. upon detection of a framing error, the rx will attempt to re-synchronize to the data and assume that the bad stop bit is actually an early start bit. however, it cannot be assumed that the next received byte will be correct even if there is no framing error. note: a framing error is associated with the character at the top of the uart rbr fifo. 0 0 framing error status is inactive. 1 framing error status is active. 4 bi break interrupt. when rxd1 is held in the spacing state (all zeros) for one full character transmission (start, data, parity, stop), a break interrupt occurs. once the break condition has been detected, the receiver goes idle until rxd1 goes to marking state (all ones). a lsr read clears this status bit. the time of break detection is dependent on fcr[0]. note: the break interrupt is associated with the character at the top of the uart rbr fifo. 0 0 break interrupt status is inactive. 1 break interrupt status is active. 5 thre transmitter holding register empty. thre is set immediately upon detection of an empty uart thr and is cleared on a thr write. 1 0 thr contains valid data. 1thr is empty. 6 temt transmitter empty. temt is set when both thr and tsr are empty; temt is cleared when either the tsr or the thr contain valid data. 1 0 thr and/or the tsr contains valid data. 1 thr and the tsr are empty. table 673. uart line status register read only (lsr - addresses 0x4008 1014 (uart0), 0x400c 1014 (uart2), 0x400c 2014 (uart3) ) bit description ?continued bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 723 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.5.9 uart scratch pad register the scr has no effect on the uart operation. this register can be written and/or read at user?s discretion. there is no provision in the interrupt interface that would indicate to the host that a read or write of the scr has occurred. 32.5.10 uart auto-ba ud control register the uart auto-baud control register (acr ) controls the process of measuring the incoming clock/data rate for the baud rate generation and can be read and written at user?s discretion. 7 rxfe error in rx fifo. lsr[7] is set when a character with a rx error such as framing error, parity error or break interrupt, is loaded into the rbr. this bit is cleared when the lsr regi ster is read and there are no subsequent errors in the uart fifo. 0 0 rbr contains no uart rx errors or fcr[0]=0. 1 uart rbr contains at least one uart rx error. 8 txerr error in transmitted character. a nack response is given by the receiver in smart card t=0 mode. this bit is cleared when the lsr register is read. 0 0 no error (normal default condition). 1 a nack response is received during smart card t=0 operation. 31: 9 --reserved - table 673. uart line status register read only (lsr - addresses 0x4008 1014 (uart0), 0x400c 1014 (uart2), 0x400c 2014 (uart3) ) bit description ?continued bit symbol value description reset value table 674. uart scratch pad register (scr - addresses 0x4008 101c (uart0), 0x400c 101c (uart2), 0x400c 201c (uart3)) bit description bit symbol description reset value 7:0 pad scratch pad. a readable, writable byte. 0x00 31:8 - reserved - table 675. autobaud control register ( acr - addresses 0x4008 1020 (uart0), 0x400c 1020 (uart2), 0x400c 2020 (uart3)) bit description bit symbol value description reset value 0 start start bit. this bit is automatically cleared after auto-baud completion. 0 0 auto-baud stop (auto-baud is not running). 1 auto-baud start (auto-baud is running). auto-baud run bit. this bit is automatically cleared after auto-baud completion. 1 mode auto-baud mode select bit. 0 0 mode 0. 1 mode 1. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 724 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.5.10.1 auto-baud the uart auto-baud function can be used to measure the incoming baud rate based on the ?at" protocol (hayes co mmand). if enabled th e auto-baud feature will measure the bit time of the receive data stream and se t the divisor latch registers dlm and dll accordingly. auto-baud is started by setting the acr start bit. auto-baud can be stopped by clearing the acr start bit. the start bit will clear once auto-baud has finished and reading the bit will return the status of auto-baud (pe nding/finished). two auto-baud measuring modes are availabl e which can be selected by the acr mode bit. in mode 0 the baud rate is measured on two subsequent falling edges of the uart rx pin (the falling edge of the start bit and the falling edge of the le ast significant bit). in mode 1 the baud rate is me asured between the fa lling edge and the subs equent rising edge of the uart rx pin (the le ngth of the start bit). the acr autorestart bit can be used to automatically restart baud rate measurement if a time-out occurs (the rate measurement counte r overflows). if this bit is set, the rate measurement will restart at the next falling edge of the uart rx pin. the auto-baud function can generate two interrupts. ? the iir abtoint interrup t will get set if the interrupt is enabled (ier abtointen is set and the auto-baud rate meas urement counte r overflows). ? the iir abeoint interrupt will ge t set if the interrupt is e nabled (ier abeointen is set and the auto-baud has completed successfully). 2 autorestart restart bit. 0 0 no restart 1 restart in case of time-out (counter restarts at next uart rx falling edge) 7:3 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 8 abeointclr end of auto-baud inte rrupt clear bit (write-only). 0 0 writing a 0 has no impact. 1 writing a 1 will clear the corresponding interrupt in the iir. 9 abtointclr auto-baud time-out interrupt clear bit (write-only). 0 0 writing a 0 has no impact. 1 writing a 1 will clear the corresponding interrupt in the iir. 31:10 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 table 675. autobaud control register ( acr - addresses 0x4008 1020 (uart0), 0x400c 1020 (uart2), 0x400c 2020 (uart3)) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 725 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 the auto-baud interrupts have to be cleared by setting the corresponding acr abtointclr and abeointen bits. the fractional baud rate generator must be disabled (divaddval = 0) during auto-baud. also, when auto-baud is used, any write to dlm and dll registers should be done before acr register write. the minimum and the maximum baud rates supported by uart are function of uart_pclk, number of data bits, stop bits and parity bits. (6) 32.5.10.2 auto-baud modes when the software is expecting an ?at" command, it configures the uart with the expected character format and sets the acr st art bit. the initial va lues in the divisor latches dlm and dlm don?t care. because of the ?a" or ?a" ascii coding (?a" = 0x41, ?a" = 0x61), the uart rx pin sensed start bi t and the lsb of the ex pected character are delimited by two falling edges. when the acr start bit is set, the auto-baud protocol will execute the following phases: 1. on acr start bit setting, the baud rate measurement counter is reset and the uart rsr is reset. the rsr baud rate is switched to the highest rate. 2. a falling edge on uart rx pin triggers th e beginning of the st art bit. the rate measuring counter will start counting uart_pclk cycles. 3. during the receipt of the start bit, 16 pu lses are generated on the rsr baud input with the frequency of the uart input clock, guar anteeing the start bit is stored in the rsr. 4. during the receipt of the start bit (and the character lsb for mode = 0), the rate counter will continue incr ementing with the pre- scaled uart input clock (uart_pclk). 5. if mode = 0, the rate counter will stop on next falling edge of the uart rx pin. if mode = 1, the rate counter w ill stop on the next rising edge of the uart rx pin. 6. the rate counter is loaded into dlm/dll and the baud rate will be switched to normal operation. after setting the dlm/dll, the end of auto-baud interrupt iir abeoint will be set, if enabled. th e rsr will now continue receiving th e remaining bits of the ?a/a" character. ratemin 2p ? clk 16 2 15 ? ------------------------ - uart baudrate pclk 16 2 databits paritybits stopbits ++ + ?? ? ------------------------------------------------------------------------------------------------------------ ?? ratemax == www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 726 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.5.11 irda control register (uart3) the irda control register enables and configures the irda mode for uart3 only. the value of u3icr should not be changed while transmitting or receiving data, or data loss or corruption may occur. remark: irda is available on uart3 only. a. mode 0 (start bit and lsb are used for auto-baud) b. mode 1 (only start bit is used for auto-baud) fig 88. auto-baud a) mode 0 and b) mode 1 waveform uartn rx start bit lsb of 'a' or 'a' u0acr start rate counter start bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 parity stop 'a' (0x41) or 'a' (0x61) 16 cycles 16 cycles 16xbaud_rate uartn rx start bit lsb of 'a' or 'a' rate counter 'a' (0x41) or 'a' (0x61) start bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 parity stop u1acr start 16 cycles 16xbaud_rate table 676. irda control register (icr - address 0x4000 8024) bit description bit symbol value description reset value 0 irdaen irda mode enable. 0 0 irda mode on uart3 is disabled, uart3 acts as a standard uart. 1 irda mode on uart3 is enabled. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 727 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 the pulsediv bits in u3icr are used to select the pulse width when the fixed pulse width mode is used in irda mode (irdaen = 1 and fixpulseen = 1). the value of these bits should be set so that the resulting pulse width is at least 1.63 s. ta b l e 6 7 7 shows the possible pulse widths. 32.5.12 uart fractional divide r register (u0fdr - 0x4000 8028) the uart fractional divider register (fdr) c ontrols the clock pre-scaler for the baud rate generation and can be read and written at the user?s discretion. this pre-scaler takes the apb clock and generates an output cloc k according to the specified fractional requirements. important: if the fractional divider is active (divaddval > 0) and dlm = 0, the value of the dll register must be 3 or greater. 1 irdainv serial input direction. 0 0 the serial input is not inverted. 1 the serial input is inverted. this has no effect on the serial output. 2 fixpulseen irda fixed pulse width mode. 0 0 irda fixed pulse width mode disabled. 1 irda fixed pulse width mode enabled. 5:3 pulsediv configures the pulse when fixpulseen = 1. see table 677 for details. 0 31:6 - na reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 table 677. irda pulse width fixpulseen pulsediv irda transmitter pulse width (s) 0x3 / (16 ? baud rate) 102 ? t pclk 114 ? t pclk 128 ? t pclk 1316 ? t pclk 1432 ? t pclk 1564 ? t pclk 1 6 128 ? t pclk 1 7 256 ? t pclk table 676. irda control register (icr - address 0x4000 8024) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 728 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 this register controls the clo ck pre-scaler for the baud rate generation. the reset value of the register keeps the fractional capabilities of uart disabled making sure that uart is fully software and hardware compatible with uarts not equipped with this feature. the uart baud rate can be calculated as: (7) where uart_pclk is the peripheral clock, dlm and dll are the standard uart baud rate divider registers, and divaddval and mulval are uart fractional baud rate generator specific parameters. the value of mulval and divaddval should comply to the following conditions: 1. 1 ?? mulval ? 15 2. 0 ? divaddval ? 14 3. divaddval< mulval the value of the fdr should not be modified while transmitting/receiving data or data may be lost or corrupted. if the fdr register value does not comply to t hese two requests, then the fractional divider output is undefined. if divaddval is zero th en the fractional divider is disabled, and the clock will not be divided. 32.5.12.1 baud rate calculation uart can operate with or without using the fracti onal divider. in real-life applications it is likely that the desired baud rate can be achieved using several different fractional divider settings. the following algorithm illustrates one way of finding a set of dlm, dll, mulval, and divaddval values. such set of parameters yields a baud rate with a relative error of less than 1.1% from the desired one. table 678. uart fractional divider regist er (fdr - addresses 0x4008 1028 (uart0), 0x400c 1028 (uart2), 0x400c 2028 (uart3)) bit description bit function description reset value 3:0 divaddval baud rate generation pre-scaler divisor value. if this field is 0, fractional baud rate generator will not impact the uart baud rate. 0 7:4 mulval baud rate pre-scaler multiplier value. this field must be greater or equal 1 for uart to operate properly, regardless of whether the fractional baud rate generator is used or not. 1 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 uart baudrate pclk 16 256 dlm ? dll + ?? ? 1 divaddval mulval ----------------------------- + ?? ?? ? ------------------------------------------------------------------------------------------------------------------ = www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 729 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 fig 89. algorithm for setting uart dividers pclk, br calculating uart baudrate (br) dl est = pclk/(16 x br) dl est is an integer? divaddval = 0 mulval = 1 tr u e fr est = 1.5 dl est = int(pclk/(16 x br x fr est )) 1.1 < fr est < 1.9? pick another fr est from the range [1.1, 1.9] fr est = pclk/(16 x br x dl est ) divaddval = table(fr est ) mulval = table(fr est ) dlm = dl est [15:8] dll = dl est [7:0] end false tr u e false www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 730 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.5.12.1.1 example 1: uart_pclk = 14.7456 mhz, br = 9600 according to the provided algorithm dl est = pclk/(16 x br) = 14.7456 mhz / (16 x 9600) = 96. since this dl est is an integer number, divaddval = 0, mulval = 1, dlm = 0, and dll = 96. 32.5.12.1.2 example 2: uart_pclk = 12 mhz, br = 115200 according to the provided algorithm dl est = pclk/(16 x br) = 12 mhz / (16 x 115200) = 6.51. this dl est is not an integer number and the next step is to estimate the fr parameter. using an initial estimate of fr est = 1.5 a new dl est = 4 is calculated and fr est is recalculated as fr est = 1.628. since frest = 1.628 is within the specified range of 1.1 and 1.9, divaddval and mulval values can be obtained from the attached look-up table. the closest value for frest = 1.628 in the look-up table 679 is fr = 1.625. it is equivalent to divaddval = 5 and mulval = 8. based on these findings, the suggested uart setup would be: dlm = 0, dll = 4, divaddval = 5, and mulval = 8. according to equation 7 , the uart?s baud rate is 115384. this rate has a relative error of 0.16% from the originally specified 115200. 32.5.13 uart half-duplex enable register remark: the hden register should be disabled when in smart card mode (smart card by default runs in half-duplex mode). table 679. fractional divider setting look-up table fr divaddval/ mulval fr divaddval/ mulval fr divaddval/ mulval fr divaddval/ mulval 1.000 0/1 1.250 1/4 1.500 1/2 1.750 3/4 1.067 1/15 1.267 4/15 1.533 8/15 1.769 10/13 1.071 1/14 1.273 3/11 1.538 7/13 1.778 7/9 1.077 1/13 1.286 2/7 1.545 6/11 1.786 11/14 1.083 1/12 1.300 3/10 1.556 5/9 1.800 4/5 1.091 1/11 1.308 4/13 1.571 4/7 1.818 9/11 1.100 1/10 1.333 1/3 1.583 7/12 1.833 5/6 1.111 1/9 1.357 5/14 1.600 3/5 1.846 11/13 1.125 1/8 1.364 4/11 1.615 8/13 1.857 6/7 1.133 2/15 1.375 3/8 1.625 5/8 1.867 13/15 1.143 1/7 1.385 5/13 1.636 7/11 1.875 7/8 1.154 2/13 1.400 2/5 1.643 9/14 1.889 8/9 1.167 1/6 1.417 5/12 1.667 2/3 1.900 9/10 1.182 2/11 1.429 3/7 1.692 9/13 1.909 10/11 1.200 1/5 1.444 4/9 1.700 7/10 1.917 11/12 1.214 3/14 1.455 5/11 1.714 5/7 1.923 12/13 1.222 2/9 1.462 6/13 1.727 8/11 1.929 13/14 1.231 3/13 1.467 7/15 1.733 11/15 1.933 14/15 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 731 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 after reset the usart will be in full-duplex mode, meaning th at both tx and rx work independently. afte r setting the hden bit, the usart w ill be in half-duplex mode. in this mode, the usart ensures that the receiver is lo cked when idle, or will enter a locked state after having received a complete ongoing character reception. line conflicts must be handled in software. the behavior of the usart is unpredictactable when data is presented for reception while data is being transmitted. for this reason, the value of the hden register should not be modified while sending or receiving data, or data may be lost or corrupted. 32.5.14 uart smart card in terface control register table 680. uart half duplex enable register (hden - addresses 0x4008 1040 (uart0), 0x400c 1040 (uart2), 0x400c 2040 (uart3)) bit description bit symbol value description reset value 0 hden half-duplex mode enable 0 0 disable half-duplex mode. 1 enable half-duplex mode. 31:1 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 681. uart smart card interface contro l register (scictrl - addresses 0x4008 1048 (uart0), 0x400c 1048 (uart2), 0x400c 2048 (uart3)) bit description bit symbol value description reset value 0 scien smart card interface enable. 0 0 smart card interface disabled. 1 asynchronous half duplex smart card interface is enabled. 1 nackdis nack response disable. only applicable in t=0. 0 0 a nack response is enabled. 1 a nack response is inhibited. 2 protsel protocol selection as defined in the iso7816-3 standard. 0 0t = 0 1t = 1 7:5 txretry maximum number of retransmissions in case of a negative acknowledge (protocol t=0). when the retry counter is exceeded, the usart will be locked until the fifo is cleared. a tx error interrupt is generated when enabled. - 15:8 guardtime extra guard time. no extra guard time (0x0) results in a standard guard time as defined in iso 7816-3, depending on the protocol type. a guard time of 0xff indicates a minimal guard time as defined for the selected protocol. 31:16 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 732 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 after reset the usart smart ca rd interface will be disabled. after setting the scien bit the usart will be in iso 78 16-3 compliant asynchron ous smart card mode t=0. the nackdis bit is used to inhibit a nack response during t=0 (the i/o line is not pulled low during the guard time to indicate an erroneous reception). the received character will be stored in the rx fi fo but a parity error w ill be generated. it is up to the software to handle the incorrect received character. the protsel bit is used to selected between the two supported smart card protocols t=0 and t=1. more information on these protocols can be found in the iso 7816-3 standard. the retry bit field indicates the number of retransmission when receiving a nack response, which can be up to 7 trails. when the number is exceeded, an interrupt is generated and the usart is locked until the fifo is empty. this can be done by flushing the fifo. when no fifo is available, or the fifo is already empty, the interrupt can be used by the software to determine the next action. the guard time bit file is used to program th e extra number of guard time cycles to allow the smart card to process the information before sending a response. the extra guard time can be programmed from 0 to 255, where 255 indicates the minimum possible character length. this value is depending on the selected protocol and can be either 11 etu for protocol t=1 or 12 etu for protocol t=0. waiting times as defined in the standard cannot be programmed directly, but are implemented using the cap1 and cap2 inputs of the timers. use the creg6 register in the creg block (see ta b l e 3 7 ) to set up the timers for po lling the tx_active and rx_active polling signals. remark: the scictrl register should not be mo dified while sending or receiving data, or data may be lost or corrupted. remark: the scictrl register should not be enabled in combination with the syncctrl register, as only asynchronous smart card is supported. 32.5.15 uart rs485 control register the rs485ctrl register controls the config uration of the uart in rs-485/eia-485 mode. table 682. uart rs485 control register (rs485ctrl - addresses 0x4008 104c (uart0), 0x400c 104c (uart2), 0x400c 2 04c (uart3)) bit description bit symbol value description reset value 0 nmmen nmm enable. 0 0 rs-485/eia-485 normal multidrop mode (nmm) is disabled. 1 rs-485/eia-485 normal multidrop mode (nmm) is enabled. in this mode, an address is detected when a received byte causes the uart to set the parity error and generate an interrupt. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 733 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 after reset rs485 mode will be disabled. the rs485 featur e allows the usart to be configured as one of multiple addressable sl ave receivers controlled by a single usart. in rs485 mode the usart differentiates between an address character and a data character by means of a ninth bit. the parity bi t is used to implement this bit, and when set to ?1? indicates an address and when set to ?0? indicates data. rs485 mode is enabled by setting the nmmen bit. the usart slave receiver can be assigned a unique address and, manually or automatically, reject or accept data based on a received address. see section section 32.6.3 for details. 32.5.16 uart rs485 a ddress match register the rs485adrmatch register contains the address match value for rs-485/eia-485 mode. 1 rxdis receiver enable. 0 0 the receiver is enabled. 1 the receiver is disabled. 2 aaden aad enable 0 0 auto address detect (aad) is disabled. 1 auto address detect (aad) is enabled. 3 - - reserved. - 4 dctrl direction control for dir pin. 0 0 disable auto direction control. 1 enable auto direction control. 5 oinv direction control pin polarity. this bit reverses the polarity of the direction control signal on the dir pin. 0 0 the direction control pin will be driven to logic ?0? when the transmitter has data to be sent. it will be driven to logic ?1? after the last bit of data has been transmitted. 1 the direction control pin will be driven to logic ?1? when the transmitter has data to be sent. it will be driven to logic ?0? after the last bit of data has been transmitted. 31:6 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 682. uart rs485 control register (rs485ctrl - addresses 0x4008 104c (uart0), 0x400c 104c (uart2), 0x400c 2 04c (uart3)) bit description ?continued bit symbol value description reset value table 683. uart rs485 address match register (rs485adrmatch - addresses 0x4008 1050 (uart0), 0x400c 1050 (uart2), 0x400c 2050 (uart3)) bit description bit symbol description reset value 7:0 adrmatch contains the address match value. 0x00 31:8 - reserved - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 734 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 the adrmatch bit field contains the slave address match value that is used to compare a received address value to. during automatic address detection, this value is used to accept or reject serial input data. 32.5.17 uart1 rs485 delay value register the user may program the 8-bit rs485dly regist er with a delay between the last stop bit leaving the txfifo and the de-assertion of the dir pin. this delay time is in periods of the baud clock. any delay time from 0 to 255 bit times may be programmed. 32.5.18 uart synchronous mode control register syncctrl register is a read/write register that controls the synchronous mode. the synchronous mode control module generates or receives the synchronous clock with the serial input/ output data and distributes t he edge detect samples to the transmit and receive shift registers. table 684. uart rs485 delay value register (rs485dly - addresses 0x4008 1054 (uart0), 0x400c 1054 (uart2), 0x400c 2054 (uart3)) bit description bit symbol description reset value 7:0 dly contains the direction control delay value. this register works in conjunction with an 8-bit counter. 0x00 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 685. uart synchronous mode control registers (syncctrl - address addresses 0x4008 1058 (uart0), 0x400c 1058 (uart2), 0x400c 2058 (uart3)) bit description bit symbol value description reset value 0 sync enables synchronous mode. 0 0 disabled 1 enabled 1 csrc clock source select. 0 0 synchronous slave mode (sclk in) 1 synchronous master mode (sclk out) 2 fes falling edge sampling. 0 0 rxd is sampled on the rising edge of sclk 1 rxd is sampled on the falling edge of sclk 3 tsbypass transmit synchronization register bypass. 0 0 1 4 cscen continuous master clock enable (used only when csrc is 1) 0 0 sclk cycles only when char acters are being sent on txd 1 sclk runs continuously (characters can be received on rxd independently from transmission on txd) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 735 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 after reset, synchronous mode is disabled. synchronous mo de allows the user to send (synchronous master mode) or receive (synchronous slave mode) a clock with the serial input and output data. synchronous mode is enabled by setting the sync bit. the csrc bit can be used to switch between synchr onous slave mode (logic 0) and synchronous master mode (logic 1). the serial data can either be sampled on the rising edge (default) or the falling edge of the se rial clock. when the startsto pdisable bit is set, the fes bit is hardware overwritten to sample on the falling edge. a master clock is only required to generate a clock when transmitting data. in this case, data can only be received when data is transmitted. when the cscen bit is set, the clock will always be running (duri ng synchronous master mode on ly), allowing data to be received continuously. note that this option should not be us ed in combination with startstopdisable (during full-duplex communication). the contin uous clock can be automatically stopped by hardware after having received a complete character. this can be done by asserting the ccclr bit. this is useful in half-duplex mode, where the clock cannot be generated by sending a character. after the reception of one character, the cscen bit is automatically cleared by hardware. when another character needs to be received, the cscen should be enabled again. by default data transmission and reception performs the same in asynchronous mode and synchronous mode. when the startstopdisable bit is set, no start and stop bits are transmitted (nor are they received). this means that all bits that are send or received (a clock is running) are data bits. remark: the value of the syncctrl register should not be modified while transmitting/receiving, data or data might get lost or corrupted. remark: the syncctrl register should not be enabled in combination with the scictrl register, as only asynchronous smart card is supported. 5 sssdis start/stop bits 0 0 send start and stop bits as in other modes. 1 do not send start/stop bits. 6 ccclr continuous clock clear 0 0 cscen is under software control. 1 hardware clears cscen after each character is received. 31:7 - reserved. the value read from a reserved bit is not defined. na table 685. uart synchronous mode control registers (syncctrl - address addresses 0x4008 1058 (uart0), 0x400c 1058 (uart2), 0x400c 2058 (uart3)) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 736 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.5.19 uart transmit enable register in addition to being equipped with full hardware flow control (auto-cts and auto-rts mechanisms described above), ter enables im plementation of software flow control. when txen = 1, uart transmitter will keep send ing data as long as th ey are available. as soon as txen becomes 0, uart transmission will stop. table 686 describes how to use txen bit in order to achieve software flow control. 32.6 functional description 32.6.1 asynchronous mode 32.6.2 synchronous mode when the synchronous receiver/ transmitter feature is configured (usart), the serial interface is extended with a serial input and output clock and an output enable for controlling the clock pad. by default transmission and reception in synchronous mode operates uses the same protocol as in asynchronous mode. synchronous mode can be configured using the synchronous mode control register. this register allows to control: ? the direction of the serial clock, i.e. synchronous slave or master mode ? the sampling edge of the serial clock ? two-stage or one stage synchronization of the input serial clock during transmission ? during synchronous master mode, the clock can be continuous or disabled when in idle or break mode ? the transmission of start and stop bits can be omitted. valid data is identified by a running clock. sampling is always done on the falling edge of the serial clock data is shifted in the receive shift register at the sampling edge of the serial clock. table 686. uart transmit enable register (ter - addresses 0x4008 1030 (uart0), 0x400c 1030 (uart2), 0x400c 205c (uart3)) bit description bit symbol description reset value 0 txen transmit enable. after reset transmission is enabled. when the txen bit is de-asserted, no data will be transmitted although data may be pending in the tsr or thr. 1 31:1 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - fig 90. usart serial interface protocol www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 737 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 32.6.2.1 synchronous slave mode this mode is enabled by setting the csrc bi t of the control register to ?0?. during synchronous slave mode, an external clock is required that clocks the serial input and output data. note that internally, the serial clock is treated as a data signal. edge detection on the serial clock is performed to synchro nize the serial clock with the uart clock domain, hence no registers are clocked with the serial clock. reception by default the received character is similar to the character in asynchronous mode. the serial data stream is kept high when no data is available. during this time it is not required for the exte rnal serial clock to be running. the first bit that will be received is the start bit. during this time, the external serial clock must be running. the beginning of the start bit can either be aligned with the risi ng edge of the serial clock (sampling on the falling edge) or the falling ed ge (sampling on the rising ed ge), see the fes bit in table 685 . when sampling on the rising edge, it is not required that the beginning of the start bit is aligned with a clock edge (the cl ock may not have been running before). in this case, the edge on the serial input data due to the start bit (logic 1 to 0) is used to determine the start of the character (see figure 11). the nostartstopbits bit of the synchronous m ode control register allows the user to disable the transmission/ reception of the start and stop bits, improving the efficiency of the usart. as a character is no longer identifi ed by the start and stop bits, the serial clock is used to determine the data bits. when the se rial clock is running, all data that is sampled is regarded as valid data. in order to be able to identify the start of a character, the beginning of the character must be aligned with the rising edge of the serial clock. for this reason, the fes bit of the synchronous mode control register is forced in hard ware to ?1?. directly after sampling the last bit, the character is stored in the receive fifo. transmission during synchronous slave mode, data can only be transmitted when the external serial clock is running. hence, when no start and stop bits are sent, transmission can only take place when data is received from the master. when the start and stop bits are transmitted, the external clock may only be detected after the first half of the received start bit (sampling at the rising edge of the external serial clock). by using the edge created by the received start bit (logic 1 to 0), it is made sure that the start bit of the character that is to be transmitted by the slave is stable before this ri sing edge the external slave clock. in this way it is ensured, that the master rece ives as many bits as it has transmitted. when the first sample edge of the incoming serial clock samples a ?1? on the serial input data (and start-stop bits are transmitted, th us the master has not initiated a transaction yet), it is assumed that the ma ster is running a continuous cl ock (instead of only running the clock when sending data char acters). the usart will not wait for a start bit from the master, but will immediately start transmitting data when available. note that in this fig 91. transmission of data in synchronous slave mode www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 738 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 situation, the number of bits transmitted by the master and the number of bits transmitted by the slave (received by the master) may not be aligned. it is assumed that a higher level protocol ensures that complete characters are received when the master stops the clock. transmission of data during synchronous slave mode is most time-critical. first the external serial input clock must be detected using edge detection logic. then, data needs to be shifted out and be stable before the sampling edge of the external serial clock. remark: in this mode the u_clk period is allowed to be 4x the serial clock period. 32.6.2.2 synchronous master mode synchronous master mode is enabled by setting the csrc register bit to ?1?. in this mode, the external clock is generated internally by the baud-rate generation logic and is used to clock the input and output serial data. the functionality of the baud-rate generation is described in section 32.5.12.1 . auto-baud is not supported during synchronous mode. the 1x baud rate clock is used to shift out the serial output data and to sample the serial input data. synchronous master mode behaves similar to th e slave mode, except that the serial input data is not registered at the interface but is clocked in the uart clock domain at the sampling edge of the serial clock. during synchronous master mode, when start and stop bits are transmitted, the user can enable the external clock continuously usin g cscen bit of the synchronous mode control register. this allows the connected slave to transmit data even when no data is transmitted by the master itself. 32.6.3 rs-485/eia-485 modes of operation the rs-485/eia-485 feature allows the uart to be configured as an addressable slave. the addressable slave is one of multiple slaves controlled by a single master. the uart master tr ansmitter will identify an address character by se tting the pa rity (9th) bit to ?1?. for data characters , the parity bit is set to ?0?. each uart slave receiver can be assigned a unique address. the slave can be programmed to either manually or automatically reject data following an address which is not theirs. rs-485/eia-485 normal multidrop mode (nmm) setting the rs485ctrl bit 0 enables this mo de. in this mode, an address is detected when a received byte causes the uart to set the parity error and generate an interrupt. if the receiver is disabled (r s485ctrl bit 1 = ?1?) , any received data by tes will be ignored and will not be stored in the rxfi fo. when an address byte is de tected (parity bit = ?1?) it will be placed into the rxfifo and an rx da ta ready interrupt w ill be genera ted. the processor can then read the address byte and decide whether or not to enable the receiver to accept the following data. while the receiver is enabled (rs485ctrl bit 1 =?0?), all re ceived bytes will be accepted and stored in the rxfifo regardless of wh ether they are data or address. when an address character is received a parity error interrupt will be generated and the processor can decide whether or not to disable the receiver. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 739 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 rs-485/eia-485 auto address detection (aad) mode when both rs485ctrl register bits 0 (9-bit mode enable) and 2 (aad mode enable) are set, the uart is in auto address detect mode. in this mode, the receiver will compare any address by te received (p arity = ?1?) to the 8-bit value programmed into the rs485adrmatch register. if the receiver is disabl ed (rs485ctrl bit 1 = ?1?), any rece ived byte will be discarded if it is either a data byte or an address byte which fails to match the rs485adrmatch value. when a matching address char acter is detected it will be pushed onto the rxfifo along with the parity bit, and the receiver will be automatically en abled (rs485ctrl bit 1 will be cleared by hardware). the re ceiver will also generate an rx data ready interrupt. while the receiver is enabl ed (rs485ctrl bit 1 = ?0?), all bytes received will be accepted and stored in the rxfifo until an address byte which does not match the rs485adrmatch value is received. when this occurs, the receiver will be automatically disabled in hardware (rs485ctrl bit 1 will be set), the received non-matching address character will not be st ored in th e rxfifo. rs-485/eia-485 auto direction control rs485/eia-485 mode includes the option of allowing the transmitter to automatically control the state of the dir pin as a direction control output signal. setting rs485ctrl bit 4 = ?1? enables this feature. when auto direction control is enabled, the se lected pin will be a sserted (driven low) when the cpu writes data into the txfifo. the pin will be de-ass erted (driven high) once the last bit of data has been transmitted. see bits 4 and 5 in the rs485ctrl register. the rs485ctrl bit 4 takes pr ecedence over all other mechanisms controlling the direction control pin. rs485/eia-485 driver delay time the driver delay time is the delay between th e last stop bit leaving the txfifo and the de-assertion of the dir pin. this delay time can be programmed in the 8-bit rs485dly register. the delay time is in periods of the baud clock. any delay time from 0 to 255 bit times may be used. rs485/eia-485 output inversion the polarity of the direction control signal on the dir pin can be reversed by programming bit 5 in the rs485ctrl register . when this bit is set, the direction contro l pin will be driven to logic 1 when the transmitter has data waiting to be sent. the direction control pin will be driven to logic 0 after the last bit of data has been transmitted. 32.6.4 smart card mode figure 92 shows a typical asynchronous smart card application. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 740 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 when the scien bit in the scictrl register ( table 681 ) is set as described above, the uart provides bidirectional serial data on the open-drain txd pin. no rxd pin is used when scien is 1. if a cl ock source is needed as an oscillator source into the smart card, a timer match or pwm output can be used in cases when a higher frequency clock is needed that is not sync hronous with the data bit rate. the uart sclk pin will output synchronously with the data and at the data bit rate and may not be adequate for most asynchronous cards. software must use time rs to implement character and block waiting times (no hardware support via trigger signals is provided on the lpcxxxx). gpio pins can be used to control the smart card reset and power pins. any power supplied to the card must be externally switched as card po wer supply requirements often exceed source currents possible on the lpcxxxx. as the sp ecific application may accommodate any of the available iso 7816 class a, b, or c power requirements, be aware of the logic level tolerances and requirements when communicating or powering cards that use different power rails than the lpcxxxx. 32.6.4.1 smart card set-up procedure a t = 0 protocol transfer consists of 8-bits of data, an even parity bit, and two guard bits that allow for the receiver of the particular tr ansfer to flag parity errors through the nack response (see figure 93 ). extra guard bits may be added according to card requirements. if no nack is sent (provided the interface accepts them in scictrl), the next byte may be transmitted immediately after the last guard bit. if the nack is sent, the transmitter will retry sending the byte until successfully received or until the scictrl retry limit has been met. fig 92. typical smart card application lpcxxxx iso 7816 smart card pull-up resistor selectable power rail vcc clk i/o rst insertion switch optional logic level translation pull-up resistor pull-up resistor gpio gpio gpio txd mat x / pwm x www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 741 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 the smart card must be set up with the following considerations: 1. if necessary, bring the uart out of reset and enable clocking to the peripheral. 2. setup an available uart txd pin for the bidirectional transfers. 3. setup the match output or pwm clock source. the default clock requirement for most asynchronous cards is 372 times the bit rate. 4. configure dll and dlm for baud rate. it may not be necessary to target a specific standard baud rate but rather to maintain a fraction of the previously mentioned clock rate. for example if the clock rate is set to 4 mhz the baud rate would be 10753. a clock rate of 3.5712 mhz would need a baud rate of 9600. an iso 7816 pps exchange may require the baud rate to be changed later. 5. configure lcr for character size and parity (typically 8-bit and even parity). 6. configure scictrl with the desired nack response, extra guard bits, and protocol type. 7. place the gpio output signals into an inac tive state where card power is off, rst is low, and clk is low and unchanging. thereafter, software should monitor card insertion, handle activation, wait for answer to reset as described in iso7816-3. 32.7 architecture the architecture of the uart is shown below in the block diagram. the apb interface provides a communicatio ns link between the cpu or host and the uart. the uart receiver block, rx, monitors the se rial input line, rxd, for valid input. the uart rx shift register (rsr) accepts valid c haracters via rxd. after a valid character is assembled in the rsr, it is passed to the ua rt rx buffer register fifo to await access by the cpu or host via the generic host interface. the uart transmitter block, tx, accepts data written by the cpu or host and buffers the data in the uart tx holding register fifo (thr). the uart tx shift register (tsr) reads the data stored in the thr and assembles the data to transmit via the serial output pin, txd1. fig 93. smart card t = 0 waveform start bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 parity nack guard1 guard2 extra guard1 extra guard2 extra guard n start bit0 asynchr onous transfer next transfer or first retry txd clock www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 742 of 1164 nxp semiconductors UM10430 chapter 32: lpc18xx usart0_2_3 the uart baud rate generator block, brg, generates the timing enables used by the uart tx block. the brg clock input source is uart_pclk. the main clock is divided down per the divisor specified in the dll and dlm registers. this divided down clock is a 16x oversample cl ock, nbaudout. the interrupt interface contains registers ie r and iir. the interrupt interface receives several one clock wide enables from the tx and rx blocks. status information from the tx and rx is stor ed in the lsr. control information for the tx and rx is stored in the lcr. fig 94. uart block diagram www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 743 of 1164 33.1 how to read this chapter the uart1 controller is available on all lpc18xx parts. 33.2 basic configuration the uart1 is configured as follows: ? see ta b l e 6 8 7 for clocking and power control. ? the uart1 is reset by the uart1_rst (reset #45). ? the uart1 interrupt is connected to slot # 25 in the nvic. ? for connecting the uart1 receive and tr ansmit lines to the gpdma, use the dmamux register in the creg block (see ta b l e 3 5 ) and enable the gpdma channel in the dma channel configuration registers ( section 16.6.20 ). 33.3 features ? full modem control handshaking available. ? data sizes of 5, 6, 7, and 8 bits. ? parity generation and checking: odd, even mark, space or none. ? one or two stop bits. ? 16 byte receive and transmit fifos. ? built-in baud rate generator, including a fractional rate divider for great versatility. ? supports dma for both transmit and receive. ? auto-baud capability. ? break generation and detection. ? multiprocessor addressing mode. ? rs-485 support. UM10430 chapter 33: lpc18xx uart1 rev. 00.13 ? 20 july 2011 user manual table 687. uart1 clocking and power control base clock branch clock maximum frequency uart1 clock to register interface base_m3_clk clk_m3_uart0 150 mhz uart1 peripheral clock (pclk) base_ uart1_clk clk_apb0_uart1 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 744 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.4 pin description table 688: uart1 pin description pin direction description rxd1 input serial input. serial receive data. txd1 output serial output. serial transmit data. cts1 input clear to send. active low signal indicates if the external modem is ready to accept transmitted data via txd1 from the uart1. in normal operation of the modem interface (u1mcr[4] = 0), the complement value of this signal is stored in u1msr[4]. state change information is stored in u1msr[0] and is a source for a priority level 4 interrupt, if enabled (u1ier[3] = 1). clear to send. cts1 is an asynchronous, active lo w modem status signal. its condition can be checked by reading bit 4 (cts) of the modem status register. bit 0 (dcts) of the modem status register (msr) indicates that cts1 has changed states since the last read from the msr. if the modem status interrupt is enabled when cts1 changes levels and the auto-cts mode is not enabled, an interrupt is generated. cts1 is also used in the auto-cts mode to control the transmitter. dcd1 input data carrier detect. active low signal indicates if the external modem has established a communication link with the uart1 and data may be exchanged. in normal operation of the modem interface (u1mcr[4]=0), the complement value of this signal is stored in u1msr[7]. state change information is stored in u1msr3 and is a source for a priority level 4 interrupt, if enabled (u1ier[3] = 1). dsr1 input data set ready. active low signal indicates if the external modem is ready to establish a communications link with the uart1. in normal o peration of the modem interface (u1mcr[4] = 0), the complement value of this signal is stored in u1msr[5]. state change information is stored in u1msr[1] and is a source for a priority level 4 interrupt, if enabled (u1ier[3] = 1). dtr1 output data terminal ready. active low signal indicates that the uart1 is ready to establish connection with external modem. the complement value of this signal is stored in u1mcr[0]. the dtr pin can also be used as an rs-485/eia-485 output enable signal. ri1 input ring indicator. active low signal indicates that a telephone ringing signal has been detected by the modem. in normal operation of the modem interface (u1mcr[4] = 0), the complement value of this signal is stored in u1msr[6]. state change information is stored in u1msr[2] and is a source for a priority level 4 interrupt, if enabled (u1ier[3] = 1). rts1 output request to send. active low signal indicates that the uart1 would like to transmit data to the external modem. the complement value of this signal is stored in u1mcr[1]. in auto-rts mode, rts1 is used to control the transmitter fifo threshold logic. request to send. rts1 is an active low signal informing the modem or data set that the uart is ready to receive data. rts1 is set to the active (low) level by setting the rts modem control register bit and is set to the inactive (high) level either as a result of a system reset or during loop-back mode operations or by clearing bit 1 (rts) of the mcr. in the auto-rts mode, rts1 is controlled by the transmitter fifo threshold logic. the rts pin can also be used as an rs-485/eia-485 output enable signal. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 745 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5 register description uart1 contains registers organized as shown in table 689 . the divisor latch access bit (dlab) is contained in u1lcr[7] and enables access to the divisor latches. reset value reflects the data stored in used bits only. it does not include the content of reserved bits. table 689: register overview: uart1 (base address 0x4008 2000) name access address offset description reset value rbr ro 0x000 receiver buffer register. contains the next received character to be read. (dlab=0) na thr wo 0x000 transmit holding register. the next character to be transmitted is written here. (dlab=0) na dll r/w 0x000 divisor latch lsb. least significant byte of the baud rate divisor value. the full divisor is used to generate a baud rate from the fractional rate divider. (dlab=1) 0x01 dlm r/w 0x004 divisor latch msb. most significant byte of the baud rate divisor value. the full divisor is used to generate a baud rate from the fractional rate divider.(dlab=1) 0x00 ier r/w 0x004 interrupt enable register. contains individual interrupt enable bits for the 7 potential uart1 interrupts. (dlab=0) 0x00 iir ro 0x008 interrupt id register. identifies which interrupt(s) are pending. 0x01 fcr wo 0x008 fifo control register. controls uart1 fifo usage and modes. 0x00 lcr r/w 0x00c line control register. contains controls for frame formatting and break generation. 0x00 mcr r/w 0x010 modem control register. contains controls for flow control handshaking and loopback mode. 0x00 lsr ro 0x014 line status register. contains flags for transmit and receive status, including line errors. 0x60 msr ro 0x018 modem status register. contains handshake signal status flags. 0x00 scr r/w 0x01c scratch pad register. 8-bit temporary storage for software. 0x00 acr r/w 0x020 auto-baud control register. contains controls for the auto-baud feature. 0x00 fdr r/w 0x028 fractional divider register. generates a clock input for the baud rate divider. 0x10 ter r/w 0x030 transmit enable register. turns off uart transmitter for use with software flow control. 0x80 rs485ctrl r/w 0x04c rs-485/eia-485 control. contains controls to configure various aspects of rs-485/eia-485 modes. 0x00 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 746 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 rs485adrma tch r/w 0x050 rs-485/eia-485 address match. contains the address match value for rs-485/eia-485 mode. 0x00 rs485dly r/w 0x054 rs-485/eia-485 direction control delay. 0x00 fifolvl ro 0x058 fifo level regist er. provides the current fill levels of the transmit and receive fifos. 0x00 table 689: register overview: uart1 (base address 0x4008 2000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 747 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.1 uart1 receiver buffer register (when dlab = 0) the u1rbr is the top byte of the uart1 rx fifo. the top byte of the rx fifo contains the oldest character received and can be read via the bus interface. the lsb (bit 0) represents the ?oldest? received data bit. if the character received is less than 8 bits, the unused msbs are padded with zeroes. the divisor latch access bit (dlab) in u1l cr must be zero in order to access the u1rbr. the u1rbr is always read-only. since pe, fe and bi bits correspond to the by te sitting on the top of the rbr fifo (i.e. the one that will be read in the next read from the rbr), t he right appr oach for fetching the valid pair of received byte and its status bits is first to read the content of the u1lsr register, and then to read a byte from the u1rbr. 33.5.2 uart1 transmitter hold ing register (when dlab = 0) the write-only u1thr is the top byte of the uart1 tx fifo. the top byte is the newest character in the tx fifo and can be written via the bus interface. the lsb represents the first bit to transmit. the divisor latch access bit (dlab) in u1l cr must be zero in order to access the u1thr. the u1thr is write-only. 33.5.3 uart1 divisor latch lsb a nd msb registers (when dlab = 1) the uart1 divisor latch is part of the uart 1 baud rate generator and holds the value used, along with the fractional divider, to divide the apb clock (pclk) in order to produce the baud rate clock, which must be 16x the desired baud rate. the u1dll and u1dlm registers together form a 16 -bit divisor where u1dll contains the lower 8 bits of the divisor and u1dlm contains the higher 8 bits of the divisor. a 0x0000 value is treated like a 0x0001 value as division by zero is not allowed.the divisor latch access bit (dlab) in u1lcr must be one in order to access th e uart1 divisor latches. details on how to select the right value for u1dll and u1dlm can be found later in this chapter, see section 33.5.16 . table 690: uart1 receiver buffer register when dlab = 0 (rbr - address 0x4008 2000 ) bit description bit symbol description reset value 7:0 rbr receiver buffer. contains the oldest received byte in the uart1 rx fifo. undefined 31:8 - reserved, the value read from a reserved bit is not defined. na table 691: uart1 transmitter holding register when dlab = 0 (thr - address 0x4008 2000 ) bit description bit symbol description reset value 7:0 thr transmit holding register. writing to the uart1 transmit holding register causes the data to be stored in the uart1 transmit fifo. the byte will be sent when it reaches the bottom of the fifo and the transmitter is available. na 31:8 - reserved, user software should not write ones to reserved bits. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 748 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.4 uart1 interrupt enable register (when dlab = 0) the u1ier is used to enable th e four uart1 interrupt sources. table 692: uart1 divisor latch lsb register when dlab = 1 (dll - address 0x4008 2000 ) bit description bit symbol description reset value 7:0 dllsb divisor latch lsb. the uart1 divisor latch lsb register, along with the u1dlm register, determines the baud rate of the uart1. 0x01 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 693: uart1 divisor latch msb register when dlab = 1 (dlm - address 0x4008 2004 ) bit description bit symbol description reset value 7:0 dlmsb divisor latch msb. the uart1 divisor latch msb register, along with the u1dll register, determines the baud rate of the uart1. 0x00 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 694: uart1 interrupt enable register when dlab = 0 (ier - address 0x4008 2004 ) bit description bit symbol value description reset value 0 rbrie rbr interrupt enable. enables the receive data available interrupt for uart1. it also controls the character receive time-out interrupt. 0 0 disable the rda interrupts. 1 enable the rda interrupts. 1 threie thre interrupt enable. enables the thre interrupt for uart1. the status of this interrupt can be read from u1lsr[5]. 0 0 disable the thre interrupts. 1 enable the thre interrupts. 2 rxie rx line interrupt enable. enables the uart1 rx line status interrupts. the status of this interrupt can be read from u1lsr[4:1]. 0 0 disable the rx line status interrupts. 1 enable the rx line status interrupts. 3 msie modem status interrupt enable. enables the modem interrupt. the status of this interrupt can be read from u1msr[3:0]. 0 0 disable the modem interrupt. 1 enable the modem interrupt. 6:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 749 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.5 uart1 interrupt identification register the u1iir provides a status code that denot es the priority and source of a pending interrupt. the interrupts are frozen during an u1 iir access. if an interrupt occurs during an u1iir access, the interrupt is recorded for the next u1iir access. 7 ctsie cts interrupt enable. if auto-cts mode is enabled this bit enables/disables the modem status interrupt generation on a cts1 signal transition. if auto-cts mode is disabled a cts1 transition will generate an interrupt if modem status interrupt enable (u1ier[3]) is set. in normal operation a cts1 signal transition will generate a modem status interrupt unless the interrupt has been disabled by clearing the u1ier[3] bit in the u1ier register. in auto-cts mode a transition on the cts1 bit will trigger an interrupt only if both the u1ier[3] and u1ier[7] bits are set. 0 0 disable the cts interrupt. 1 enable the cts interrupt. 8 abeoie enables the end of auto-baud interrupt. 0 0 disable end of auto-baud interrupt. 1 enable end of auto-baud interrupt. 9 abtoie enables the auto-baud time-out interrupt. 0 0 disable auto-baud time-out interrupt. 1 enable auto-baud time-out interrupt. 31:10 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 694: uart1 interrupt enable register when dlab = 0 (ier - address 0x4008 2004 ) bit description bit symbol value description reset value table 695: uart1 interrupt identification register (iir - address 0x4008 2008) bit description bit symbol value description reset value 0 intstatus interrupt status. note that u1iir[0] is active low. the pending interrupt can be determined by evaluating u1iir[3:1]. 1 0 at least one interrupt is pending. 1 no interrupt is pending. 3:1 intid interrupt identification. u1ier[3:1] identifies an interrupt corresponding to the uart1 rx or tx fifo. all other combinations of u1ier[3:1] not listed below are reserved (100,101,111). 0 0x3 1 - receive line status (rls). 0x2 2a - receive data available (rda). 0x6 2b - character time-out indicator (cti). 0x1 3 - thre interrupt. 0x0 4 - modem interrupt. 5:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na 7:6 fifoenabl e copies of u1fcr[0]. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 750 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 bit u1iir[9:8] are set by the auto-baud function and signal a time-out or end of auto-baud condition. the auto-baud interrupt conditions are cleared by setting the corresponding clear bits in the auto-baud control register. if the intstatus bit is 1 no interr upt is pending and the intid bits will be zero. if the intstatus is 0, a non auto-baud interrupt is pending in which case the intid bits identify the type of interrupt and handling as described in table 696 . given the status of u1iir[3:0], an interrupt handler routine can determine the ca use of the interrupt and how to clear the active interrupt. the u1iir must be read in order to clear the interrupt prior to exiting the interrupt service routine. the uart1 rls interrupt (u1iir[3:1] = 011) is the highest priority interrupt and is set whenever any one of four error conditions occur on the uart1rx input: overrun error (oe), parity error (pe), framing error (fe) and break interrupt (bi). the uart1 rx error condition that set the interrupt can be observed via u1lsr[4:1]. the interrupt is cleared upon an u1lsr read. the uart1 rda interrupt (u1iir[3:1] = 010) shar es the second level priority with the cti interrupt (u1iir[3:1] = 110). the rda is acti vated when the uart1 rx fifo reaches the trigger level defined in u1fcr7:6 and is reset when the uart1 rx fifo depth falls below the trigger level. when the rda interrupt goes active, the cpu can read a block of data defined by the trigger level. the cti interrupt (u1iir[3:1] = 11 0) is a second level interrup t and is set when the uart1 rx fifo contains at least one character and no uart1 rx fifo activity has occurred in 3.5 to 4.5 character times. an y uart1 rx fifo activity (read or write of uart1 rsr) will clear the interrupt. this interrupt is intended to flush the uart1 rbr after a message has been received that is not a multiple of the tr igger level size. for example, if a peripheral wished to send a 105 character message an d the trigger level was 10 characters, the cpu would receive 10 rda interrupts resulting in the transfer of 100 characters and 1 to 5 cti interrupts (depending on the service routine) resulting in the tran sfer of the remaining 5 characters. 8 abeoint end of auto-baud interrupt. true if auto-baud has finished successfully and interrupt is enabled. 0 9 abtoint auto-baud time-out interrupt. true if auto-baud has timed out and interrupt is enabled. 0 31:10 - reserved, the value read from a reserved bit is not defined. na table 695: uart1 interrupt identification register (iir - address 0x4008 2008) bit description bit symbol value description reset value table 696: uart1 interrupt handling u1iir[3:0] value [1] priority interrupt type interrupt source interrupt reset 0001 - none none - 0110 highest rx line status / error oe [2] or pe [2] or fe [2] or bi [2] u1lsr read [2] 0100 second rx data available rx data available or trigger level reached in fifo (u1fcr0=1) u1rbr read [3] or uart1 fifo drops below trigger level www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 751 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 [1] values "0000", ?0011?, ?0101?, ?0111?, ?1000?, ?100 1?, ?1010?, ?1011?,?1101?,?1110?,?1111? are reserved. [2] for details see section 33.5.10 ? uart1 line status register ? [3] for details see section 33.5.1 ? uart1 receiver buffer register (when dlab = 0) ? [4] for details see section 33.5.5 ? uart1 interrupt identification register ? and section 33.5.2 ? uart1 transmitter holding register (when dlab = 0) ? the uart1 thre interrupt (u1i ir[3:1] = 001) is a third leve l interrupt and is activated when the uart1 thr fifo is empty provided certain initialization conditions have been met. these initialization conditions are inten ded to give the uart1 thr fifo a chance to fill up with data to eliminate many thre interr upts from occurring at system start-up. the initialization conditions implement a one c haracter delay minus the stop bit whenever thre = 1 and there have not been at least two characters in the u1thr at one time since the last thre = 1 event. this delay is pr ovided to give the cpu time to write data to u1thr without a thre interr upt to decode and service. a thre interrupt is set immediately if the uart1 thr fifo has held two or more characters at one time and currently, the u1thr is empty. the thre inte rrupt is reset when a u1thr write occurs or a read of the u1iir occurs and the thre is the highest interr upt (u1iir[3:1] = 001). it is the lowest priority interrupt and is activated whenever there is any state change on modem inputs pins, dcd, dsr or cts. in addition, a low to high transition on modem input ri will gene rate a modem interrupt. the source of the modem interrupt can be determined by examining u1msr[3:0]. a u1 msr read will clear the modem interrupt. 33.5.6 uart1 fifo control register the write-only u1fcr controls the oper ation of the uart1 rx and tx fifos. 1100 second character time-out indication minimum of one character in the rx fifo and no character input or removed during a time period depending on how many characters are in fifo and what the trigger level is set at (3.5 to 4.5 character times). the exact time will be: [(word length) ? 7 - 2] ? 8 + [(trigger level - number of characters) ? 8 + 1] rclks u1rbr read [3] 0010 third thre thre [2] u1iir read [4] (if source of interrupt) or thr write 0000 fourth modem status cts or dsr or ri or dcd msr read table 696: uart1 interrupt handling u1iir[3:0] value [1] priority interrupt type interrupt source interrupt reset table 697: uart1 fifo control register (fcr - address 0x4008 2008) bit description bit symbol value description reset value 0 fifoen fifo enable. 0 0 must not be used in the application. 1 active high enable for both uart1 rx and tx fifos and u1fcr[7:1] access. this bit must be set for proper uart1 operation. any transition on this bit will automatically clear the uart1 fifos. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 752 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.6.1 dma operation the user can optionally operate the uart tr ansmit and/or receive using dma. the dma mode is determined by the dma mode select bit in the fcr register. note that for dma operation as for any operation of the uart, the fifos must be enabled via the fifo enable bit in the fcr register. uart receiver dma in dma mode, the receiver dm a request is asserted on the event of the receiver fifo level becoming equal to or greater than trigger level, or if a character time-out occurs. see the description of the rx trigger level above. the receiver dma request is cleared by the dma controller. uart transmitter dma in dma mode, the transmitter dma request is asserted on the event of the transmitter fifo transitioning to not full. the transmitter dma request is cleared by the dma controller. 33.5.7 uart1 line control register the u1lcr determines the format of the data character that is to be transmitted or received. 1 rxfifores rx fifo reset. 0 0 no impact on either of uart1 fifos. 1 writing a logic 1 to u1fcr[1] will clear all bytes in uart1 rx fifo, reset the pointer logic. this bit is self-clearing. 2 txfifores tx fifo reset. 0 0 no impact on either of uart1 fifos. 1 writing a logic 1 to u1fcr[2] will clear all bytes in uart1 tx fifo, reset the pointer logic. this bit is self-clearing. 3 dmamode dma mode select. when the fifo enable bit (bit 0 of this register) is set, this bit selects the dma mode. see section 33.5.6.1 . 0 5:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na 7:6 rxtriglvl rx trigger level. these two bits determine how many receiver uart1 fifo characters must be written before an interrupt is activated. 0 0x0 trigger level 0 (1 character or 0x01). 0x1 trigger level 1 (4 characters or 0x04). 0x2 trigger level 2 (8 characters or 0x08). 0x3 trigger level 3 (14 characters or 0x0e). 31:8 - reserved, user software should not write ones to reserved bits. na table 697: uart1 fifo control register (fcr - address 0x4008 2008) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 753 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.8 uart1 modem control register the u1mcr enables the modem loopback mode and controls the modem output signals. table 698: uart1 line control register (lcr - address 0x4008 200c) bit description bit symbol value description reset value 1:0 wls word length select. 0 0x0 5-bit character length. 0x1 6-bit character length. 0x2 7-bit character length. 0x3 8-bit character length. 2 sbs stop bit select. 0 0 1 stop bit. 1 2 stop bits (1.5 if u1lcr[1:0]=00). 3 pe parity enable. 0 0 disable parity generation and checking. 1 enable parity generation and checking. 5:4 ps parity select. 0 00 odd parity. number of 1s in the transmitted character and the attached parity bit will be odd. 01 even parity. number of 1s in the transmitted character and the attached parity bit will be even. 10 forced "1" stick parity. 11 forced "0" stick parity. 6 bc break control. 0 0 disable break transmission. 1 enable break transmission. output pin uart1 txd is forced to logic 0 when u1lcr[6] is active high. 7 dlab divisor latch access bit (dlab) 0 0 disable access to divisor latches. 1 enable access to divisor latches. 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 699: uart1 modem control register (mcr - address 0x4008 2010) bit description bit symbol value description reset value 0 dtrctrl - dtr control. source for modem output pin, dtr. this bit reads as 0 when modem loopback mode is active. 0 1 rtsctrl - rtscontrol. source for modem output pin rts. this bit reads as 0 when modem loopback mode is active. 0 3:2 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 754 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.9 auto-flow control if auto-rts mode is enabled the uart1?s re ceiver fifo hardware controls the rts1 output of the uart1. if the auto-cts mode is enabled the uart1?s u1tsr hardware will only start transmitting if the cts1 input signal is asserted. 33.5.9.1 auto-rts the auto-rts function is enabled by setting th e rtsen bit. auto-rts data flow control originates in the u1rbr module and is linke d to the programmed receiver fifo trigger level. if auto-rts is enabled, th e data-flow is controlled as follows: when the receiver fifo level reaches the programmed trigger level, rts1 is de-asserted (to a high value). it is possible that the sending uart sends an additional byte after the trigger level is reached (assuming the sending uart has another byte to send) because it might not recognize the de-assertion of rts1 until after it has begun sending the additional byte. rts1 is automatically reasse rted (to a low value) once the receiver fifo has reached the previous trigger level. the re-assertion of rts1 signals to the sending uart to continue transmitting data. if auto-rts mode is disabled, the rtsen bit co ntrols the rts1 output of the uart1. if auto-rts mode is enabled, hardware controls the rts1 output, and the actual value of rts1 will be copied in the rts control bit of the uart1. as lo ng as auto-rts is enabled, the value of the rts control bit is read-only for software. 4 lms loopback mode select. the modem loopback mode provides a mechanism to perform diagnostic loopback testing. serial data from the transmitter is connected internally to serial input of the receiver. input pin, rxd1, has no effect on loopback and output pin, txd1 is held in marking state. the 4 modem inputs (cts , dsr, ri and dcd) are disconnected externally. externally, the modem outputs (rts, dtr) are set inactive. internally, the 4 modem outputs are connected to the 4 modem inputs. as a result of these connections, the upper 4 bits of the u1msr will be driven by the lower 4 bits of the u1mcr rather than the 4 modem inputs in normal mode. this permits modem status interrupts to be generated in loopback mode by writing the lower 4 bits of u1mcr. 0 0 disable modem loopback mode. 1 enable modem loopback mode. 5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 6 rtsen rts enable. 0 0 disable auto-rts flow control. 1 enable auto-rts flow control. 7 ctsen cts enable. 0 0 disable auto-cts flow control. 1 enable auto-cts flow control. 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 699: uart1 modem control register (mcr - address 0x4008 2010) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 755 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 example: suppose the uart1 operating in ?550 mode has trigger level in u1fcr set to 0x2 then if auto-rts is enabled the uart1 w ill de-assert the rts1 ou tput as soon as the receive fifo contains 8 bytes ( table 697 on page 751 ). the rts1 output will be reasserted as soon as the receive fifo hits the previous trigger level: 4 bytes. 33.5.9.2 auto-cts the auto-cts function is enabled by setting the ctsen bit. if auto-cts is enabled the transmitter circuitry in the u1tsr module ch ecks cts1 input before sending the next data byte. when cts1 is active (low), the transmitter sends the next byte. to stop the transmitter from sending the following byte, cts1 must be released before the middle of the last stop bit that is currently being s ent. in auto-cts mode a change of the cts1 signal does not trigger a modem status interrup t unless the cts interrupt enable bit is set, delta cts bit in the u1 msr will be set though. table 700 lists the conditions for generating a modem status interrupt. the auto-cts function reduces interrupts to the host system. when flow control is enabled, a cts1 state change does not tr igger host interrupts because the device automatically controls its own transmitter. without auto-cts, the transmitter sends any data present in the transmit fifo and a receiver overrun error can result. figure 96 illustrates the auto-cts functional timing. fig 95. auto-rts functional timing start byte n stop start bits0..7 stop start bits0..7 stop n-1 n n-1 n-1 n-2 n-2 m+2 m+1 m m-1 uart1 rx rts1 pin uart1 rx fifo level uart1 rx fifo read ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ table 700: modem status interrupt generation enable modem status interrupt (u1er[3]) ctsen (u1mcr[7]) cts interrupt enable (u1ier[7]) delta cts (u1msr[0]) delta dcd or trailing edge ri or delta dsr (u1msr[3] or u1msr[2] or u1msr[1]) modem status interrupt 0xxxx no 10x00 no 10x1x yes 10xx1 yes 110x0 no 110x1 yes 11100 no 1111x yes 111x1 yes www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 756 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 while starting transmission of the initial character the cts1 signal is asserted. transmission will stall as soon as the pend ing transmission has comp leted. the uart will continue transmitting a 1 bit as long as cts1 is de-asserted (high). as soon as cts1 gets de-asserted transmission resumes and a start bit is sent followed by the data bits of the next character. 33.5.10 uart1 line status register the u1lsr is a read-only register that prov ides status information on the uart1 tx and rx blocks. fig 96. auto-cts functional timing start bits0..7 start bits0..7 stop start bits0..7 stop uart1 tx cts1 pin ~ ~ ~ ~ ~ ~ ~ ~ stop table 701: uart1 line status register (lsr - address 0x4008 2014) bit description bit symbol value description reset value 0 rdr receiver data ready. u1lsr[0] is set when the u1rbr holds an unread character and is cleared when the uart1 rbr fifo is empty. 0 0 the uart1 receiver fifo is empty. 1 the uart1 receiver fifo is not empty. 1 oe overrun error. the overrun error condition is set as soon as it occurs. an u1lsr read clears u1lsr[1]. u1lsr[1] is set when uart1 rsr has a new character assembled and the uart1 rbr fifo is full. in this case, the uart1 rbr fifo will not be overwritten and the character in the uart1 rsr will be lost. 0 0 overrun error status is inactive. 1 overrun error status is active. 2 pe parity error. when the parity bit of a received character is in the wrong state, a parity error occurs. an u1lsr read clears u1lsr[2]. time of parity error detection is dependent on u1fcr[0]. note: a parity error is associated with the character at the top of the uart1 rbr fifo. 0 0 parity error status is inactive. 1 parity error status is active. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 757 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.11 uart1 modem status register the u1msr is a read-only register that provides status information on the modem input signals. u1msr[3:0] is cleared on u1msr read. note that modem signals have no direct effect on uart1 operation, they facilit ate software implementation of modem signal operations. 3 fe framing error. when the stop bit of a received character is a logic 0, a framing error occurs. an u1lsr read clears u1lsr[3]. the time of the framing error detection is dependent on u1fcr0. upon detection of a framing error, the rx will attempt to resynchronize to the data and assume that the bad stop bit is actually an early start bit. however, it cannot be assumed that the next received byte will be correct even if there is no framing error. note: a framing error is associated with the character at the top of the uart1 rbr fifo. 0 0 framing error status is inactive. 1 framing error status is active. 4 bi break interrupt. when rxd1 is held in the spacing state (all zeroes) for one full character transmission (start, data, parity, stop), a break interrupt occurs. once the break condition has been detected, the receiver goes idle until rxd1 goes to marking state (all ones). an u1lsr read clears this status bit. the time of break detection is dependent on u1fcr[0]. note: the break interrupt is associated with the character at the top of the uart1 rbr fifo. 0 0 break interrupt status is inactive. 1 break interrupt status is active. 5 thre transmitter holding register empty. thre is set immediately upon detection of an empty uart1 thr and is cleared on a u1thr write. 1 0 u1thr contains valid data. 1 u1thr is empty. 6 temt transmitter empty. temt is set when both u1thr and u1tsr are empty; temt is cleared when either the u1tsr or the u1thr contain valid data. 1 0 u1thr and/or the u1tsr contains valid data. 1 u1thr and the u1tsr are empty. 7 rxfe error in rx fifo. u1lsr[7] is set when a character with a rx error such as framing error, parity error or break interrupt, is loaded into the u1rbr. this bit is cleared when the u1lsr register is read and there are no subsequent errors in the uart1 fifo. 0 0 u1rbr contains no uart1 rx errors or u1fcr[0]=0. 1 uart1 rbr contains at least one uart1 rx error. 31:8 - reserved, the value read from a reserved bit is not defined. na table 701: uart1 line status register (lsr - address 0x4008 2014) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 758 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.12 uart1 scratch pad register the u1scr has no effect on the uart1 operat ion. this register can be written and/or read at user?s discretion. there is no provision in the interrup t interface that would indicate to the host that a read or write of the u1scr has occurred. 33.5.13 uart1 auto-ba ud control register the uart1 auto-baud control register (u1acr) controls the process of measuring the incoming clock/data rate for the baud rate generation and can be read and written at user?s discretion. table 702: uart1 modem status register (msr - address 0x4008 2018) bit description bit symbol value description reset value 0 dcts delta cts. set upon state change of input cts. cleared on an u1msr read. 0 0 no change detected on modem input, cts. 1 state change detected on modem input, cts. 1 ddsr delta dsr. set upon state change of input dsr. cleared on an u1msr read. 0 0 no change detected on modem input, dsr. 1 state change detected on modem input, dsr. 2 teri trailing edge ri. set upon low to high transition of input ri. cleared on an u1msr read. 0 0 no change detected on modem input, ri. 1 low-to-high transition detected on ri. 3 ddcd delta dcd. set upon state change of input dcd. cleared on an u1msr read. 0 0 no change detected on modem input, dcd. 1 state change detected on modem input, dcd. 4 cts - clear to send state. complement of input signal cts. this bit is connected to u1mcr[1] in modem loopback mode. 0 5 dsr - data set ready state. complement of input signal dsr. this bit is connected to u1mcr[0] in modem loopback mode. 0 6 ri - ring indicator state. complement of input ri. this bit is connected to u1mcr[2] in modem loopback mode. 0 7 dcd - data carrier detect state. complement of input dcd. this bit is connected to u1mcr[3] in modem loopback mode. 0 31:8 - - reserved, the value read from a reserved bit is not defined. na table 703: uart1 scratch pad register (scr - address 0x4008 2014) bit description bit symbol description reset value 7:0 pad scratch pad. a readable, writable byte. 0x00 31:8 - reserved, the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 759 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.14 auto-baud the uart1 auto-baud function can be used to measure the incoming baud-rate based on the ?at? protocol (hayes co mmand). if enabled the auto-baud feature will measure the bit time of the receive data stream and set the divisor latch registers u1dlm and u1dll accordingly. remark: the fractional rate divider is not conn ected during auto-baud operations, and therefore should not be used when the auto-baud feature is needed. auto-baud is started by setting the u1acr st art bit. auto-baud can be stopped by clearing the u1acr start bit. the start bit will clear once auto-baud has finished and reading the bit will return the status of auto-baud (pendi ng/finished). two auto-baud measuring modes are availa ble which can be selected by the u1acr mode bit. in mode 0 the baud-rate is measured on two subs equent falling edges of the uart1 rx pin (the falling edge of the start bit and the falling edge of the least significant bit). in mode 1 the baud-rate is measured between the falling edge and the subsequent rising edge of the uart1 rx pin (the length of the start bit). the u1acr autorestart bit can be used to automatically restart baud-rate measurement if a time-out occurs (the rate measurement co unter overflows). if this bit is set the rate measurement will restart at the next falling edge of the uart1 rx pin. the auto-baud function can generate two interrupts. table 704: autobaud control register ( acr - address 0x4008 2020) bit description bit symbol value description reset value 0 start auto-baud start bit. this bit is automatically cleared after auto-baud completion. 0 0 auto-baud stop (auto-baud is not running). 1 auto-baud start (auto-baud is running). auto-baud run bit. this bit is automatically cleared after auto-baud completion. 1 mode auto-baud mode select bit. 0 0 mode 0. 1 mode 1. 2 autoresta rt auto-baud restart bit. 0 0no restart 1 restart in case of time-out (counter restarts at next uart1 rx falling edge) 7:3 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 8 abeointcl r end of auto-baud interrupt clear bit (write-only). 0 0 writing a 0 has no impact. 1 writing a 1 will clear the corresponding interrupt in the u1iir. 9 abtointclr auto-baud time-out interrupt clear bit (write-only). 0 0 writing a 0 has no impact. 1 writing a 1 will clear the corresponding interrupt in the u1iir. 31:10 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 760 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 ? the u1iir abtoint inte rrupt will get set if the interrup t is enabled (u1ier abtointen is set and the auto-baud rate measurement counter overflows). ? the u1iir abeoint interr upt will get set if the interrupt is enabled (u1ier abeointen is set and the auto-baud has completed successfully). the auto-baud interrupts have to be cleared by setting the corresponding u1acr abtointclr and abeointen bits. typically the fractional baud-rate generat or is disabled (divaddval = 0) during auto-baud. however, if the fractional baud-r ate generator is enabled (divaddval > 0), it is going to impact the measuring of uart1 rx pin baud-rate, but the value of the u1fdr register is not going to be modified after rate measurement. also, when auto-baud is used, any write to u1dlm and u1dll registers should be done before u1acr register write. the minimum and the maximum baud rates su pported by uart1 ar e function of pclk, number of data bits, stop bits and parity bits. (8) 33.5.15 auto-baud modes when the software is expecting an ?at? co mmand, it configures the uart1 with the expected character format and sets the u1acr start bit. the initial values in the divisor latches u1dlm and u1dlm don?t care. because of the ?a? or ?a? ascii coding (?a" = 0x41, ?a? = 0x61), the uart1 rx pin sensed start bit and the lsb of the expected character are delim ited by two falling edges. when th e u1acr start bit is set, the auto-baud protocol will ex ecute the follo wing phases: 1. on u1acr start bit setting, the baud-rate measurement counter is reset and the uart1 u1rsr is reset. the u1rsr baud ra te is switch to the highest rate. 2. a falling edge on uart1 rx pin triggers the beginning of the start bit. the rate measuring counter will start counting pc lk cycles optionally pre-scaled by the fractional baud-rate generator. 3. during the receipt of the start bit, 16 pu lses are generated on the rsr baud input with the frequency of the (fractional baud-rate pre-scaled) uart1 input clock, guaranteeing the start bit is stored in the u1rsr. 4. during the receipt of the start bit (and the character lsb for mode = 0) the rate counter will continue incrementing with the pre-scaled uart1 input clock (pclk). 5. if mode = 0 then the rate counter will stop on next falling edge of t he uart1 rx pin. if mode = 1 then the rate counte r will stop on the next risi ng edge of the uart1 rx pin. 6. the rate counter is loaded into u1dlm/u1dll and the b aud-rate will be switched to normal operation. after setting the u1dlm/u1dll the end of auto-baud interrupt u1iir abeoint will be set, if enabled. th e u1rsr will now cont inue receiving the remaining bits of the ?a/a? character. ratemin 2p ? clk 16 2 15 ? ------------------------ - uart 1 baudrate pclk 16 2 databits paritybits stopbits ++ + ?? ? ------------------------------------------------------------------------------------------------------------ ?? ratemax == www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 761 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.16 uart1 fractional divider register the uart1 fractional divider register (u1fdr) controls the clock pre-scaler for the baud rate generation and can be read and writte n at the user?s discretion. this pre-scaler takes the apb clock and generates an output clock according to th e specified fractional requirements. important: if the fractional divider is active (divaddval > 0) and dlm = 0, the value of the dll register must be greater than 2. a. mode 0 (start bit and lsb are used for auto-baud) b. mode 1 (only start bit is used for auto-baud) fig 97. auto-baud a) mode 0 and b) mode 1 waveform uartn rx start bit lsb of 'a' or 'a' u0acr start rate counter start bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 parity stop 'a' (0x41) or 'a' (0x61) 16 cycles 16 cycles 16xbaud_rate uartn rx start bit lsb of 'a' or 'a' rate counter 'a' (0x41) or 'a' (0x61) start bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 parity stop u1acr start 16 cycles 16xbaud_rate www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 762 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 this register controls the clo ck pre-scaler for the baud rate generation. the reset value of the register keeps the fractional capabilitie s of uart1 disabled making sure that uart1 is fully software and hardware compatible with uarts not equipped with this feature. uart1 baud rate can be calculated as (n = 1): (9) where pclk is the peripheral clock, u1dlm and u1dll are the standard uart1 baud rate divider registers, and divaddval and mulval are uart1 fractional baud rate generator specific parameters. the value of mulval and divaddval should comply to the following conditions: 1. 1 ? mulval ? 15 2. 0 ? divaddval ? 14 3. divaddval < mulval the value of the u1fdr should not be modified while transmitting/receiving data or data may be lost or corrupted. if the u1fdr register value does not comply to these two requests, then the fractional divider output is undefined. if divaddval is zero then the fractional divider is disabled, and the clock will not be divided. 33.5.16.1 baud rate calculation uart1 can operate with or without using the frac tional divider. in real-life applications it is likely that the desired baud rate can be achieved using several different fractional divider settings. the fo llowing algorithm illustra tes one way of finding a set of dlm, dll, mulval, and divaddval values. such set of parameters yields a baud rate with a relative error of less than 1.1% from the desired one. table 705: uart1 fractional divider register (fdr - address 0x4008 2028) bit description bit function description reset value 3:0 divaddval baud-rate generation pre-scaler divisor value. if this field is 0, fractional baud-rate generator will not impact the uartn baudrate. 0 7:4 mulval baud-rate pre-scaler multiplier value. this field must be greater or equal 1 for uartn to operate properly, regardless of whether the fractional baud-rate generator is used or not. 1 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 uart1 baudrate pclk 16 256 u1dlm ? u1dll + ?? ? 1 divaddval mulval ----------------------------- + ?? ?? ? ------------------------------------------------------------------------------------------------------------------------------- --- = www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 763 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 fig 98. algorithm for setting uart dividers pclk, br calculating uart baudrate (br) dl est = pclk/(16 x br) dl est is an integer? divaddval = 0 mulval = 1 tr u e fr est = 1.5 dl est = int(pclk/(16 x br x fr est )) 1.1 < fr est < 1.9? pick another fr est from the range [1.1, 1.9] fr est = pclk/(16 x br x dl est ) divaddval = table(fr est ) mulval = table(fr est ) dlm = dl est [15:8] dll = dl est [7:0] end false tr u e false www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 764 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.16.1.1 example 1: pclk = 14.7456 mhz, br = 9600 according to the provided algorithm dl est = pclk/(16 x br) = 14.7456 mhz / (16 x 9600) = 96. since this dl est is an integer number, divaddval = 0, mulval = 1, dlm = 0, and dll = 96. 33.5.16.1.2 example 2: pclk = 12 mhz, br = 115200 according to the provided algorithm dl est = pclk/(16 x br) = 12 mhz / (16 x 115200) = 6.51. this dl est is not an integer number and the next step is to estimate the fr parameter. using an initial estimate of fr est = 1.5 a new dl est = 4 is calculated and fr est is recalculated as fr est = 1.628. since frest = 1.628 is within the specified range of 1.1 and 1.9, divaddval and mulval values can be obtained from the attached look-up table. the closest value for frest = 1.628 in the look-up table 706 is fr = 1.625. it is equivalent to divaddval = 5 and mulval = 8. based on these findings, the suggested uart setup would be: dlm = 0, dll = 4, divaddval = 5, and mulval = 8. according to equation 9 the uart rate is 115384. this rate has a relative error of 0.16% from the originally specified 115200. 33.5.17 uart1 transmit enable register in addition to being equipped with full hardware flow control (auto-cts and auto-rts mechanisms described above), u1ter enables implementation of software flow control, too. when txen=1, uart1 tran smitter will keep sending data as long as they are available. as soon as txen becomes 0, uart1 transmission will stop. table 706. fractional divider setting look-up table fr divaddval/ mulval fr divaddval/ mulval fr divaddval/ mulval fr divaddval/ mulval 1.000 0/1 1.250 1/4 1.500 1/2 1.750 3/4 1.067 1/15 1.267 4/15 1.533 8/15 1.769 10/13 1.071 1/14 1.273 3/11 1.538 7/13 1.778 7/9 1.077 1/13 1.286 2/7 1.545 6/11 1.786 11/14 1.083 1/12 1.300 3/10 1.556 5/9 1.800 4/5 1.091 1/11 1.308 4/13 1.571 4/7 1.818 9/11 1.100 1/10 1.333 1/3 1.583 7/12 1.833 5/6 1.111 1/9 1.357 5/14 1.600 3/5 1.846 11/13 1.125 1/8 1.364 4/11 1.615 8/13 1.857 6/7 1.133 2/15 1.375 3/8 1.625 5/8 1.867 13/15 1.143 1/7 1.385 5/13 1.636 7/11 1.875 7/8 1.154 2/13 1.400 2/5 1.643 9/14 1.889 8/9 1.167 1/6 1.417 5/12 1.667 2/3 1.900 9/10 1.182 2/11 1.429 3/7 1.692 9/13 1.909 10/11 1.200 1/5 1.444 4/9 1.700 7/10 1.917 11/12 1.214 3/14 1.455 5/11 1.714 5/7 1.923 12/13 1.222 2/9 1.462 6/13 1.727 8/11 1.929 13/14 1.231 3/13 1.467 7/15 1.733 11/15 1.933 14/15 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 765 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 although table 707 describes how to use txen bit in order to achieve hardware flow control, it is strongly suggested to let uart1 hardware implemented auto flow control features take care of this, and limit the scope of txen to so ftware flow control. u1ter enables implementation of software and hardware flow control. when txen=1, uart1 transmitter will keep sending data as long as they are availabl e. as soon as txen becomes 0, uart1 tr ansmission will stop. table 707 describes how to use txen bit in order to achieve software flow control. 33.5.18 uart1 rs485 control register the u1rs485ctrl register controls the configuration of the uart in rs-485/eia-485 mode. table 707: uart1 transmit enable register (ter - address 0x4008 2030) bit description bit symbol description reset value 6:0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na 7 txen transmit enable bit. when this bit is 1, as it is after a reset, data written to the thr is output on the txd pin as soon as any preceding data has been sent. if this bit cleared to 0 while a character is being sent, the transmission of that character is comp leted, but no further characters are sent until this bit is set again. in other wo rds, a 0 in this bit blocks the tr ansfer of characters from the thr or tx fifo into the transmit shift register. software can clear this bit when it detects that the a hardware-handshaking tx-permit signal (cts) has gone false, or with software handshaking, when it receives an xoff character (dc3). software can set this bit again when it detects that the tx-permit signal has gone true, or when it receives an xon (dc1) character. 1 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 708: uart1 rs485 control register (rs485ctrl - address 0x4008 204c) bit description bit symbol value description reset value 0 nmmen multidrop mode select. 0 0 rs-485/eia-485 normal multidrop mode (nmm) is disabled. 1 rs-485/eia-485 normal multidrop mode (nmm) is enabled. in this mode, an address is detected when a received byte causes the uart to set the parity error and generate an interrupt. 1 rxdis receive enable. 0 0 the receiver is enabled. 1 the receiver is disabled. 2 aaden auto address detect enable. 0 0 auto address detect (aad) is disabled. 1 auto address detect (aad) is enabled. 3 sel direction control. 0 0 if direction control is enabled (bit dctrl = 1), pin rts is used for direction control. 1 if direction control is enabled (bit dctrl = 1), pin dtr is used for direction control. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 766 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 33.5.19 uart1 rs-485 ad dress match register the u1rs485adrmatch register contains th e address match value for rs-485/eia-485 mode. 33.5.20 uart1 rs-485 delay value register the user may program the 8-bit rs485dly regist er with a delay between the last stop bit leaving the txfifo and the de-assertion of rts (or dtr ). this delay time is in periods of the baud clock. any delay time from 0 to 255 bit times may be programmed. 33.5.21 rs-485/eia-485 modes of operation the rs-485/eia-485 feature allows the uart to be configured as an addressable slave. the addressable slave is one of multiple slaves controlled by a single master. the uart master tr ansmitter will identify an address character by se tting the pa rity (9th) bit to ?1?. for data characters , the parity bit is set to ?0?. each uart slave receiver can be assigned a unique address. the slave can be programmed to either manually or automatically reject data following an address which is not theirs. rs-485/eia-485 normal multidrop mode (nmm) 4 dctrl direction control enable. 0 0 disable auto direction control. 1 enable auto direction control. 5oinv polarity. this bit reverses the polarity of the direction control signal on the rts (or dtr) pin. 0 0 the direction control pin will be driven to logic ?0? when the transmitter has data to be sent. it will be driven to logic ?1? after the last bit of data has been transmitted. 1 the direction control pin will be driven to logic ?1? when the transmitter has data to be sent. it will be driven to logic ?0? after the last bit of data has been transmitted. 31:6 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 708: uart1 rs485 control register (rs485ctrl - address 0x4008 204c) bit description bit symbol value description reset value table 709. uart1 rs485 address match register (rs485adrmatch - address 0x4008 2050) bit description bit symbol description reset value 7:0 adrmatch contains the address match value. 0x00 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 710. uart1 rs485 delay value register (rs485dly - address 0x4008 2054) bit description bit symbol description reset value 7:0 dly contains the direction control (rts or dtr) delay value. this register works in conjunction with an 8-bit counter. 0x00 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 767 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 setting the rs485ctrl bit 0 enables this mo de. in this mode, an address is detected when a received byte causes the uart to set the parity error and generate an interrupt. if the receiver is disabled (rs485ctrl bit 1 = ?1?) any received data bytes will be ignored and will not be st ored in the rxfifo. wh en an address byte is detected (parity bit = ?1?) it will be placed into the rxfifo and an rx data re ady interrupt w ill be generated. the processor can then read the address byte and decide whether or not to enable the receiver to accept the following data. while the receiver is enabl ed (rs485ctrl bit 1 =?0?) all received bytes will be accepted and stored in the rxfifo regardless of whether they are data or address. when an address character is received a parity error in terrupt will be g enerated and the processor can decide whether or not to disable the receiver. rs-485/eia-485 auto address detection (aad) mode when both rs485ctrl register bits 0 (9-bit mode enable) and 2 (aad mode enable) are set, the uart is in auto address detect mode. in this mode, the receiver will compare any address by te received (p arity = ?1?) to the 8-bit value programmed into the rs485adrmatch register. if the receiver is disabled (rs 485ctrl bit 1 = ?1?) any received byte w ill be discarded if it is either a data byte or an address byte which fails to match the rs485adrmatch value. when a matching address char acter is detected it will be pushed onto the rxfifo along with the parity bit, and the receiver will be automatically en abled (rs485ctrl bit 1 will be cleared by hardware). the receiver will also generate n rx data ready interrupt. while the receiver is enabl ed (rs485ctrl bit 1 = ?0?) all bytes received will be accepted and stored in the rxfifo until an address byte which does not match the rs485adrmatch value is received. when this occurs, the receiver will be automatically disabled in hardware (rs485ctrl bit 1 will be set), the received non-matching address character will not be st ored in th e rxfifo. rs-485/eia-485 auto direction control rs485/eia-485 mode includes the option of allowing the transmitter to automatically control the state of either the rts pin or the dtr pin as a direction control output signal. setting rs485ctrl bit 4 = ?1? enables this feature. direction control, if enabled, will use the rts pin when rs485ctrl bi t 3 = ?0?. it will use the dtr pin when rs485ctrl bit 3 = ?1?. when auto direction control is enabled, the sele cted pin will be asse rted (driven low) when the cpu writes data into the txfifo. th e pin will be de-assert ed (driven high) once the last bit of data has been transmitted. see bits 4 and 5 in the rs485ctrl register. the rs485ctrl bit 4 takes pr ecedence over all other mechanisms controlling rts (or dtr ) with the exception of loopback mode. rs485/eia-485 driver delay time www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 768 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 the driver delay time is the delay between th e last stop bit leaving the txfifo and the de-assertion of rts (or dtr). this delay time can be programmed in the 8-bit rs485dly register. the delay time is in periods of the baud clock. any delay time from 0 to 255 bit times may be programmed. rs485/eia-485 output inversion the polarity of the direction control signal on the rts (or dtr ) pins can be reversed by programming bit 5 in the u1rs485ctrl register. when this bit is set, the direction control pin will be driven to logic 1 wh en the transmitter has data wait ing to be sent. the direction control pin will be driven to logic 0 after the last bit of data has been transmitted. 33.5.22 uart1 fifo level register u1fifolvl register is a read-only register that allows software to read the current fifo level status. both the transmit and receive fifo levels are present in this register. 33.6 architecture the architecture of the uart1 is shown below in the block diagram. the apb interface provides a communicatio ns link between the cpu or host and the uart1. the uart1 receiver block, u1rx, monitors the serial input line, rxd1, for valid input. the uart1 rx shift register (u1rsr) accepts valid characters via rxd1. after a valid character is assembled in the u1rsr, it is passed to the uart1 rx buffer register fifo to await access by the cpu or host via the generic host interface. the uart1 transmitter block, u1tx, accepts dat a written by the cpu or host and buffers the data in the uart1 tx holding register fifo (u1thr). the uart1 tx shift register (u1tsr) reads the data stored in the u1thr and assembles the data to transmit via the serial output pin, txd1. the uart1 baud rate generator block, u1brg, generates the timing enables used by the uart1 tx block. the u1brg clock input source is the apb clock (pclk). the main clock is divided down per the divisor specified in the u1dll and u1dlm registers. this divided down clock is a 16x oversample clock, nbaudout. the modem interface contains registers u1mcr and u1msr. th is interface is responsible for handshaking between a modem peripheral and the uart1. the interrupt interface contains registers u1ier and u1iir. the interrupt interface receives several one clock wide enables from the u1tx and u1rx blocks. table 711. uart1 fifo level register (fifolvl - address 0x4008 2058) bit description bit symbol description reset value 3:0 rxfifilvl reflects the current level of the uart1 receiver fifo. 0 = empty, 0xf = fifo full. 0x00 7:4 - reserved. the value read from a reserved bit is not defined. na 11:8 txfifolvl reflects the current level of the uart1 transmitter fifo. 0 = empty, 0xf = fifo full. 0x00 31:12 - reserved, the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 769 of 1164 nxp semiconductors UM10430 chapter 33: lpc18xx uart1 status information from the u1tx and u1rx is stored in the u1lsr. control information for the u1tx and u1rx is stored in the u1lcr. fig 99. uart1 block diagram transmitter shift register transmitter holding register transmitter fifo transmitter receiver shift register receiver buffer register receiver fifo receiver tx_dma_req tx_dma_clr rx_dma_req rx_dma_clr baud rate generator fractional rate divider main divider (dlm, dll) modem control & status transmitter dma interface receiver dma interface pclk line control & status fifo control & status u1_txd u1_rxd u1_oe u1_cts u1_rts u1_dtr u1_dsr u1_ri u1_dcd rs485, irda, & auto-baud uart1 interrupt interrupt control & status www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 770 of 1164 34.1 how to read this chapter the ssp0/1 controllers are available on all lpc18xx parts. 34.2 basic configuration the ssp0/1 are configured as follows: ? see ta b l e 7 1 2 for clocking and power control. ? the ssp0/1 are reset by the ssp0/1_rst (reset #50/51). ? the ssp0/1 interrupts are connected to slots # 22/23 in the nvic. ? for connecting the ssp0/1 receive and tr ansmit lines to the gpdma, use the dmamux register in the creg block (see ta b l e 3 5 ) and enable the gpdma channel in the dma channel configuration registers ( section 16.6.20 ). 34.3 features ? compatible with motorola spi, 4-wire ti ssi, and national semiconductor microwire buses. ? synchronous serial communication. ? supports master or slave operation. ? eight-frame fifos for both transmit and receive. ? 4-bit to 16-bit frame. 34.4 general description the ssp is a synchronous serial port (ssp) controller capable of operation on a spi, 4-wire ssi, or microwire bus. it can interact with multiple masters and slaves on the bus. only a single master and a single slave can communicate on the bus during a given data transfer. data transfers are in principle full duplex, with frames of 4 to 16 bits of data flowing from the master to the slave and from th e slave to the master. in practice it is often the case that only one of these data flows carries meaningful data. the lpc18xx has two synchronous serial port controllers -- ssp0 and ssp1. UM10430 chapter 34: lpc18xx ssp0/1 rev. 00.13 ? 20 july 2011 user manual table 712. ssp0/1 clocki ng and power control base clock branch clock maximum frequency clock to ssp0 register interf ace base_m3_clk clk_m3_ssp0 150 mhz ssp0 peripheral clock (pclk) base_ssp0_clk clk_apb0_ssp0 150 mhz clock to ssp1 register interf ace base_m3_clk clk_m3_ssp1 150 mhz ssp1 peripheral clock (pclk) base_ssp1_clk clk_apb2_ssp1 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 771 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 34.5 pin description 34.6 register description the register addresses of th e ssp controllers are shown in table 714 and table 715 . table 713. ssp pi n description pin name direction interface pin name/function pin description spi ssi microwire sck0/1 i/o sck clk sk serial clock. sck/clk/sk is a clock signal used to synchronize the transfer of data. it is driven by the master and received by the slave. when the spi interface is used, the clock is programmable to be active-high or active-low, otherwise it is always active-high. sck1 only switches during a data transfer. any other time, the sspn interface either holds it in its inactive state, or does not drive it (leaves it in high-impedance state). ssel0/1 i/o ssel fs cs frame sync/slave select. when the sspn interface is a bus master, it drives this signal to an active state before the start of serial data, and then releases it to an inactive state after the serial data has been sent. the active state of this signal can be high or low depending upon the selected bus and mode. when the sspn is a bus slave, this signal qualifies the presence of data from the master, according to the protocol in use. when there is just one bus master and one bus slave, the frame sync or slave select signal from the master can be connected directly to the slave's corresponding input. when there is more than one slave on the bus, further qualification of their frame select/slave select inputs will typically be necessary to prevent more than one slave from responding to a transfer. miso0/1 i/o miso dr(m) dx(s) si(m) so(s) master in slave out. the miso signal transfers serial data from the slave to the master. when the sspn is a slave, serial data is output on this signal. when the sspn is a master , it clocks in serial data from this signal. when the sspn is a slave and is not selected by fs/ssel, it does not drive this signal (leaves it in high-impedance state). mosi0/1 i/o mosi dx(m) dr(s) so(m) si(s) master out slave in. the mosi signal transfers serial data from the master to the slave. when the sspn is a master, it outputs serial data on this signal. when the sspn is a slav e, it clocks in serial data from this signal. table 714. register overview: ssp0 (base address 0x4008 3000) name access address offset description reset value [1] cr0 r/w 0x000 control register 0. selects the serial clock rate, bus type, and data size. 0 cr1 r/w 0x004 control register 1. selects master/slave and other modes. 0 dr r/w 0x008 data register. writes fill the transmit fifo, and reads empty the receive fifo. 0 sr ro 0x00c status register 0x0000 0003 cpsr r/w 0x010 clock prescale register 0 imsc r/w 0x014 interrupt mask set and clear register 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 772 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 [1] reset value reflects the data stored in used bi ts only. it does not include reserved bits content. [1] reset value reflects the data stored in used bi ts only. it does not include reserved bits content. 34.6.1 sspcontrol register 0 this register contro ls the basic operatio n of the ssp controller. ris ro 0x018 raw interrupt status register 0x0000 0008 mis ro 0x01c masked interrupt status register 0 icr wo 0x020 sspicr interrupt clear register - dmacr r/w 0x024 ssp0 dma control register 0 table 714. register overview: ssp0 (base address 0x4008 3000) name access address offset description reset value [1] table 715. register overview: ssp1 (base address 0x400c 5000) name access address offset description reset value [1] cr0 r/w 0x000 control register 0. selects the serial clock rate, bus type, and data size. 0 cr1 r/w 0x004 control register 1. selects master/slave and other modes. 0 dr r/w 0x008 data register. writes fill the transmit fifo, and reads empty the receive fifo. 0 sr ro 0x00c status register 0x0000 0003 cpsr r/w 0x010 clock prescale register 0 imsc r/w 0x014 interrupt mask set and clear register 0 ris ro 0x018 raw interrupt status register 0x0000 0008 mis ro 0x01c masked interrupt status register 0 icr r/w 0x020 sspicr interrupt clear register - dmacr r/w 0x024 ssp1 dma control register 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 773 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 34.6.2 ssp control register 1 this register controls certain aspects of the operation of the ssp controller. table 716: ssp control register 0 (cr0 - address 0x4008 3000 (ssp0), 0x400c 5000 (ssp1)) bit description bit symbol value description reset value 3:0 dss data size select. this field controls the number of bits transferred in each frame. values 0000-0010 are not supported and should not be used. 0000 0x3 4-bit transfer 0x4 5-bit transfer 0x5 6-bit transfer 0x6 7-bit transfer 0x7 8-bit transfer 0x8 9-bit transfer 0x9 10-bit transfer 0xa 11-bit transfer 0xb 12-bit transfer 0xc 13-bit transfer 0xd 14-bit transfer 0xe 15-bit transfer 0xf 16-bit transfer 5:4 frf frame format. 00 0x0 spi 0x1 ti 0x2 microwire 0x3 this combination is not supported and should not be used. 6 cpol clock out polarity. this bit is only used in spi mode. 0 0 ssp controller maintains the bus clock low between frames. 1 ssp controller maintains the bus clock high between frames. 7 cpha clock out phase. this bit is only used in spi mode. 0 0 ssp controller captures serial data on the first clock transition of the frame, that is, the transition away from the inter-frame state of the clock line. 1 ssp controller captures serial data on the second clock transition of the frame, that is, the transition back to the inter-frame state of the clock line. 15:8 scr serial clock rate. the number of prescaler-output clocks per bit on the bus, minus one. given that cpsdvsr is the prescale divider, and the apb clock pclk clocks the prescaler, the bit frequency is pclk / (cpsdvsr ? [scr+1]). 0x00 31:16 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 774 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 34.6.3 ssp data register software can write data to be transmitted to this register, and read data that has been received. table 717: ssp control register 1 (cr1 - address 0x4008 3004 (ssp0), 0x400c 5004 (ssp1)) bit description bit symbol value description reset value 0 lbm loop back mode. 0 0 during normal operation. 1 serial input is taken from the serial output (mosi or miso) rather than the serial input pin (miso or mosi respectively). 1 sse ssp enable. 0 0 the ssp controller is disabled. 1 the ssp controller will interact with other devices on the serial bus. software should write the appropriate control information to the other ssp registers and interrupt controller regi sters, before setting this bit. 2 ms master/slave mode.this bit can only be written when the sse bit is 0. 0 0 the ssp controller acts as a master on the bus, driving the sclk, mosi, and ssel lines and receiving the miso line. 1 the ssp controller acts as a slav e on the bus, driving miso line and receiving sclk, mosi, and ssel lines. 3 sod slave output disable. this bit is relevant only in slave mode (ms = 1). if it is 1, this blocks th is ssp controller from driving the transmit data line (miso). 0 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 718: ssp data register (dr - addr ess 0x4008 3008 (ssp0), 0x400c 5008 (ssp1)) bit description bit symbol description reset value 15:0 data write: software can write data to be sent in a future frame to this register whenever the tnf bit in the status register is 1, indicating that the tx fifo is not full. if the tx fifo was previously empty and the ssp controller is not busy on the bus, transm ission of the data will begin immediately. otherwise the data written to this register will be sent as soon as all previous data has been sent (and received). if the data length is less than 16 bits, software must right-justify the data written to this register. read: software can read data from this register whenever the rne bit in the status register is 1, indicating that the rx fifo is not empty. when software reads this register, the ssp controller returns data from the least recent frame in the rx fifo. if the data length is less than 16 bits, the data is right-justified in this field with higher order bits filled with 0s. 0x0000 31:16 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 775 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 34.6.4 ssp status register this read-only register reflects t he current status of the ssp controller. 34.6.5 ssp clock prescale register this register controls the factor by which the prescaler divides the ssp peripheral clock pclk to yield the prescaler clock that is, in turn, divided by the scr factor in sspncr0, to determine the bit clock. important: the sspncpsr value must be properly initialized or the ssp controller will not be able to transmit data correctly. in slave mode, the ssp clock rate provided by the master must not exceed 1/12 of the ssp peripheral clock. the content of th e sspncpsr register is not relevant. in master mode, cpsdvsr min = 2 or larger (even numbers only). 34.6.6 ssp interrupt mask set/clear register this register controls whether each of the four possible interrup t conditions in the ssp controller are enabled. note that arm uses the word ?masked? in the opposite sense from classic computer terminology, in which ?masked? meant ?disabled?. arm uses the word ?masked? to mean ?enabled?. to avoid confusion we will not use the word ?masked?. table 719: ssp status register (sr - address 0x4008 300c (ssp0), 0x400c 500c (ssp1)) bit description bit symbol description reset value 0 tfe transmit fifo empty. this bit is 1 is the transmit fifo is empty, 0 if not. 1 1 tnf transmit fifo not full. this bit is 0 if the tx fifo is full, 1 if not. 1 2 rne receive fifo not empty. this bit is 0 if the receive fifo is empty, 1 if not. 0 3 rff receive fifo full. this bit is 1 if the receive fifo is full, 0 if not. 0 4 bsy busy. this bit is 0 if the sspn contro ller is idle, or 1 if it is currently sending/receiving a frame and/or the tx fifo is not empty. 0 31:5 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 720: ssp clock prescale register (cpsr - address 0x4008 3010 (ssp0), 0x400c 5010 (ssp1)) bit description bit symbol description reset value 7:0 cpsdvsr this even value between 2 and 254, by which pclk is divided to yield the prescaler output clock. bit 0 always reads as 0. 0 31:8 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 776 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 34.6.7 ssp raw interrupt status register this read-only register contains a 1 for ea ch interrupt condition that is asserted, regardless of whether or not the in terrupt is enabled in the sspnimsc. 34.6.8 ssp masked interr upt status register this read-only register contains a 1 for each interrupt condition that is asserted and enabled in the sspnimsc. when an ssp interr upt occurs, the interrupt service routine should read this register to dete rmine the cause(s) of the interrupt. table 721: ssp interrupt mask set/clear regi ster (imsc - address 0x4008 3014 (ssp0), 0x400c 5014 (ssp1)) bit description bit symbol description reset value 0 rorim software should set this bit to enable interrupt when a receive overrun occurs, that is, when the rx fifo is full and another frame is completely received. the arm spec implies that the preceding frame data is overwritten by the new frame data when this occurs. 0 1 rtim software should set this bit to enable interrupt when a receive time-out condition occurs. a receive time-out occurs when the rx fifo is not empty, and no has not been read for a time-out period. the time-out period is the same for master and slave modes and is determined by the ssp bit rate: 32 bits at pclk / (cpsdvsr ? [scr+1]). 0 2 rxim software should set this bit to enable interrupt when the rx fifo is at least half full. 0 3 txim software should set this bit to enable interrupt when the tx fifo is at least half empty. 0 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 722: ssp raw interrupt status register (ris - address 0x4008 3018 (ssp0), ris - 0x400c 5018 (ssp1)) bit description bit symbol description reset value 0 rorris this bit is 1 if another frame was completely received while the rxfifo was full. the arm spec implies that the preceding frame data is overwritten by the new frame data when this occurs. 0 1 rtris this bit is 1 if the rx fifo is not empty, and has not been read for a time-out period. the time-out period is the same for master and slave modes and is determined by the ssp bit rate: 32 bits at pclk / (cpsdvsr ? [scr+1]). 0 2 rxris this bit is 1 if the rx fifo is at least half full. 0 3 txris this bit is 1 if the tx fifo is at least half empty. 1 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 777 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 34.6.9 ssp interrupt clear register software can write one or more one(s) to this write-only register, to clear the corresponding interrupt condition(s) in the ssp controller. note that the other two interrupt conditions can be cleared by writing or re ading the appropriate fifo, or disabled by clearing the corresponding bit in sspnimsc. 34.6.10 ssp dma control register the sspndmacr register is the dma contro l register. it is a read/write register. table 723: ssp masked in terrupt status register (mis -address 0x40 08 301c (ssp0), 0x400c 501c (ssp1)) bit description bit symbol description reset value 0 rormis this bit is 1 if another frame was completely received while the rxfifo was full, and this interrupt is enabled. 0 1 rtmis this bit is 1 if the rx fifo is not empty, has not been read for a time-out period, and this interrupt is enabled. the time-out period is the same for master and slave modes and is determined by the ssp bit rate: 32 bits at pclk / (cpsdvsr ? [scr+1]). 0 2 rxmis this bit is 1 if the rx fifo is at least half full, and this interrupt is enabled. 0 3 txmis this bit is 1 if the tx fifo is at least half empty, and this interrupt is enabled. 0 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 724: ssp interrupt clear register (icr - address 0x4008 3020 (ssp0), icr - 0x400c 5020 (ssp1)) bit description bit symbol description reset value 0 roric writing a 1 to this bit clears the ?frame was received when rxfifo was full? interrupt. na 1 rtic writing a 1 to this bit clears the rx fifo was not empty and has not been read for a time-out period interrupt. the time-out period is the same for master and slave modes and is determined by the ssp bit rate: 32 bits at pclk / (cpsdvsr ? [scr+1]). na 31:2 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 778 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 34.7 functional description 34.7.1 texas instruments sy nchronous serial frame format figure 100 shows the 4-wire texas instruments synchronous serial frame format supported by the ssp module. for device configured as a master in this mode, clk and fs are forced low, and the transmit data line dx is tri-stated whenever the ssp is idle. once the bottom entry of the transmit fifo contains data, fs is pulsed high for one clk period. the value to be transmitted is also transferred from the transmit fifo to the serial shift register of the transmit logic. on the next rising edge of clk, the msb of the 4-bit to 16-bit data frame is shifted out on the dx pin. likewise, the msb of the received data is shifted onto the dr pin by the off-chip serial slave device. table 725: ssp dma control register (dm acr - address 0x4008 3024 (ssp0), 0x400c 5024 (ssp1)) bit description bit symbol description reset value 0 rxdmae receive dma enable. when this bit is set to one 1, dma for the receive fifo is enabled, otherwise receive dma is disabled. 0 1 txdmae transmit dma enable. when this bit is set to one 1, dma for the transmit fifo is enabled, otherwise transmit dma is disabled 0 31:2 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na a. single frame transfer b. continuous/back-to-back frames transfer fig 100. texas instruments synchronous serial frame format: a) single and b) continuous/back-to-back two frames transfer clk fs dx/dr 4 to 16 bits msb lsb clk fs dx/dr lsb msb lsb msb 4 to 16 bits 4 to 16 bits www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 779 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 both the ssp and the off-chip serial slave device then clock each data bit into their serial shifter on the falling edge of each clk. the rece ived data is transfer red from the serial shifter to the receive fifo on the first rising edge of clk after the lsb has been latched. 34.7.2 spi frame format the spi interface is a four-wire interfac e where the ssel signal behaves as a slave select. the main feature of the spi format is that the inactive state and phase of the sck signal are programmable thro ugh the cpol and cpha bits within the sspcr0 control register. 34.7.2.1 clock polarity (cpol) and phase (cpha) control when the cpol clock polarity control bit is 0, it produces a steady state low value on the sck pin. if the cpol clock polarity control bit is 1, a steady state high value is placed on the clk pin when data is not being transferred. the cpha control bit selects the clock edge that captures data and allows it to change state. it has the most impact on the first bit tr ansmitted by either allowing or not allowing a clock transition before the first data capture edge. when the cpha phase control bit is 0, data is captured on the first clock edge transition. if the cpha clock phase control bit is 1, data is captured on the second clock edge transition. 34.7.2.2 spi format with cpol=0,cpha=0 single and continuous transmission signal sequences for spi format with cpol = 0, cpha = 0 are shown in figure 101 . a. single transfer with cpol=0 and cpha=0 b. continuous transfer with cpol=0 and cpha=0 fig 101. spi frame format with cpol=0 and cpha=0 (a) single and b) continuous transfer) sck ssel mosi msb lsb q msb lsb 4 to 16 bits miso sck ssel mosi miso 4 to 16 bits 4 to 16 bits msb lsb msb lsb q msb lsb q msb lsb www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 780 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 in this configuration, during idle periods: ? the clk signal is forced low. ? ssel is forced high. ? the transmit mosi/miso pad is in high impedance. if the ssp is enabled and there is valid data within the transmit fifo, the start of transmission is signified by the ssel master signal being driven low. this causes slave data to be enabled onto the miso input line of the master. master?s mosi is enabled. one half sck period later, valid master data is transferred to the mosi pin. now that both the master and slave data have been set, the sck master clock pin goes high after one further half sck period. the data is now captured on the rising and propagated on the falling edges of the sck signal. in the case of a single word transmission, after all bits of the data word have been transferred, the ssel line is returned to its idle high state one sck period after the last bit has been captured. however, in the case of continuous back-to- back transmissions, the ssel signal must be pulsed high between each data word transfe r. this is because the slave select pin freezes the data in its serial peripheral regist er and does not allow it to be altered if the cpha bit is logic zero. theref ore the master device must raise the ssel pin of the slave device between each data transfer to enable the serial peripheral data write. on completion of the continuous transfer, the ssel pin is retur ned to its idle state one sck period after the last bit has been captured. 34.7.2.3 spi format with cpol=0,cpha=1 the transfer signal sequence for spi format with cpol = 0, cpha = 1 is shown in figure 102 , which covers both single and continuous transfers. in this configuration, during idle periods: ? the clk signal is forced low. ? ssel is forced high. ? the transmit mosi/miso pad is in high impedance. fig 102. spi frame format with cpol=0 and cpha=1 sck ssel mosi q 4 to 16 bits miso q msb msb lsb lsb www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 781 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 if the ssp is enabled and there is valid data within the transmit fifo, the start of transmission is signified by the ssel master signal being driven low. master?s mosi pin is enabled. after a further one half sck period, both master and slave valid data is enabled onto their respective transmission lines. at the same time, the sck is enabled with a rising edge transition. data is then captured on the falling edges and propagated on the rising edges of the sck signal. in the case of a single word transfer, after all bits have be en transferred, the ssel line is returned to its idle high state one sck period after the last bit has been captured. for continuous back-to-back transfers, the ssel pin is held low between successive data words and termination is the same as that of the single word transfer. 34.7.2.4 spi format with cpol = 1,cpha = 0 single and continuous transmission signal sequences for spi format with cpol=1, cpha=0 are shown in figure 103 . in this configuration, during idle periods: ? the clk signal is forced high. ? ssel is forced high. ? the transmit mosi/miso pad is in high impedance. a. single transfer with cpol=1 and cpha=0 b. continuous transfer with cpol=1 and cpha=0 fig 103. spi frame format with cpol = 1 and cpha = 0 (a) single and b) continuous transfer) sck ssel q msb lsb 4 to 16 bits miso mosi msb lsb sck ssel mosi miso 4 to 16 bits 4 to 16 bits msb lsb msb lsb q msb lsb q msb lsb www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 782 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 if the ssp is enabled and there is valid data within the transmit fifo, the start of transmission is signified by the ssel master signal being driven low, which causes slave data to be immediately transferred onto the miso line of the master. master?s mosi pin is enabled. one half period later, valid master data is tr ansferred to the mosi line. now that both the master and slave data have been set, the sck master clock pin becomes low after one further half sck period. this means that data is captur ed on the falling edges and be propagated on the rising edges of the sck signal. in the case of a single word transmission, after all bits of the data word are transferred, the ssel line is returned to its idle high state one sck period after the last bit has been captured. however, in the case of continuous back-to- back transmissions, the ssel signal must be pulsed high between each data word transfe r. this is because the slave select pin freezes the data in its serial peripheral regist er and does not allow it to be altered if the cpha bit is logic zero. theref ore the master device must raise the ssel pin of the slave device between each data transfer to enable the serial peripheral data write. on completion of the continuous transfer, the ssel pin is retur ned to its idle state one sck period after the last bit has been captured. 34.7.2.5 spi format with cpol = 1,cpha = 1 the transfer signal sequence for spi format with cpol = 1, cpha = 1 is shown in figure 104 , which covers both single and continuous transfers. in this configuration, during idle periods: ? the clk signal is forced high. ? ssel is forced high. ? the transmit mosi/miso pad is in high impedance. if the ssp is enabled and there is valid data within the transmit fifo, the start of transmission is signified by the ssel master si gnal being driven low. master?s mosi is enabled. after a further one half sck period, both master and slave data are enabled onto their respective transmi ssion lines. at the same time, th e sck is enabled with a falling edge transition. data is then captured on t he rising edges and propagated on the falling edges of the sck signal. fig 104. spi frame format with cpol = 1 and cpha = 1 sck ssel mosi q 4 to 16 bits miso q msb msb lsb lsb www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 783 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 after all bits have been transf erred, in the case of a singl e word transmission, the ssel line is returned to its idle high state one sck period after the last bit has been captured. for continuous back-to-back transmissions, th e ssel pins remains in its active low state, until the final bit of the last word has been captured, and then returns to its idle state as described above. in general, for contin uous back-to-back transfers the ssel pin is held low between successive data words and termination is the same as that of the single word transfer. 34.7.3 national semiconducto r microwire frame format figure 105 shows the microwire frame format for a single frame. figure 106 shows the same format when back-to-b ack frames are transmitted. microwire format is very similar to spi form at, except that transmission is half-duplex instead of full-duplex, using a master-slave message passing technique. each serial transmission begins with an 8-bit control wo rd that is transmitted from the ssp to the off-chip slave device. during this transmission, no incoming data is received by the ssp. after the message has been sent, the off-chip slave decodes it and, after waiting one serial clock after the last bit of the 8-bit control message has been sent, responds with the required data. the returned data is 4 to 16 bits in length, making the total frame length anywhere from 13 to 25 bits. in this configuration, during idle periods: ? the sk signal is forced low. ? cs is forced high. ? the transmit data line so is arbitrarily forced low. a transmission is trig gered by writing a cont rol byte to the transm it fifo.the falling edge of cs causes the value contained in the bottom entry of the transmit fifo to be transferred to the serial shift register of the transmit logic, and the msb of the 8-bit control frame to be shifted out onto the so pin. cs remains low for the duration of the frame transmission. the si pin remains tristated during this transmission. the off-chip serial slave device latches each control bit into its serial shifter on the rising edge of each sk. after the last bit is latched by the slave device, the control byte is decoded during a one clock wait-state, and the slave responds by transmitting data back to the ssp. each bit is driven onto si lin e on the falling edge of sk. the ssp in turn fig 105. microwire frame format (single transfer) sk cs so 4 to 16 bits output data si 8-bit control msb lsb 0 msb lsb www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 784 of 1164 nxp semiconductors UM10430 chapter 34: lpc18xx ssp0/1 latches each bit on the rising edge of sk. at t he end of the frame, for single transfers, the cs signal is pulled high one clock period afte r the last bit has been latched in the receive serial shifter, that causes the data to be transferred to the receive fifo. note: the off-chip slave device ca n tristate the receive line ei ther on the falling edge of sk after the lsb has been latched by the receiv e shiftier, or when the cs pin goes high. for continuous transfers, data transmission b egins and ends in the same manner as a single transfer. however, the cs line is continuously asserted (held low) and transmission of data occurs back to back. the control byte of the next frame follows directly after the lsb of the received data fr om the current frame. each of the received values is transferred from the receive shifter on the falling edge sk, after the lsb of the frame has been latched into the ssp. 34.7.3.1 setup and hold time requirements on cs with respect to sk in microwire mode in the microwire mode, the ssp slave samples the first bit of receive data on the rising edge of sk after cs has gone low. masters that drive a free-running sk must ensure that the cs signal has sufficient setup and hold margins with respect to the rising edge of sk. figure 107 illustrates these setup and hold time requirements. with respect to the sk rising edge on which the first bit of receive data is to be sampled by the ssp slave, cs must have a setup of at least two times the period of sk on which the ssp operates. with respect to the sk rising edge previous to this edge, cs must have a hold of at least one sk period. fig 106. microwire frame format (continuous transfers) sk cs so si msb lsb 4 to 16 bits output data 8-bit control 4 to 16 bits output data msb lsb 0 msb lsb lsb fig 107. microwire frame format setup and hold details sk cs si t hold = t sk t setup =2*t sk www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 785 of 1164 35.1 how to read this chapter this chapter applies to parts lpc1850/30/20/10 rev ?a?. the i 2 s interface is availabl e on all lpc18xx parts. 35.2 basic configuration the i 2 s interface is conf igured as follows: ? see ta b l e 7 2 6 for clocking and power control. ? the i2s0 is reset by the i2s0_rst (reset # 52). ? the i2s1 is reset by the i2s1_rst (reset # 53). ? the i2s0 interrupt is connected to slot # 28 in the nvic. ? the i2s1 interrupt is connected to slot # 29 in the nvic. ? for connecting the i2s receive and transmi t lines to the gpdma, use the dmamux register in the creg block (see ta b l e 3 5 ) and enable the gpdma channel in the dma channel configuration registers ( section 16.6.20 ). ? see ta b l e 3 7 for interconnections between the i2s transmit/receive lines and the timer and sct inputs. 35.3 features the i2s bus provides a standard communication interface for digital audio applications. the i2s bus specification defines a 3-wire serial bus, having one data, one clock, and one word select signal. the basic i2s connection has one master, which is always the master, and one slave. the i2s interface provides a separate transmit and receive channel, each of which can operate as ei ther a master or a slave. ? the i2s input can operate in both master and slave mode. the i2s output can operate in both master and slave mode, independent of the i2s input. ? capable of handling 8-bit, 16-bit, and 32-bit word sizes. ? mono and stereo audio data supported. ? versatile clocking includes independent transmit and receive fractional rate generators, a nd an ability to use a single clock in put or output fo r a 4-wire mode. UM10430 chapter 35: lpc18xx i2s interface rev. 00.13 ? 20 july 2011 user manual table 726. i2s clocking and power control base clock branch clock maximum frequency clock to the i2s0 and i2s1 register interface and i2s0/1 peripheral clock. base_apb1_clk clk_apb1_i2s 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 786 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface ? the sampling frequency (fs) can range (in prac tice) from 16 to 192 khz (16, 22.05, 32, 44.1, 48, 96, or 192 khz) for audio applications. ? separate master clock outputs for both transmit and receive channels support a clock up to 512 times the i 2 s sampling frequency. ? word select period in master mode is configurable (separately for i 2 s input and i 2 s output). ? two 8 word (32 byte) fifo data buffers are provided, one for transmit and one for receive. ? generates interrupt requests when buffer levels cross a programmable boundary. ? two dma requests, controlled by programma ble buffer levels. these are connected to the general purpose dma block. ? controls include reset, stop and mute options separately for i2s input and i2s output. 35.4 general description the i2s performs serial data out via the transmit channel and serial data in via the receive channel. these support the nxp inter ic audio format for 8-bit, 16-bit and 32-bit audio data, both for stereo and mono modes. configuration, data access and control is performed by a apb register set. data stream s are buffered by fifos with a depth of 8 words. the i2s receive and transmit stage can operat e independently in either slave or master mode. within the i2s module the difference between these modes lies in the word select (ws) signal which determines the timing of data transmissions. data words start on the next falling edge of the transmitting clock after a ws change. in stereo mode when ws is low left data is transmitted and right data when ws is high. in mono mode the same data is transmitted twice, once when ws is low and again when ws is high. ? in master mode, word select is generated internally with a 9-bit counter. the half period count value of this counter can be set in the control register. ? in slave mode, word select is input from the relevant bus pin. ? when an i2s bus is active, the word select, receive clock and transmit clock signals are sent continuously by the bus master, while data is sent continuously by the transmitter. ? disabling the i2s can be done with the stop or mute control bits separately for the transmit and receive. ? the stop bit will disable acce sses by the transmit channel or the receive channel to the fifos and will place the tran smit channel in mute mode. ? the mute control bit will place the transmit channel in mute mode. in mute mode, the transmit channel fifo operates normally, but the output is discarded and replaced by zeroes. this bit does not affect the receive channel, data reception can occur normally. 35.4.1 i2s connection schemes i2s1 is automatically a slave to i2s0 if no external pins are selected for the i2s1 clock and data lines. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 787 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface the mclk can be provided by a master or us ed by the master to create the i2s clk. mclk can also be generated internally by the audio pll through the creg block (see ta b l e 3 7 ). fig 108. i2s connections www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 788 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 35.5 pin description table 727. pin description pin name direction description i2s0/1_rx_sck input/ output receive clock. a clock signal used to synchronize the transfer of data on the receive channel. it is driven by the master and received by the slave. corresponds to the signal sck in the i2s bus specification. i2s0/1_rx_ws input/ output receive word select. selects the channel from which data is to be received. it is driven by the master and received by the slave. corresponds to the signal ws in the i2s bus specification. ws = 0 indicates that data is being received by channel 1 (left channel). ws = 1 indicates that data is being received by channel 2 (right channel). i2s0/1_rx_sda input/ output receive data. serial data, received msb first. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i2s bus specification. i2s0/1_rx_mclk output optional master clock output for the i2s receive function. i2s0/1_tx_sck input/ output transmit clock. a clock signal used to synchronize the transfer of data on the transmit channel. it is driven by the master and received by the slave. corresponds to the signal sck in the i2s bus specification. i2s0/1_tx_ws input/ output transmit word select. selects the channel to which data is being sent. it is driven by the master and received by the slave. corresponds to the signal ws in the i2s bus specification. ws = 0 indicates that data is being sent to channel 1 (left channel). ws = 1 indicates that data is being sent to channel 2 (right channel). i2s0/1_tx_sda input/ output transmit data. serial data, sent msb first. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i2s bus specification. is0/1_tx_mclk output optional master clock output for the i2s transmit function. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 789 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface fig 109. simple i2s configurations and bus timing transmitter (master) controller (master) transmitter (slave) receiver (master) sck: serial clock ws: word select sd: serial data transmitter (slave) receiver (slave) sck ws sd sck ws sd msb lsb msb word n left channel word n+1 right channel word n-1 right channel receiver (slave) sck: serial clock ws: word select sd: serial data www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 790 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 35.6 register description table 728 shows the registers associated with the i2s interface and a summary of their functions. following the table are details for each register. reset value reflects the data stored in used bits only. it does not include reserved bits content. table 728. register overview: i2s0 (base address 0x400a 2000) name access address offset description reset value dao r/w 0x000 i2s digital audio output register. contains control bits for the i2s transmit channel. 0x87e1 dai r/w 0x004 i2s digital audio input register. contains control bits for the i2s receive channel. 0x07e1 txfifo wo 0x008 i2s transmit fifo. access register for the 8 x 32-bit transmitter fifo. 0 rxfifo ro 0x00c i2s receive fifo. access register for the 8 x 32-bit receiver fifo. 0 state ro 0x010 i2s status feedback register. contains status information about the i2s interface. 0x7 dma1 r/w 0x014 i2s dma configuration register 1. contains control information for dma request 1. 0 dma2 r/w 0x018 i2s dma configuration register 2. contains control information for dma request 2. 0 irq r/w 0x01c i2s interrupt request control register. contains bits that control how the i2s interrupt request is generated. 0 txrate r/w 0x020 i2s transmit mclk divider. this register determines the i2s tx mclk rate by specifying the value to divide pclk by in order to produce mclk. 0 rxrate r/w 0x024 i2s receive mclk divider. this register determines the i2s rx mclk rate by specifying the value to divide pclk by in order to produce mclk. 0 txbitrate r/w 0x028 i2s transmit bit rate divider. this register determines the i2s transmit bit rate by specifying the value to divide tx_mclk by in order to produce the transmit bit clock. 0 rxbitrate r/w 0x02c i2s receive bit rate divider. this register determines the i2s receive bit rate by specifying the value to divide rx_mclk by in order to produce the receive bit clock. 0 txmode r/w 0x030 i2s transmit mode control. 0 rxmode r/w 0x034 i2s receive mode control. 0 table 729. register overview: i2s1 (base address 0x400a 3000) name access address offset description reset value dao r/w 0x000 i2s digital audio output register. contains control bits for the i2s transmit channel. 0x87e1 dai r/w 0x004 i2s digital audio input register. contains control bits for the i2s receive channel. 0x07e1 txfifo wo 0x008 i2s transmit fifo. access register for the 8 x 32-bit transmitter fifo. 0 rxfifo ro 0x00c i2s receive fifo. access register for the 8 x 32-bit receiver fifo. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 791 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 35.6.1 i2s digital audi o output register the dao register controls the o peration of the i2s transmit channel. the function of bits in dao are shown in table 730 . state ro 0x010 i2s status feedback register. contains status information about the i2s interface. 0x7 dma1 r/w 0x014 i2s dma configuration register 1. contains control information for dma request 1. 0 dma2 r/w 0x018 i2s dma configuration register 2. contains control information for dma request 2. 0 irq r/w 0x01c i2s interrupt request control register. contains bits that control how the i2s interrupt request is generated. 0 txrate r/w 0x020 i2s transmit mclk divider. this register determines the i2s tx mclk rate by specifying the value to divide pclk by in order to produce mclk. 0 rxrate r/w 0x024 i2s receive mclk divider. this register determines the i2s rx mclk rate by specifying the value to divide pclk by in order to produce mclk. 0 txbitrate r/w 0x028 i2s transmit bit rate divider. this register determines the i2s transmit bit rate by specifying the value to divide tx_mclk by in order to produce the transmit bit clock. 0 rxbitrate r/w 0x02c i2s receive bit rate divider. this register determines the i2s receive bit rate by specifying the value to divide rx_mclk by in order to produce the receive bit clock. 0 txmode r/w 0x030 i2s transmit mode control. 0 rxmode r/w 0x034 i2s receive mode control. 0 table 729. register overview: i2s1 (base address 0x400a 3000) name access address offset description reset value table 730. i2s digital audio output register (dao - address 0x400a 2000 (i2s0) and 0x400a 3000 (i2s1)) bit description bit symbol value description reset value 1:0 wordwidth selects the number of bytes in data as follows: 01 0x0 8-bit data 0x1 16-bit data 0x2 reserved, do not use this setting 0x3 32-bit data 2 mono when 1, data is of monaural format. when 0, the data is in stereo format. 0 3 stop when 1, disables accesses on fifos, places the transmit channel in mute mode. 0 4 reset when 1, asynchronously resets the transmit channel and fifo. 0 5 ws_sel when 0, the interface is in master mode. when 1, the interface is in slave mode. see section 35.7.2 for a summary of useful combinations for this bit with txmode. 1 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 792 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 35.6.2 i2s digital audio input register the dai register controls the operation of the i2s receive channel. the function of bits in dai are shown in ta b l e 7 3 1 . 35.6.3 i2s transmit fifo register the txfifo register provides access to the tr ansmit fifo. the function of bits in txfifo are shown in ta b l e 7 3 2 . 35.6.4 receive fifo register the i2srxfifo register provides access to the receive fifo. the function of bits in i2srxfifo are shown in table 733 . 14:6 ws_halfperiod word select half period minus 1, i.e. ws 64clk period -> ws_halfperiod = 31. 0x1f 15 mute when 1, the transmit channel sends only zeroes. 1 31:16 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 730. i2s digital audio output register (dao - address 0x400a 2000 (i2s0) and 0x400a 3000 (i2s1)) bit description bit symbol value description reset value table 731. i2s digital audio input register (dai - address 0x400a 2004 (i2s0) and 0x400a 3004 (i2s1)) bit description bit symbol value description reset value 1:0 wordwidth selects the number of bytes in data as follows: 01 0x0 8-bit data 0x1 16-bit data 0x2 reserved, do not use this setting 0x3 32-bit data 2 mono when 1, data is of monaural format. when 0, the data is in stereo format. 0 3 stop when 1, disables accesses on fifos, places the transmit channel in mute mode. 0 4 reset when 1, asynchronously reset the transmit channel and fifo. 0 5 ws_sel when 0, the interface is in master mode. when 1, the interface is in slave mode. see section 35.7.2 for a summary of useful combinations for this bit with rxmode. 1 14:6 ws_halfperiod word select half period minus 1, i.e. ws 64clk period -> ws_halfperiod = 31. 0x1f 31:15 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 732. transmit fifo register (txfifo - address 0x400a 2008 (i2s0) and 0x400a 3008 (i2s1)) bit description bit symbol description reset value 31:0 i2stxfifo 8 x 32-bit transmit fifo. 0 table 733. i2s receive fifo register (rxfifo - address 0x400a 200c (i2s0) and 0x400a 300c (i2s1)) bit description bit symbol description reset value 31:0 i2srxfifo 8 x 32-bit transmit fifo. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 793 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 35.6.5 i2s status feedback register the state register provides status informat ion about the i2s interface. the meaning of bits in state are shown in table 734 . 35.6.6 i2s dma configuration register 1 the dma1 register controls the operation of dm a request 1. the function of bits in dma1 are shown in ta b l e 7 3 5 . refer to chapter 16 ? lpc18xx general purpose dma (gpdma) controller ? for details of dma operation. this register enables the dma for the i 2 s receive and transmit channels and sets the fifo level. remark: the fifos contain eight 16-bit words. therefore, if the i 2 s controller is configured for 32-bit mode (see table 730 and table 731 ), the maximum allowed fifo level is 4. table 734. i2s status feedback register (state - address 0x400a 2010 (i2s0) and 0x400a 3010 (i2s1)) bit description bit symbol description reset value 0 irq this bit reflects the presence of receive interrupt or transmit interrupt. this is determined by comparing the current fifo levels to the rx_depth_irq and tx_depth_irq fields in the irq register. 1 1 dmareq1 this bit reflects the presence of receive or transmit dma request 1. this is determined by comparing the current fifo levels to the rx_depth_dma1 and tx_depth_dma1 fields in the dma1 register. 1 2 dmareq2 this bit reflects the presence of receive or transmit dma request 2. this is determined by comparing the current fifo levels to the rx_depth_dma2 and tx_depth_dma2 fields in the dma2 register. 1 7:3 - reserved. 0 11:8 rx_level reflects the current level of the receive fifo. 0 15:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 19:16 tx_level reflects the current level of the transmit fifo. 0 31:20 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 735. i2s dma configuration register 1 (dma1 - address 0x400a 2014 (i2s0) and 0x400a 3014 (i2s1)) bit description bit symbol description reset value 0 rx_dma1_enable when 1, enables dma1 for i2s receive. 0 1 tx_dma1_enable when 1, enables dma1 for i2s transmit. 0 7:2 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 11:8 rx_depth_dma1 set the fifo level that triggers a receive dma request on dma1. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 794 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 35.6.7 i2s dma configuration register 2 the dma2 register controls the operation of dm a request 2. the function of bits in dma2 are shown in ta b l e 7 3 0 . this register enables the dma for the i 2 s receive and transmit channels and sets the fifo level. remark: the fifos contain eight 16-bit words. therefore, if the i 2 s controller is configured for 32-bit mode (see table 730 and table 731 ), the maximum allowed fifo level is 4. 35.6.8 i2s interrupt request control register the irq register controls the operation of the i2 s interrupt request. the function of bits in irq are shown in table 730 . 15:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 19:16 tx_depth_dma1 set the fifo level that triggers a transmit dma request on dma1. 0 31:20 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 735. i2s dma configuration register 1 (dma1 - address 0x400a 2014 (i2s0) and 0x400a 3014 (i2s1)) bit description bit symbol description reset value table 736. i2s dma configuration register 2 (dma2 - address 0x400a 2018 (i2s0) and 0x400a 3018 (i2s1)) bit description bit symbol description reset value 0 rx_dma2_enable when 1, enables dma1 for i2s receive. 0 1 tx_dma2_enable when 1, enables dma1 for i2s transmit. 0 7:2 - reserved. 0 11:8 rx_depth_dma2 set the fifo level that triggers a receive dma request on dma2. 0 15:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 19:16 tx_depth_dma2 set the fifo level that triggers a transmit dma request on dma2. 0 31:20 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 737. i2s interrupt request control register (irq - address 0x400a 201c (i2s0) and 0x400a 301c (i2s1)) bit description bit symbol description reset value 0 rx_irq_enable when 1, enables i2s receive interrupt. 0 1 tx_irq_enable when 1, enables i2s transmit interrupt. 0 7:2 - reserved. 0 11:8 rx_depth_irq set the fifo level on which to create an irq request. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 795 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 35.6.9 i2s transmit clock rate register the mclk rate for the i2s transmitter is determ ined by the values in the txrate register. the required txrate setting depends on th e desired audio sample rate desired, the format (stereo/mono) used, and the data size. the transmitter mclk rate is generated using a fractional rate generator, dividing down the frequency of pclk_i2s ( = clk_apb1_i2s). values of the numerator (x) and the denominator (y) must be chosen to produce a frequency twice that desired for the transmitter mclk, which must be an integer multiple of the trans mitter bit clock rate. fractional rate generators have some aspects that the user should be aware of when choosing settings. these are discussed in section 35.6.9.1 . the equation for the fractional rate generator is: i2stxmclk = pclk_i2s * (x/y) /2 note: if the value of x or y is 0, then no clock is generated. also, the value of y must be greater than or equal to x. 35.6.9.1 notes on fractional rate generators the nature of a fraction al rate generator is th at there will be some ou tput jitter with some divide settings. this is because the fractional rate generator is a fully digital function, so output clock transitions are synchronous with the source clock, whereas a theoretical perfect fractional rate may have edges that ar e not related to the source clock. so, output jitter will not be greater than plus or minu s one source clock betwe en consecutive clock edges. for example, if x = 0x07 and y = 0x11, the fractional rate gene rator will output 7 clocks for every 17 (11 hex) input clocks, distributed as even ly as it can. in this example, there is no way to distribute the output clocks in a perfectly even fa shion, so some clocks will be 15:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 19:16 tx_depth_irq set the fifo level on which to create an irq request. 0 31:20 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 737. i2s interrupt request control register (irq - address 0x400a 201c (i2s0) and 0x400a 301c (i2s1)) bit description bit symbol description reset value table 738. i2s transmit clock rate register (txrate - address 0x400a 2020 (i2s0) and 0x400a 3020 (i2s1)) bit description bit symbol description reset value 7:0 y_divider i2s transmit mclk rate denominator. this value is used to divide pclk to produce the transmit mclk. eight bits of fractional divide supports a wide range of possibilities. a value of 0 stops the clock. 0 15:8 x_divider i2s transmit mclk rate numerator. this value is used to multiply pclk by to produce the transmit mclk. a value of 0 stops the clock. eight bits of fractional divide supports a wide range of possibilities. note: the resulting ratio x/y is divided by 2. 0 31:16 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 796 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface longer than others. the output is divided by 2 in order to square it up, which also helps with the jitter. the frequency av erages out to exactly (7/17) / 2, but some clocks will be a slightly different length than their neighbors. it is possible to avoid jitter entirely by choosing fractions such that x divides evenly into y, such as 2/4, 2/6, 3/9, 1/n, etc. 35.6.10 i2s receive cl ock rate register the mclk rate for the i2s receiver is determ ined by the values in the rxrate register. the required rxrate setting depends on the peripheral clock rate (pclk_i2s = clk_apb1_i2s ) and the desired mclk rate (such as 256 fs). the receiver mclk rate is generated using a fractional rate generator, dividing down the frequency of pclk_i2s. values of the nume rator (x) and the denominator (y) must be chosen to produce a frequency twice that des ired for the receiver mclk, which must be an integer multiple of the receiver bit cloc k rate. fractional rate generators have some aspects that the user should be aware of when choosing settings. these are discussed in section 35.6.9.1 . the equation for the fractional rate generator is: i2srxmclk = pclk_i2s * (x/y) /2 note: if the value of x or y is 0, then no clock is generated. also, the value of y must be greater than or equal to x. 35.6.11 i2s transmit clock bit rate register the bit rate for the i2s transmitter is determi ned by the value of the txbitrate register. the value depends on the audio sample rate desired, and the data size and format (stereo/mono) used. for example, a 48 khz sample rate for 16-bit stereo data requires a bit rate of 48,000162 = 1.536 mhz. table 739. i2s receive clock rate register (rxrate - address 0x400a 2024 (i2s0) and 0x400a 3024 (i2s1)) bit description bit symbol description reset value 7:0 y_divider i2s receive mclk rate denominator. this value is used to divide pclk to produce the receive mclk. eight bits of fractional divide supports a wide range of possibilities. a value of 0 stops the clock. 0 15:8 x_divider i2s receive mclk rate numerator. this value is used to multiply pclk by to produce the receive mclk. a value of 0 stops the clock. eight bits of fractional divide supports a wide range of possibilities. note: the resulting ratio x/y is divided by 2. 0 31:16 - reserved, user software should not write on es to reserved bits. the value read from a reserved bit is not defined. - table 740. i2s transmit clock rate register (txbitrate - address 0x400a 2028 (i2s0) and 0x400a 3028 (i2s1)) bit description bit symbol description reset value 5:0 tx_bitrate i2s transmit bit rate. this value plus one is used to divide tx_mclk to produce the transmit bit clock. 0 31:6 - reserved, user software should not write o nes to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 797 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 35.6.12 i2s receive clo ck bit rate register the bit rate for the i2s receiver is determi ned by the value of the rxbitrate register. the value depends on the audio sample rate, as well as the data size and format used. the calculation is the same as for rxbitrate. 35.6.13 i2s transmit mode control register the transmit mode control register contains additional controls for transmit clock source, enabling the 4-pin mode, and how mclk is used. see section 35.7.2 for a summary of useful mode combinations. 35.6.14 i2s receive mode control register the receive mode control register contains additional controls for receive clock source, enabling the 4-pin mode, and how mclk is used. see section 35.7.2 for a summary of useful mode combinations. table 741. i2s receive clock rate register (rxbitrate - address 0x400a 202c (i2s0) and 0x400a 302c (i2s1)) bit description bit symbol description reset value 5:0 rx_bitr ate i2s receive bit rate. this value plus one is used to divide rx_mclk to produce the receive bit clock. 0 31:6 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 742. i2s transmit mode control register (txmode - address 0x400a 2030 (i2s0) and 0x400a 3030 (i2s1)) bit description bit symbol value description reset value 1:0 txclksel clock source selection for the transmit bit clock divider. 0 0x0 select the tx fractional rate divider clock output as the source 0x1 reserved 0x2 select the rx_mclk signal as the tx_mclk clock source 0x3 reserved 2 tx4pin transmit 4-pin mode selection. when 1, enables 4-pin mode. 0 3 txmcena enable for the tx_mclk output. when 0, output of tx_mclk is not enabled. when 1, output of tx_mclk is enabled. 0 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 743. i2s receive mode control register (rxmode - address 0x400a 2034 (i2s0) and 0x400a 3034 (i2s1)) bit description bit symbol value description reset value 1:0 rxclksel clock source selection fo r the receive bit clock divider. 0 0x0 select the rx fractional rate divider clock output as the source 0x1 reserved 0x2 select the tx_mclk signal as the rx_mclk clock source 0x3 reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 798 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 35.7 functional description 35.7.1 i 2 s transmit and receive interfaces the i2s interface can transmit and receive 8-bi t, 16-bit or 32-bit stereo or mono audio information. some details of i2s implementation are: ? when the fifo is empty, th e transmit channel will repeat transmitting the same data until new data is written to the fifo. ? when mute is true, the da ta value 0 is transmitted. ? when mono is false, two successive data words are respectively left and right data. ? data word length is determined by the wo rdwidth value in the configuration register. there is a separate wordwidth value for the receive channel and the transmit channel. ? 0: word is considered to contain four 8-bit data words. ? 1: word is considered to contain two 16-bit data words. ? 3: word is considered to contain one 32-bit data word. ? when the transmit fifo cont ains insufficient data the transmit channe l will repeat transmitting the last data until new data is available. this can occur when the microprocessor or the dma at some time is unable to provide new data fast enough. because of this delay in new data ther e is a need to f ill the gap, which is accomplished by continuing to transmit the last sample. the data is not muted as this would produce an noticeable and undesirable effect in the sound. ? the transmit channel and the receive channel only handle 32-bit aligned words, data chunks must be clipped or extended to a multiple of 32 bits. when switching between data width or modes the i2s must be reset via the reset bit in the control register in order to ensure correct synchr onization. it is advisable to set the stop bit also until sufficient data has been written in the transmit fifo. note that when stopped data output is muted. all data accesses to fifos are 32 bits. figure 122 shows the possible data sequences. a data sample in the fifo consists of: ? 132 bits in 8-bit or 16-bit stereo modes. ? 132 bits in mono modes. ? 232 bits, first left data, second right data, in 32-bit stereo modes. 2 rx4pin receive 4-pin mode selection. when 1, enables 4-pin mode. 0 3 rxmcena enable for the rx_mclk output. when 0, output of rx_mclk is not enabled. when 1, output of rx_mclk is enabled. 0 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 743. i2s receive mode control register (rxmode - address 0x400a 2034 (i2s0) and 0x400a 3034 (i2s1)) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 799 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface data is read from the transmit fifo after the fallin g edge of ws, it w ill be transferred to the transmit clock domain after the rising ed ge of ws. on the next falling edge of ws the left data will be loaded in the shift register and tr ansmitted and on the fo llowing rising edge of ws the right data is loaded and transmitted. the receive ch annel will start receiving data after a change of ws. when word select becomes low it expects this data to be left data, when ws is high received data is expected to be right data. reception will stop when the bit counter has reached the limit set by wordwidth. on the ne xt change of ws the received data will be stored in the appropriate hold register. when complete data is available it w ill be written into the receive fifo. 35.7.2 i 2 s operating modes the clocking and ws usage of the i2s interface is configurable. in addition to master and slave modes, which are independently configurable for the transmitter and the receiver, several different clock sources are possible, including variations that share the clock and/or ws between the transmit ter and receiver. this last op tion allows using i2s with fewer pins, typically four. many configurations are possible that are not considered useful, the following tables and figures give details of the configuratio ns that are most likely to be useful. table 744. i2s transmit modes dao bit 5 txmode bits [3:0] description 0 0 0 0 0 typical transmitter master mode. see figure 110 . the i2s transmit function operates as a master. the transmit clock source is the fractional rate divider. the ws used is the internally generated tx_ws. the tx_mclk pin is not enabled for output. 0 0 0 1 0 transmitter master mode sharing the receiver reference clock. see figure 111 . the i2s transmit function operates as a master. the transmit clock source is rx_ref. the ws used is the internally generated tx_ws. the tx_mclk pin is not enabled for output. 0 0 1 0 0 4-wire transmitter master mode sharing the receiver bit clock and ws. see figure 112 . the i2s transmit function operates as a master. the transmit clock source is the rx bit clock. the ws used is the internally generated rx_ws. the tx_mclk pin is not enabled for output. 0 1 0 0 0 transmitter master mode with tx_mclk output. see figure 110 . the i2s transmit function operates as a master. the transmit clock source is the fractional rate divider. the ws used is the internally generated tx_ws. the tx_mclk pin is enabled for output. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 800 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 1 0 0 0 0 typical transmitter slave mode. see figure 113 . the i2s transmit function operates as a slave. the transmit clock source is the tx_sck pin. the ws used is the tx_ws pin. 1 0 0 1 0 transmitter slave mode sharing the receiver reference clock. see figure 114 . the i2s transmit function operates as a slave. the transmit clock source is rx_ref. the ws used is the tx_ws pin. 1 0 1 0 0 4-wire transmitter slave mode sharing the receiver bit clock and ws. see figure 115 . the i2s transmit function operates as a slave. the transmit clock source is the rx bit clock. the ws used is rx_ws ref. table 744. i2s transmit modes dao bit 5 txmode bits [3:0] description fig 110. typical transmitter master mode, with or wi thout mclk output i2stxmode[3] cclk n (1 to 64) 8-bit fractional rate divider 2 xy i 2 s peripheral block (transmit ) i2stxbitrate[5:0] tx_ref tx bit clock i2stx_rate[7:0] i2stx_rate[15:8] (pin oe) tx_ws ref i2s_tx_ws i2s_tx_sd a i2s_tx_sck fig 111. transmitter master mode sharing the receiver reference clock n (1 to 64) i2stxbitrate[5:0] rx_ref tx bit clock tx_ws ref i 2 s peripheral block (transmit ) i2s_tx_ws i2s_tx_sd a i2s_tx_sck www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 801 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface fig 112. 4-wire transmitter master mode sharing the receiver bit clock and ws rx bit clock rx_ws ref i 2 s peripheral block (transmit ) i2s_tx_sda i2s_tx_sck fig 113. typical transmitter slave mode n (1 to 64) i 2 s peripheral block (transmit ) i2stxbitrate[5:0] tx_ref tx bit clock i2s_tx_ws i2s_tx_sd a i2s_tx_sck fig 114. transmitter slave mode sharing the receiver reference clock n (1 to 64) i 2 s peripheral block (transmit ) i2stxbitrate[5:0] rx _ref tx bit clock i2s_tx_ws i2s_tx_sd a fig 115. 4-wire transmitter slave mode sharing the receiver bit clock and ws rx bit clock rx_ws ref i 2 s peripheral block (transmit ) i2s_tx_sda www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 802 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface table 745. i2s receive modes dai bit 5 rxmode bit [3:0] description 0 0 0 0 0 typical receiver master mode. see figure 116 . the i2s receive function operates as a master. the receive clock source is the fractional rate divider. the ws used is the internally generated rx_ws. the rx_mclk pin is not enabled for output. 0 0 0 1 0 receiver master mode sharing the transmitter reference clock. see figure 117 . the i2s receive function operates as a master. the receive clock source is tx_ref. the ws used is the internally generated rx_ws. the rx_mclk pin is not enabled for output. 0 0 1 0 0 4-wire receiver master mode sharing the transmitter bit clock and ws. see figure 118 . the i2s receive function operates as a master. the receive clock source is the tx bit clock. the ws used is the internally generated tx_ws. the rx_mclk pin is not enabled for output. 0 1 0 0 0 receiver master mode with rx_mclk output. see figure 116 . the i2s receive function operates as a master. the receive clock source is the fractional rate divider. the ws used is the internally generated rx_ws. the rx_mclk pin is enabled for output. 1 0 0 0 0 typical receiver slave mode. see figure 119 . the i2s receive function operates as a slave. the receive clock source is the rx_sck pin. the ws used is the rx_ws pin. 1 0 0 1 0 receiver slave mode sharing the transmitter reference clock. see figure 120 . the i2s receive function operates as a slave. the receive clock source is tx_ref. the ws used is the rx_ws pin. 1 0 1 0 0 this is a 4-wire receiver slave m ode sharing the transmitter bit clock and ws. see figure 121 . the i2s receive function operates as a slave. the receive clock source is the tx bit clock. the ws used is tx_ws ref. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 803 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface fig 116. typical receiver master mode, with or without mclk output i2srxmode[3] cclk n (1 to 64) 8-bit fractional rate divider 2 xy i 2 s peripheral block (receive ) i2srxbitrate[5:0] rx_ref rx bit clock i2srx_rate[7:0] i2srx_rate[15:8] (pin oe) rx _ws ref i2s_rx_mclk i2s_rx_ws i2s_rx_sda i2s_rx_sck fig 117. receiver master mode sharing the transmitter reference clock n (1 to 64) i2srxbitrate[5:0] tx_ref rx bit clock rx_ws ref i 2 s peripheral block (receive) i2s_rx_ws i2s_rx_sd a i2s_rx_sck fig 118. 4-wire receiver master mode sharing the transmitter bit clock and ws tx bit clock tx_ws ref i 2 s peripheral block (receive) i2s_rx_sda i2s_rx_sck fig 119. typical receiver slave mode n (1 to 64) i 2 s peripheral block (receive) i2srxbitrate[5:0] rx_ref rx bit clock i2s_rx_ws i2s_rx_sd a i2s_rx_sck www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 804 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface 35.7.3 fifo controller handling of data for transmission and reception is performed via the fifo controller which can generate two dma requests and an interrupt request. the controller consists of a set of comparators which compare fifo levels with depth settings contained in registers. the current status of the level comparators can be seen in the apb status register. system signaling occurs when a level detection is true and enabled. fig 120. receiver slave mode sharing the transmitter reference clock n (1 to 64) i 2 s peripheral block (receive) i2srxbitrate[5:0] tx_ref rx bit clock i2s_rx_ws i2s_rx_sd a fig 121. 4-wire receiver slave mode sharing the transmitter bit clock and ws tx bit clock tx_ws ref i 2 s peripheral block (receive) i2s_rx_sd a table 746. conditions for fifo level comparison level comparison condition dmareq_tx_1 tx_depth_dma1 >= tx_level dmareq_rx_1 rx_depth_dma1 <= rx_level dmareq_tx_2 tx_depth_dma2 >= tx_level dmareq_rx_2 rx_depth_dma2 <= rx_level irq_tx tx_depth_irq >= tx_level irq_rx rx_depth_irq <= rx_level table 747. dma and interrupt request generation system signaling condition irq (irq_rx & rx_irq_enable) | (irq_tx & tx_irq_enable) dmareq[0] (dmareq_tx_1 & tx_dma1_enable ) | (dmareq_rx_1 & rx_dma1_enable ) dmareq[1] ( dmareq_tx_2 & tx_dma2_enable ) | (dmareq_rx_2 & rx_dma2_enable ) table 748. status feedback in the state register status feedback status irq irq_rx | irq_tx dmareq1 (dmareq_tx_1 | dmareq_rx_1) dmareq2 (dmareq_rx_2 | dmareq_tx_2) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 805 of 1164 nxp semiconductors UM10430 chapter 35: lpc18xx i2s interface fig 122. fifo contents for various i 2 s modes left + 1 7 0 right + 1 7 0 left 7 0 right 7 0 stereo 8-bit data mode n + 3 7 0 n + 2 7 0 n + 1 7 0 n 7 0 mono 8-bit data mode n + 1 15 0 n 15 0 mono 16-bit data mode left 15 0 right 15 0 stereo 16-bit data mode n 31 0 mono 32-bit data mode left 31 0 stereo 32-bit data mode n right 31 0 n + 1 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 806 of 1164 36.1 how to read this chapter the c_can0/1 controllers are available on all lpc18xx parts. 36.2 basic configuration the c_can is configured as follows: ? see ta b l e 7 4 9 for clocking and power control. ? the c_can0 is reset by t he can0_rst (reset # 55). ? the c_can1 is reset by t he can1_rst (reset # 56). ? the ored c_can0 and c_can1 interrupt is connected to slot # 12 in the event router. ? the c_can0 interrupt is connected to interrupt #51 in the nvic. ? the c_can1 interrupt is connected to interrupt #43 in the nvic. 36.3 features ? conforms to protocol version 2.0 parts a and b. ? supports bit rate of up to 1 mbit/s. ? supports 32 message objects. ? each message object has its own identifier mask. ? provides programmable fifo mode (concatenation of message objects). ? provides maskable interrupts. ? supports disabled automatic retransmission (dar) mode for time-triggered can applications. ? provides programmable loop-back mode for self-test operation. UM10430 chapter 36: lpc18xx c_can rev. 00.13 ? 20 july 2011 user manual table 749. c_can clocking and power control base clock branch clock maximum frequency clock to the c_can0 register interface and c_can0 peripheral clock. base_apb3_clk clk_apb3_can0 150 mhz clock to the c_can1 register interface and c_can1 peripheral clock. base_apb1_clk clk_apb1_can1 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 807 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.4 general description controller area network (can) is the definition of a high performance communication protocol for serial data communication. the c_ can controller is designed to provide a full implementation of the can protocol accordin g to the can specification version 2.0b. the c_can controller allows to build powerful local networks with low-cost multip lex wiring by supporting distributed real-time control with a very high level of security. the can controller consists of a can core, message ram, a message handler, control registers, and the apb interface. for communication on a can network, individual message objects are configured. the message objects and identifier masks for acceptance filtering of received messages are stored in the message ram. all functions concerning the handling of messages are implemented in the message handler. those functions are the acceptance f iltering, the transfer of messages between the can core and the message ram, and the handling of transmission requests as well as the generation of the module interrupt. the register set of the can controller can be accessed directly by an external cpu via the apb bus. these registers are us ed to control/configure th e can core and the message handler and to access the message ram. fig 123. c_can block diagram can core message ram register interface message handler apb bus apb interface can1_td can1_rd c_can www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 808 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.5 pin description table 750. c_can pin description function pinned out direction description can0/1_rd i c_can receive input can0/1_td o c_can transmit output www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 809 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6 register description register values at reset after a hardware reset, the registers hold the values described in table 751 . additionally, the busoff state is reset and the output td0,1 is set to recessive (high). the value 0x0001 (init = ?1?) in the can control regist er enables the software initialization. the can controller does not communicate with th e can bus until the cpu resets init to ?0?. the data stored in the message ram is not affected by a hardware reset. after power-on, the contents of the message ram is undefined. timing of read/write operations remark: reading any of the can registers requires two consecutive read operations from the same location. only the data from the second read operation are valid. successive read operations to the c_can registers must be separated by a minimum of (clkdivval ? 2+2) ? pclk, where clkdivval is the can clock divider value and pclk is the peripheral clock. successive write operations to the c_can registers must be separated by a minimum of (clkdivval ? 2) ? pclk, where clkdivval is the can clock divider value and pclk is the peripheral clock. table 751. register overview: c_can0 (base address 0x400e 2000) name access address offset description reset value cntl 0x000 can control 0x0001 stat 0x004 status register 0x0000 ec ro 0x008 error counter 0x0000 bt 0x00c bit timing register 0x2301 int ro 0x010 interrupt register 0x0000 test 0x014 test register - brpe 0x018 baud rate prescaler extension register 0x0000 - - 0x01c reserved - if1_cmdreq 0x020 message interface 1 command request 0x0001 if1_cmdmsk_w 0x024 message interface 1 command mask (write direction) 0x0000 if1_cmdmsk_r 0x024 message interface 1 command mask (read direction) 0x0000 if1_msk1 0x028 message interface 1 mask 1 0xffff if1_msk2 0x02c message interface 1 mask 2 0xffff if1_arb1 0x030 message interface 1 arbitration 1 0x0000 if1_arb2 0x034 message interface 1 arbitration 2 0x0000 if1_mctrl 0x038 message interface 1 message control 0x0000 if1_da1 0x03c message interface 1 data a1 0x0000 if1_da2 0x040 message interface 1 data a2 0x0000 if1_db1 0x044 message interface 1 data b1 0x0000 if1_db2 0x048 message interface 1 data b2 0x0000 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 810 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can -0x04c - 0x07c reserved - if2_cmdreq 0x080 message interface 2 command request 0x0001 if2_cmdmsk 0x084 message interface 2 command mask 0x0000 if2_msk1 0x088 message interface 2 mask 1 0xffff if2_msk2 0x08c message interface 2 mask 2 0xffff if2_arb1 0x090 message interface 2 arbitration 1 0x0000 if2_arb2 0x094 message interface 2 arbitration 2 0x0000 if2_mctrl 0x098 message interface 2 message control 0x0000 if2_da1 0x09c message interface 2 data a1 0x0000 if2_da2 0x0a0 message interface 2 data a2 0x0000 if2_db1 0x0a4 message interface 2 data b1 0x0000 if2_db2 0x0a8 message interface 2 data b2 0x0000 - - 0x0ac - 0x0fc txreq1 ro 0x100 transmission request 1 0x0000 txreq2 ro 0x104 transmission request 2 0x0000 - - 0x108 - 0x11c reserved - nd1 ro 0x120 new data 1 0x0000 nd2 ro 0x124 new data 2 0x0000 - - 0x128 - 0x13c reserved - ir1 ro 0x140 interrupt pending 1 0x0000 ir2 ro 0x144 interrupt pending 2 0x0000 - - 0x148 - 0x15c reserved - msgv1 ro 0x160 message valid 1 0x0000 msgv2 ro 0x164 message valid 2 0x0000 - - 0x168 - 0x17c reserved - clkdiv r/w 0x180 can clock divider register 0x0001 table 752. register overview: c_can1 (base address 0x400a 4000) name access address offset description reset value cntl 0x000 can control 0x0001 stat 0x004 status register 0x0000 ec ro 0x008 error counter 0x0000 bt 0x00c bit timing register 0x2301 int ro 0x010 interrupt register 0x0000 test 0x014 test register - table 751. register overview: c_can0 (base address 0x400e 2000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 811 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can brpe 0x018 baud rate prescaler extension register 0x0000 - - 0x01c reserved - if1_cmdreq 0x020 message interface 1 command request 0x0001 if1_cmdmsk_w 0x024 message interface 1 command mask (write direction) 0x0000 if1_cmdmsk_r 0x024 message interface 1 command mask (read direction) 0x0000 if1_msk1 0x028 message interface 1 mask 1 0xffff if1_msk2 0x02c message interface 1 mask 2 0xffff if1_arb1 0x030 message interface 1 arbitration 1 0x0000 if1_arb2 0x034 message interface 1 arbitration 2 0x0000 if1_mctrl 0x038 message interface 1 message control 0x0000 if1_da1 0x03c message interface 1 data a1 0x0000 if1_da2 0x040 message interface 1 data a2 0x0000 if1_db1 0x044 message interface 1 data b1 0x0000 if1_db2 0x048 message interface 1 data b2 0x0000 -0x04c - 0x07c reserved - if2_cmdreq 0x080 message interface 2 command request 0x0001 if2_cmdmsk 0x084 message interface 2 command mask 0x0000 if2_msk1 0x088 message interface 2 mask 1 0xffff if2_msk2 0x08c message interface 2 mask 2 0xffff if2_arb1 0x090 message interface 2 arbitration 1 0x0000 if2_arb2 0x094 message interface 2 arbitration 2 0x0000 if2_mctrl 0x098 message interface 2 message control 0x0000 if2_da1 0x09c message interface 2 data a1 0x0000 if2_da2 0x0a0 message interface 2 data a2 0x0000 if2_db1 0x0a4 message interface 2 data b1 0x0000 if2_db2 0x0a8 message interface 2 data b2 0x0000 - - 0x0ac - 0x0fc txreq1 ro 0x100 transmission request 1 0x0000 txreq2 ro 0x104 transmission request 2 0x0000 - - 0x108 - 0x11c reserved - nd1 ro 0x120 new data 1 0x0000 nd2 ro 0x124 new data 2 0x0000 - - 0x128 - 0x13c reserved - ir1 ro 0x140 interrupt pending 1 0x0000 ir2 ro 0x144 interrupt pending 2 0x0000 table 752. register overview: c_can1 (base address 0x400a 4000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 812 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.1 can protocol registers 36.6.1.1 can control register after a hardware reset, the registers of the c_can controller hold the values described in table 751 . additionally, the busoff state is set, and the td0/1 outputs are set to high. the reset value 0x0001 of the canctrl register enables initialization by software (init = 1). the c_can does not influence the can bus until the cpu resets the init bit to 0. - - 0x148 - 0x15c reserved - msgv1 ro 0x160 message valid 1 0x0000 msgv2 ro 0x164 message valid 2 0x0000 - - 0x168 - 0x17c reserved - clkdiv r/w 0x180 can clock divider register 0x0001 table 752. register overview: c_can1 (base address 0x400a 4000) name access address offset description reset value table 753. can control registers (cntl, address 0x400e 2000 (c_can0) and 0x400a 4000 (c_can1)) bit description bit symbol value description reset value access 0 init initialization 1 r/w 0 normal operation. 1 initialization is started. on reset, software needs to initialize the can controller. 1 ie module interrupt enable 0 r/w 0 disable can interrupts. the interrupt line is always high. 1 enable can interrupts. the interrupt line is set to low and remains low until all pending interrupts are cleared. 2 sie status change interrupt enable 0 r/w 0 disable status change interrupts. no status change interrupt will be generated. 1 enable status change interrupts. a status change interrupt will be generated when a message transfer is su ccessfully completed or a can bus error is detected. 3 eie error interrupt enable 0 r/w 0 disable error inte rrupt. no error status interrupt will be generated. 1 enable error interrupt. a change in the bits boff or ewarn in the canstat registers will generate an interrupt. 4- - reserved 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 813 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can remark: the busoff recovery sequence (see can specification rev. 2.0 ) cannot be shortened by setting or re setting the init bit. if the device g oes into busoff state, it will set init, stopping all bus activities. once init has been cleare d by the cpu, the device will then wait for 129 occurr ences of bus idle (129 ? 11 consecutive high/recessive bits) before resuming normal operations. at the end of the busoff recovery sequence, the error management co unters will be reset. during the waiting time after the resettin g of init, each time a sequence of 11 high/recessive bits has been monitored, a bit0 error code is written to the status register canstat, enabling the cpu to monitor the proceeding of the busoff recovery sequence and to determine whether the can bus is stuck at low/dominant or continuously disturbed. 5 dar disable automatic retransmission 0 r/w 0 automatic retransmission of disturbed messages enabled. 1 automatic retransmission disabled. 6 cce configuration change enable 0 r/w 0 the cpu has no write access to the bit timing register. 1 the cpu has write access to the canbt register while the init bit is one. 7 test test mode enable 0 r/w 0 normal operation. 1 test mode. 31:8 - reserved - - table 753. can control registers (cntl, address 0x400e 2000 (c_can0) and 0x400a 4000 (c_can1)) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 814 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.1.2 can status register table 754. can status register (stat, address 0x400e 2004 (c_can0) and 0x400a 4004 (c_can1)) bit description bit symbol value description reset value access 2:0 lec last error code type of the last error to occur on the can bus.the lec field holds a code which indicates the type of the last error to occur on the can bus. this field will be cleared to ?0? when a message has been transferred (reception or transmission) without error. the unused code ?111? may be written by the cpu to check for updates. 000 r/w 0x0 no error . 0x1 stuff error : more than 5 equal bits in a sequence have occurred in a part of a received message where this is not allowed. 0x2 form error : a fixed format part of a received frame has the wrong format. 0x3 ackerror : the message this can core transmitted was not acknowledged. 0x4 bit1error : during the transmission of a message (with the exception of the arbitration field), the device wanted to send a high/recessive level (bit of logical value ?1?), but the monitored bus value was low/dominant. 0x5 bit0error : during the transmission of a message (or acknowledge bit, or active error flag, or overload flag), the device wanted to send a low/dominant level (data or identifier bit logical value ?0?), but the monitored bus value was high/recessive. during busoff recovery this status is set each time a sequence of 11 high/recessive bits has been monitored. this enables the cpu to monitor the proceeding of the busoff recovery sequence (indicating the bus is not stuck at low/dominant or continuously disturbed). 0x6 crcerror : the crc checksum was incorrect in the message received. 0x7 unused: no can bus event was detected (written by the cpu). 3 txok transmitted a message successfully this bit is reset by the cpu. it is never reset by the can controller. 0r/w 0 since this bit was reset by the cpu, no message has been successfully transmitted. 1 since this bit was last reset by the cpu, a message has been successfully transmitted (error free and acknowledged by at least one other node). 4 rxok received a message successfully this bit is reset by the cpu. it is never reset by the can controller. 0r/w 0 since this bit was last reset by the cpu, no message has been successfully transmitted. 1 since this bit was last set to zero by the cpu, a message has been successfully received independent of the result of acceptance filtering. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 815 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can a status interrupt is generated by bits boff, ewarn, rxok, txok, or lec. boff and ewarn generate an error interrupt, and rxok, txok, and lec generate a status change interrupt if eie and sie respectively are set to enabled in the canctrl register. a change of bit epass and a wr ite to rxok, txok, or lec will never create a status interrupt. reading the canstat register will clear the st atus interrupt value in the canir register. 36.6.1.3 can error counter 5 epass error passive 0 ro 0 the can controller is in the error active state. 1 the can controller is in the error passive state as defined in the can 2.0 specification . 6 ewarn warning status 0 ro 0 both error counters are below the error warning limit of 96. 1 at least one of the error counters in the eml has reached the error warning limit of 96. 7 boff busoff status 0 ro 0 the can module is not in busoff state. 1 the can controller is in busoff state. 31:8 - - reserved table 754. can status register (stat, address 0x400e 2004 (c_can0) and 0x400a 4004 (c_can1)) bit description ?continued bit symbol value description reset value access table 755. can error counter (ec, address 0x400e 2008 (c_can0) and 0x400a 4008 (c_can1)) bit description bit symbol value description reset value access 7:0 tec_7_0 transmit error counter current value of the transmit error counter (maximum value 127) 0ro 14:8 rec_6_0 receive error counter current value of the receive error counter (maximum value 255). 0ro 15 rp receive error passive 0 ro 0 the receive counter is below the error passive level. 1 the receive counter has reached the error passive level as defined in the can2.0 specification . 31:16 - - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 816 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.1.4 can bit timing register [1] hardware interprets the value progra mmed into these bits as the bit value ? 1. remark: with a module clock can_clk of 8 mhz, the reset value of 0x2301 configures the c_can for a bit rate of 500 kbit/s. the registers are only writable if a configuration change is enabled in canctrl and the controlle r is initialized by software (bits cce and init in the can control register are set). 36.6.1.5 can interrupt register if several interrupts are pending, the can inte rrupt register will po int to the pending interrupt with the highest prio rity, disregarding their chronological order. an interrupt remains pending until the cpu has cleared it. if intid is different from 0x0000 and ie is set, the interrupt line to the cpu is active. th e interrupt line remains active until intid is back to value 0x0000 (the cause of the interrupt is reset) or until ie is reset. the status interrupt has the highest priority . among the message interrupts, the message object? s interrupt prio rity decreases with increasing message number. a message interrupt is cleared by clearing the message object?s intpnd bit. the statusinterrupt is cleared by reading the status register. table 756. can bit timing register (bt, address 0x400e 200c (c_can0) and 0x400a 400c (c_can1)) bit description bit symbol description reset value access 5:0 brp baud rate prescaler the value by which the oscillator frequency is divided for generating the bit time quanta. the bit time is built up from a multiple of this quanta. valid values for the baud rate prescaler are 0 to 63 [1] . valid programmed values are 0x01 - 0x3f [1] . 1r/w 7:6 sjw (re)synchronization jump width valid programmed values are 0 to 3 [1] . 0r/w 11:8 tseg1 time segment after the sample point valid values are 0 to 7 [1] . 0011 r/w 14:12 tseg2 time segment before the sample point valid values are 1 to 15 [1] . 010 r/w 31:15 - reserved - - table 757. can interrupt register (int, address 0x400e 2010 (c_can0) and 0x400a 4010 (c_can1)) bit description bit symbol description reset value access 15:0 intid15_0 0x0000 = no interrupt is pending 0x0001 to 0x0020 = number of message object which caused the interrupt. 0x0021 to 0x7fff = unused 0x8000 = status interrupt 0x8001 to 0xffff = unused 0r 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 817 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.1.6 can test register write access to the test register is enabled by setting bit test in the can control register. the different test functions may be combined, but when tx[1:0] ? ?00? is selected, the message transfer is disturbed. 36.6.1.7 can baud rate prescaler extension register table 758. can test register (test, address 0x400e 2014 (c_can0) and 0x400a 4014 (c_can1)) bit description bit symbol value description reset value access 1:0 - - - 2 basic basic mode 0 r/w 0 basic mode disabled. 1 if1 registers used as tx buffer, if2 registers used as rx buffer. 3 silent silent mode 0 r/w 0 normal operation. 1 the module is in silent mode. 4 lback loop back mode 0 r/w 0 loop back mode is disabled. 1 loop back mode is enabled. 6:5 tx1_0 control of td pins 00 r/w 0x0 level at the td pin is controlled by the can controller. this is the value at reset. 0x1 the sample point can be monitored at the td pin. 0x2 td pin is driven low/dominant. 0x3 td pin is driven high/recessive. 7 rx monitors the actual value of the rd pin 0 r 0 the can bus is dominant (rd = 0). 1 the can bus is recessive (rd = 1). 31:8 - reserved - table 759. can baud rate prescaler extension register (brpe, address 0x400e 2018 (c_can0) and 0x400a 4018 (c_can1)) bit description bit symbol description reset value access 3:0 brpe baud rate prescaler extension by programming brpe the baud rate prescaler can be extended to values up to 1023. hardware interprets the value as the value of brpe (msbs) and brp (lsbs) plus one. allowed values are 0x00 to 0x0f 0x0000 r/w 31:4 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 818 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.2 message interface registers there are two sets of interface registers which are used to control the cpu access to the message ram. the interface registers avoi d conflicts between cpu access to the message ram and can message reception and tr ansmission by buffering the data to be transferred. a complete message object (see section 36.6.2.1 ) or parts of the message object may be transferred between the message ram and the ifx message buffer registers in one single transfer. the function of the two interface register sets is identical (except for test mode basic). one set of registers may be used for data transfer to the message ram while the other set of registers may be used for the data tr ansfer from the message ram, allowing both processes to be interrupted by each other. each set of interface registers consists of message buffer registers controlled by their own command registers. the command mask regist er specifies the direction of the data transfer and which parts of a message objec t will be transferred. the command request register is used to select a message object in the message ram as target or source for the transfer and to start the action sp ecified in the command mask register. fig 124. block diagram of a message object transfer if1 mask1, 2 if1 arbitration 1/2 if1 message ctrl if1 data a1/2 if1 data b1/2 if2 mask1, 2 if2 arbitration 1/2 if2 message ctrl if2 data a1/2 if2 data b1/2 message ram message object 1 message object 2 . . . message object 32 transfer a message object read transfer write transfer apb bus message buffer registers if1 command request if1 command mask if2 command request if2 command mask interface command registers message handler transmission request 1/2 new data 1/2 interrupt pending1/2 message valid1/2 can bus receive transfer a can frame transmit can core/ shift registers www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 819 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can there are 32 message objects in the message ram. to avoid conflicts between cpu access to the message ram and can message reception and transmission, the cpu cannot directly access the message objects. the message objects are accessed through the ifx interface registers. 36.6.2.1 message objects a message object contains the information from the various bits in the message interface registers. table 761 below shows a schematic representation of the structure of the message object. the bits of a message object and the respective interface register where this bit is set or cleared are shown. for bit functions see the corresponding interface register. 36.6.2.2 can message interface command request registers a message transfer is started as soon as the cpu has written the message number to the command request register. with this write opera tion the busy bit is automatically set to ?1? and the signal can_wait_b is pulled low) to notify the cpu that a transfer is in progress. after a wait time of 3 to 6 can_clk periods, the transfer between the interface register and the message ram has completed. the busy bit is set back to zero and the signal can_wait_b is set back). table 760. message interface registers if1 register names if1 register set if2 register names if2 register set if1_cmdreq if1 command request if2_cmdreq if2 command request if1_cmdmask if1 command mask if2_cmdmask if2 command mask if1_mask1 if1 mask 1 if2_msk1 if2 mask 1 if1_mask2 if1 mask 2 if2_msk2 if2 mask 2 if1_arb1 if1 arbitration 1 if2_arb1 if2 arbitration 1 if1_arb2 if1 arbitration 2 if2_arb2 if2 arbitration 2 if1_mctrl if1 message control if2_mctrl if2 message control if1_da1 if1 data a1 if2_da1 if2 data a1 if1_da2 if1 data a2 if2_da2 if2 data a2 cif1_db1 if1 data b1 if2_db1 if2 data b1 if1_db2 if1 data b2 if2_db2 if2 data b2 table 761. structure of a message object in the message ram umask msk[28:0] mxtd mdir eob newdat msglst rxie txie intpnd if1/2_mctrl if1/2_msk1/2 if1/2_mctrl rmten txrqst msgval id[28:0] xtd dir dlc3 dlc2 dlc1 dlc0 if1/2_mctrl if1/2_arb1/2 if1/2_mctrl data0 data1 data2 data3 data4 data5 data6 data7 if1/2_da1 if1/2_da2 if1/2_db1 if1/2_db2 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 820 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can [1] when a message number that is not valid is writt en into the command request registers, the message number will be transformed into a valid value and that message object will be transferred. [1] when a message number that is not valid is writt en into the command request registers, the message number will be transformed into a valid value and that message object will be transferred. table 762. can message interface command re quest registers (if1_cmdreq, address 0x400e 2020 (c_can0) and 0x400a 4020 (c_can1)) bit description bit symbol description reset value access 5:0 message number message number 0x01 to 0x20 = valid message numbers the message object in the message ram is selected for data transfer. 0x00 = not a valid message number. this value is interpreted as 0x20. [1] 0x21 to 0x3f = not a valid message number. this value is interpreted as 0x01 - 0x1f. [1] 0x01 r/w 14:6 - reserved 15 busy busy flag 0 r set to one by hardware when writing to this command request register. set to zero by hardwa re when read/write action to this command request register has finished. 31:16 - reserved - - table 763. can message interface command re quest registers (if2_cmdreq, address 0x400e 2080 (c_can0) and 0x400a 4080 (c_can1)) bit description bit symbol description reset value access 5:0 message number message number 0x01 to 0x20 = valid message numbers the message object in the message ram is selected for data transfer. 0x00 = not a valid message number. this value is interpreted as 0x20. [1] 0x21 to 0x3f = not a valid message number. this value is interpreted as 0x01 - 0x1f. [1] 0x01 r/w 14:6 - reserved 15 busy busy flag 0 r set to one by hardware when writing to this command request register. set to zero by hardwa re when read/write action to this command request register has finished. 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 821 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.2.3 can message interface command mask registers the control bits of the ifx command mask re gister specify the transfer direction and select which of the ifx message buffer r egisters are source or target of the data transfer.the functions of the register bits depe nd on the transfer dire ction (read or write) which is selected in the wr/rd bit (bit 7) of this command mask register. select the wr/rd to one for the write transfer direction (write to message ram) zero for the read transfer direct ion (read from message ram) transfer direction write table 764. can message interface command mask registers write direction (if1_cmdmsk, address 0x400e 2024 (c_can0) and 0x400a 4024 (c_can1)) bit description bit symbol value description reset value access 0 data_b access data bytes 4-7 0 r/w 0 data bytes 4-7 unchanged. 1 transfer data bytes 4-7 to message object. 1 data_a access data bytes 0-3 0 r/w 0 data bytes 0-3 unchanged. 1 transfer data bytes 0-3 to message object. 2 txrqst access transmission request bit 0 r/w 0 no transmission request. txrqsrt bit unchanged in if1/2_mctrl. remark: if a transmission is requested by programming this bit, the txrqst bit in the canifn_mctrl register is ignored. 1 request a transmission. set the txrqst bit if1/2_mctrl. 3 clrintpnd - this bit is ignored in the write direction. 0 r/w 4 ctrl access control bits 0 r/w 0 control bits unchanged. 1 transfer control bits to message object 5 arb access arbitration bits 0 r/w 0 arbitration bits unchanged. 1 transfer identifier, dir, xtd, and msgval bits to message object. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 822 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 6 mask access mask bits 0 r/w 0 mask bits unchanged. 1 transfer identifier mask + mdir + mxtd to message object. 7 wr_rd 1 write transfer transfer data from the selected message buffer registers to the message object addressed by the command request register canifn_cmdreq. 0r/w 31:8 - - reserved 0 - table 765. can message interface command mask registers write direction (if2_cmdmsk, address 0x400e 2084 (c_can0) and 0x400a 4080 (c_can1)) bit description bit symbol value description reset value access 0 data_b access data bytes 4-7 0 r/w 0 data bytes 4-7 unchanged. 1 transfer data bytes 4-7 to message object. 1 data_a access data bytes 0-3 0 r/w 0 data bytes 0-3 unchanged. 1 transfer data bytes 0-3 to message object. 2 txrqst access transmission request bit 0 r/w 0 no transmission request. txrqsrt bit unchanged in if1/2_mctrl. remark: if a transmission is requested by programming this bit, the txrqst bit in the canifn_mctrl register is ignored. 1 request a transmission. set the txrqst bit if1/2_mctrl. 3 clrintpnd - this bit is ignored in the write direction. 0 r/w 4 ctrl access control bits 0 r/w 0 control bits unchanged. 1 transfer control bits to message object 5 arb access arbitration bits 0 r/w 0 arbitration bits unchanged. 1 transfer identifier, dir, xtd, and msgval bits to message object. table 764. can message interface command mask registers write direction (if1_cmdmsk, address 0x400e 2024 (c_can0) and 0x400a 4024 (c_can1)) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 823 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can transfer direction read 6 mask access mask bits 0 r/w 0 mask bits unchanged. 1 transfer identifier mask + mdir + mxtd to message object. 7 wr_rd 1 write transfer transfer data from the selected message buffer registers to the message object addressed by the command request register canifn_cmdreq. 0r/w 31:8 - - reserved 0 - table 766. can message interface command mask registers read direction (if1_cmdmsk, address 0x400e 2024 (c_can0) and 0x400a 4024 (c_can1)) bit description bit symbol value description reset value access 0 data_b access data bytes 4-7 0 r/w 0 data bytes 4-7 unchanged. 1 transfer data bytes 4-7 to ifx message buffer register. 1 data_a access data bytes 0-3 0 r/w 0 data bytes 0-3 unchanged. 1 transfer data bytes 0-3 to ifx message buffer. 2 newdat access new data bit 0 r/w 0 newdat bit remains unchanged. remark: a read access to a message object can be combined with the reset of the control bits intpnd and newdat in if1/2_mctrl. the values of these bits transferred to the ifx message control register always reflect the status before resetting these bits. 1 clear newdat bit in the message object. 3 clrintpnd clear interrupt pending bit. 0 r/w 0 intpnd bit remains unchanged. 1 clear intpnd bit in the message object. 4 ctrl access control bits 0 r/w 0 control bits unchanged. 1 transfer control bits to ifx message buffer. 5 arb access arbitration bits 0 r/w 0 arbitration bits unchanged. 1 transfer identifier, dir, xtd, and msgval bits to ifx message buffer register. table 765. can message interface command mask registers write direction (if2_cmdmsk, address 0x400e 2084 (c_can0) and 0x400a 4080 (c_can1)) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 824 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 6 mask access mask bits 0 r/w 0 mask bits unchanged. 1 transfer identifier mask + mdir + mxtd to ifx message buffer register. 7 wr_rd 0 read transfer transfer data from the message object addressed by the command request register to the selected message buffer registers canifn_cmdreq. 0r/w 31:8 - - reserved 0 - table 767. can message interface command mask registers read direction (if2_cmdmsk, address 0x400e 2084 (c_can0) and 0x400a 4024 (c_can1)) bit description bit symbol value description reset value access 0 data_b access data bytes 4-7 0 r/w 0 data bytes 4-7 unchanged. 1 transfer data bytes 4-7 to ifx message buffer register. 1 data_a access data bytes 0-3 0 r/w 0 data bytes 0-3 unchanged. 1 transfer data bytes 0-3 to ifx message buffer. 2 newdat access new data bit 0 r/w 0 newdat bit remains unchanged. remark: a read access to a message object can be combined with the reset of the control bits intpnd and newdat in if1/2_mctrl. the values of these bits transferred to the ifx message control register always reflect the status before resetting these bits. 1 clear newdat bit in the message object. 3 clrintpnd clear interrupt pending bit. 0 r/w 0 intpnd bit remains unchanged. 1 clear intpnd bit in the message object. 4 ctrl access control bits 0 r/w 0 control bits unchanged. 1 transfer control bits to ifx message buffer. 5 arb access arbitration bits 0 r/w 0 arbitration bits unchanged. 1 transfer identifier, dir, xtd, and msgval bits to ifx message buffer register. table 766. can message interface command mask registers read direction (if1_cmdmsk, address 0x400e 2024 (c_can0) and 0x400a 4024 (c_can1)) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 825 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.2.4 if1 and if2 message buffer registers the bits of the message buffer registers mirror the message objects in the message ram. 36.6.2.4.1 can message interface command mask 1 registers 6 mask access mask bits 0 r/w 0 mask bits unchanged. 1 transfer identifier mask + mdir + mxtd to ifx message buffer register. 7 wr_rd 0 read transfer transfer data from the message object addressed by the command request register to the selected message buffer registers canifn_cmdreq. 0r/w 31:8 - - reserved 0 - table 767. can message interface command mask registers read direction (if2_cmdmsk, address 0x400e 2084 (c_can0) and 0x400a 4024 (c_can1)) bit description bit symbol value description reset value access table 768. can message interface command mask 1 registers (if1_msk1, address 0x400e 2028 (c_can0) and 0x400a 4028 (c_can1)) bit description bit symbol description reset value access 15:0 msk15_0 identifier mask 0 = the corresponding bit in the identifier of the message can not inhibit the match in the acceptance filtering. 1 = the corresponding identifier bit is used for acceptance filtering. 0xffff r/w 31:16 - reserved 0 - table 769. can message interface command mask 1 registers (if2_msk1, address 0x400e 2088 (c_can0) and 0x400a 4028 (c_can1)) bit description bit symbol description reset value access 15:0 msk15_0 identifier mask 0 = the corresponding bit in the identifier of the message can not inhibit the match in the acceptance filtering. 1 = the corresponding identifier bit is used for acceptance filtering. 0xffff r/w 31:16 - reserved 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 826 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.2.4.2 can message interface command mask 2 registers table 770. can message interface command mask 2 registers (if1_msk2, address 0x400e 202c (c_can0) and 0x400a 402c (c_can1)) bit description bit symbol value description reset value access 12:0 msk28_16 identifier mask 0 = the corresponding bit in the identifier of the message can not inhibit the match in the acceptance filtering. 1 = the corresponding identifier bit is used for acceptance filtering. 0xfff r/w 13 - reserved 1 - 14 mdir mask message direction 1 r/w 0 the message direction bit (dir) has no effect on acceptance filtering. 1 the message direction bit (dir) is used for acceptance filtering. 15 mxtd mask extend identifier 1 r/w 0 the extended identifier bit (ide) has no effect on acceptance filtering. 1 the extended identifier bit (ide) is used for acceptance filtering. 31:16 - - reserved 0 - table 771. can message interface command mask 2 registers (if2_msk2, 0x400e 208c (c_can0) and 0x400a 402c (c_can1)) bit description bit symbol value description reset value access 12:0 msk28_16 identifier mask 0 = the corresponding bit in the identifier of the message can not inhibit the match in the acceptance filtering. 1 = the corresponding identifier bit is used for acceptance filtering. 0xfff r/w 13 - reserved 1 - 14 mdir mask message direction 1 r/w 0 the message direction bit (dir) has no effect on acceptance filtering. 1 the message direction bit (dir) is used for acceptance filtering. 15 mxtd mask extend identifier 1 r/w 0 the extended identifier bit (ide) has no effect on acceptance filtering. 1 the extended identifier bit (ide) is used for acceptance filtering. 31:16 - - reserved 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 827 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.2.4.3 can message interface command arbitration 1 registers 36.6.2.4.4 can message interface command arbitration 2 registers table 772. can message interface command arbi tration 1 registers (if1_arb1, address 0x400e 2030 (c_can0) and 0x400a 4030 (c_can1)) bit description bit symbol description reset value access 15:0 id15_0 message identifier 29-bit identifier (?extended frame?) 11-bit identifier (?standard frame?) 0x00 r/w 31:16 - reserved 0 - table 773. can message interface command arbi tration 1 registers (if2_arb1, address 0x400e 2090 (c_can0) and 0x400a 4090 (c_can1)) bit description bit symbol description reset value access 15:0 id15_0 message identifier 29-bit identifier (?extended frame?) 11-bit identifier (?standard frame?) 0x00 r/w 31:16 - reserved 0 - table 774. can message interface command arbi tration 2 registers (if1_arb2, address 0x400e 2034 (c_can0) and 0x400a 4034 (c_can1)) bit description bit symbol value description reset value access 12:0 id28_16 message identifier 29-bit identifier (?extended frame?) 11-bit identifier (?standard frame?) 0x00 r/w 13 dir message direction 0x00 r/w 0 direction = receive. on txrqst, a remote frame with the identifier of this message object is transmitted. on reception of a data frame with matching identifier, that message is stored in this message object. 1 direction = transmit. on txrqst, the respecti ve message object is transmitted as a data frame. on reception of a remote frame with matching identifier, the txrqst bit of this message object is set (if rmten = one). 14 xtd extend identifier 0x00 r/w 0 the 11-bit standard identifier will be used for this message object. 1 the 29-bit extended identifier will be used for this message object. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 828 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 15 msgval message valid remark: the msgval bit of all unused messages objects is reset during the initialization before bit init is reset in the can control register. this bit must be set to zero before the identifier id28:0, the control bits xtd, dir, or the data length code dlc3:0 are modified, or if the messages object is no longer required. 0r/w 0 the message object is ignored by the message handler. 1 the message object is configured and should be considered by the message handler. 31:16 - - reserved 0 - table 775. can message interface command arbi tration 2 registers (if2_arb2, address 0x400e 2094 (c_can0) and 0x400a 4094 (c_can1)) bit description bit symbol value description reset value access 12:0 id28_16 message identifier 29-bit identifier (?extended frame?) 11-bit identifier (?standard frame?) 0x00 r/w 13 dir message direction 0x00 r/w 0 direction = receive. on txrqst, a remote frame with the identifier of this message object is transmitted. on reception of a data frame with matching identifier, that message is stored in this message object. 1 direction = transmit. on txrqst, the respecti ve message object is transmitted as a data frame. on reception of a remote frame with matching identifier, the txrqst bit of this message object is set (if rmten = one). 14 xtd extend identifier 0x00 r/w 0 the 11-bit standard identifier will be used for this message object. 1 the 29-bit extended identifier will be used for this message object. table 774. can message interface command arbi tration 2 registers (if1_arb2, address 0x400e 2034 (c_can0) and 0x400a 4034 (c_can1)) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 829 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.2.4.5 can message interface message control registers 15 msgval message valid remark: the msgval bit of all unused messages objects is reset during the initialization before bit init is reset in the can control register. this bit must be set to zero before the identifier id28:0, the control bits xtd, dir, or the data length code dlc3:0 are modified, or if the messages object is no longer required. 0r/w 0 the message object is ignored by the message handler. 1 the message object is configured and should be considered by the message handler. 31:16 - - reserved 0 - table 775. can message interface command arbi tration 2 registers (if2_arb2, address 0x400e 2094 (c_can0) and 0x400a 4094 (c_can1)) bit description bit symbol value description reset value access table 776. can message interf ace message control regist ers (if1_mctrl, address 0x400e 2038 (c_can0) and 0x400a 4038 (c_can1)) bit description bit symbol value description reset value access 3:0 dlc3_0 data length code remark: the data length code of a message object must be defined the same as in all the corresponding objects with the same identifier at other nodes. when the message handler stores a data frame, it will write the dlc to the value given by the received message. 0000 to 1000 = data frame has 0 - 8 data bytes. 1001 to 1111 = data frame has 8 data bytes. 0000 r/w 6:4 - reserved - - 7 eob end of buffer 0 r/w 0 message object belongs to a fifo buffer and is not the last message object of that fifo buffer. 1 single message object or last message object of a fifo buffer. 8 txrqst transmit request 0 r/w 0 this message object is not waiting for transmission. 1 the transmission of this message object is requested and is not yet done 9 rmten remote enable 0 r/w 0 at the reception of a remote frame, txrqst is left unchanged. 1 at the reception of a remote frame, txrqst is set. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 830 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 10 rxie receive interrupt enable 0 r/w 0 intpnd will be left unchanged after successful reception of a frame. 1 intpnd will be set after successful reception of a frame. 11 txie transmit interrupt enable 0 r/w 0 the intpnd bit will be left unchanged after a successful reception of a frame. 1 intpnd will be set after a successful reception of a frame. 12 umask use acceptance mask remark: if umask is set to 1, the message object?s mask bits have to be programmed during initialization of the message object before magval is set to 1. 0r/w 0 mask ignored. 1 use mask (msk[28:0], mxtd, and mdir) for acceptance filtering. 13 intpnd interrupt pending 0 r/w 0 this message object is not the source of an interrupt. 1 this message object is the source of an interrupt. the interrupt identifier in the interrupt register will point to this message object if there is no other interrupt source with higher priority. 14 msglst message lost (only valid for message objects in the direction receive). 0r/w 0 no message lost since this bit was reset last by the cpu. 1 the message handler stored a new message into this object when newdat was still set, the cpu has lost a message. 15 newdat new data 0 r/w 0 no new data has been written into the data portion of this message object by the message handler since this flag was cleared last by the cpu. 1 the message handler or the cpu has written new data into the data portion of this message object. 31:16 - - reserved 0 - table 776. can message interf ace message control regist ers (if1_mctrl, address 0x400e 2038 (c_can0) and 0x400a 4038 (c_can1)) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 831 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can table 777. can message interf ace message control regist ers (if2_mctrl, address 0x400e 2098 (c_can0) and 0x400a 4098 (c_can1)) bit description bit symbol value description reset value access 3:0 dlc3_0 data length code remark: the data length code of a message object must be defined the same as in all the corresponding objects with the same identifier at other nodes. when the message handler stores a data frame, it will write the dlc to the value given by the received message. 0000 to 1000 = data frame has 0 - 8 data bytes. 1001 to 1111 = data frame has 8 data bytes. 0000 r/w 6:4 - reserved - - 7 eob end of buffer 0 r/w 0 message object belongs to a fifo buffer and is not the last message object of that fifo buffer. 1 single message object or last message object of a fifo buffer. 8 txrqst transmit request 0 r/w 0 this message object is not waiting for transmission. 1 the transmission of this message object is requested and is not yet done 9 rmten remote enable 0 r/w 0 at the reception of a remote frame, txrqst is left unchanged. 1 at the reception of a remote frame, txrqst is set. 10 rxie receive interrupt enable 0 r/w 0 intpnd will be left unchanged after successful reception of a frame. 1 intpnd will be set after successful reception of a frame. 11 txie transmit interrupt enable 0 r/w 0 the intpnd bit will be left unchanged after a successful reception of a frame. 1 intpnd will be set after a successful reception of a frame. 12 umask use acceptance mask remark: if umask is set to 1, the message object?s mask bits have to be programmed during initialization of the message object before magval is set to 1. 0r/w 0 mask ignored. 1 use mask (msk[28:0], mxtd, and mdir) for acceptance filtering. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 832 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.2.4.6 can message interface data a1 registers in a can data frame, data0 is the first, data7 (in can_if1b2 and can_if2b2) is the last byte to be transmitted or received. in can?s serial bit stream, the msb of each byte will be transmitted first. remark: byte data0 is the first data byte shifted into the shift register of the can core during a reception, byte data7 is the las t. when the message handler stores a data frame, it will write all the eigh t data bytes into a message ob ject. if the data length code is less than 8, the remaining bytes of th e message object will be overwritten by non specified values. 13 intpnd interrupt pending 0 r/w 0 this message object is not the source of an interrupt. 1 this message object is the source of an interrupt. the interrupt identifier in the interrupt register will point to this message object if there is no other interrupt source with higher priority. 14 msglst message lost (only valid for message objects in the direction receive). 0r/w 0 no message lost since this bit was reset last by the cpu. 1 the message handler stored a new message into this object when newdat was still set, the cpu has lost a message. 15 newdat new data 0 r/w 0 no new data has been written into the data portion of this message object by the message handler since this flag was cleared last by the cpu. 1 the message handler or the cpu has written new data into the data portion of this message object. 31:16 - - reserved 0 - table 777. can message interf ace message control regist ers (if2_mctrl, address 0x400e 2098 (c_can0) and 0x400a 4098 (c_can1)) bit description ?continued bit symbol value description reset value access table 778. can message interface data a1 registers (if1_da1, address 0x400e 203c (c_can0) and 0x400a 403c (c_can1)) bit description bit symbol description reset value access 7:0 data0 data byte 0 0x00 r/w 15:8 data1 data byte 1 0x00 r/w 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 833 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.2.4.7 can message interface data a2 registers 36.6.2.4.8 can message interface data b1 registers 36.6.2.4.9 can message interface data b2 registers table 779. can message interface data a1 registers (if2_da1, address 0x400e 209c (c_can0) and 0x400a 409c (c_can1)) bit description bit symbol description reset value access 7:0 data0 data byte 0 0x00 r/w 15:8 data1 data byte 1 0x00 r/w 31:16 - reserved - - table 780. can message interface data a2 registers (if1_da2, address 0x400e 2040 (c_can0) and 0x400a 4040 (c_can1)) bit description bit symbol description reset value access 7:0 data2 data byte 2 0x00 r/w 15:8 data3 data byte 3 0x00 r/w 31:16 - reserved - - table 781. can message interface data a2 registers (if2_da2, address 0x400e 20a0 (c_can0) and 0x400a 40a0 (c_can1)) bit description bit symbol description reset value access 7:0 data2 data byte 2 0x00 r/w 15:8 data3 data byte 3 0x00 r/w 31:16 - reserved - - table 782. can message interface data b1 registers (if1_db1, address 0x400e 2044 (c_can0) and 0x400a 4044 (c_can1)) bit description bit symbol description reset value access 7:0 data4 data byte 4 0x00 r/w 15:8 data5 data byte 5 0x00 r/w 31:16 - reserved - - table 783. can message interface data b1 registers (if2_db1, address 0x400e 20a4 (c_can0) and 0x400a 40a4 (c_can1)) bit description bit symbol description reset value access 7:0 data4 data byte 4 0x00 r/w 15:8 data5 data byte 5 0x00 r/w 31:16 - reserved - - table 784. can message interface data b2 registers (if1_db2, address 0x400e 2048 (c_can0) and 0x400a 4048 (c_can1)) bit description bit symbol description reset value access 7:0 data6 data byte 6 0x00 r/w 15:8 data7 data byte 7 0x00 r/w 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 834 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.3 message handler registers all message handler registers are read-only. their contents (txrqst, newdat, intpnd, and msgval bits of each message obje ct and the interrupt id entifier) is status information provided by the message handler fsm. 36.6.3.1 can transmission request 1 register this register contains the txrqst bits of message objects 1 to 16. by reading out the txrqst bits, the cpu can check for which message object a transmission request is pending. the txrqst bit of a specific message object can be set/reset by the cpu via the ifx message interface registers or by the message handler after reception of a remote frame or after a successful transmission. 36.6.3.2 can transmission request 2 register this register contains the txrqst bits of message objects 32 to 17. by reading out the txrqst bits, the cpu can check for which message object a transmission request is pending. the txrqst bit of a specific message object can be set/reset by the cpu via the ifx message interface registers or by the message handler after reception of a remote frame or after a successful transmission. table 785. can message interface data b2 registers (if2_db2, address 0x400e 20a8 (c_can0) and 0x400a 40a8 (c_can1)) bit description bit symbol description reset value access 7:0 data6 data byte 6 0x00 r/w 15:8 data7 data byte 7 0x00 r/w 31:16 - reserved - - table 786. can transmission request 1 register (txreq1, address 0x400e 2100 (c_can0) and 0x400a 4100 (c_can1)) bit description bit symbol description reset value access 15:0 txrqst16_1 transmission request bit of message objects 16 to 1. 0 = this message object is not waiting for transmission. 1 = the transmission of this message object is requested and not yet done. 0x00 r 31:16 - reserved - - table 787. can transmission request 2 register (txreq2, address 0x400e 2104 (c_can0) and 0x400a 4104 (c_can1)) bit description bit symbol description reset value access 15:0 txrqst32_17 transmission request bit of message objects 32 to 17. 0 = this message object is not waiting for transmission. 1 = the transmission of this message object is requested and not yet done. 0x00 r 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 835 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.3.3 can new data 1 register this register contains the newdat bits of message objects 16 to 1. by reading out the newdat bits, the cpu can check for which message object the data portion was updated. the newdat bit of a specific mess age object can be set/reset by the cpu via the ifx message interface registers or by th e message handler after reception of a data frame or after a successful transmission. 36.6.3.4 can new data 2 register this register contains the newdat bits of message objects 32 to 17. by reading out the newdat bits, the cpu can check for which message object the data portion was updated. the newdat bit of a specific mess age object can be set/reset by the cpu via the ifx message interface registers or by th e message handler after reception of a data frame or after a successful transmission. 36.6.3.5 can interrupt pending 1 register this register contains the intpnd bits of message objects 16 to 1. by reading out the intpnd bits, the cpu can check for which message object an interrupt is pending. the intpnd bit of a specific message object can be set/reset by the cpu via the ifx message interface registers or by the message handler after reception or after a successful transmission of a frame. this w ill also affect the value of intpnd in the interrupt register. table 788. can new data 1 register (nd1, address 0x400e 2120 (c_can0) and 0x400a 4120 (c_can1)) bit description bit symbol description reset value access 15:0 newdat16_1 new data bits of message objects 16 to 1. 0 = no new data has been written into the data portion of this message object by the message handler since last time this flag was cleared by the cpu. 1 = the message handler or the cpu has written new data into the data portion of this message object. 0x00 r 31:16 - reserved - - table 789. can new data 2 register (nd2, address 0x400e 2124 (c_can0) and 0x400a 4124 (c_can1)) bit description bit symbol description reset value access 15:0 newdat32_17 new data bits of message objects 32 to 17. 0 = no new data has been written into the data portion of this message object by the message handler since last time this flag was cleared by the cpu. 1 = the message handler or the cpu has written new data into the data portion of this message object. 0x00 r 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 836 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.3.6 can interrupt pending 2 register this register contains the intpnd bits of message objects 32 to 17. by reading out the intpnd bits, the cpu can check for which message object an interrupt is pending. the intpnd bit of a specific message object can be set/reset by the cpu via the ifx message interface registers or by the message handler after reception or after a successful transmission of a frame. this w ill also affect the value of intpnd in the interrupt register. 36.6.3.7 can message valid 1 register this register contains the msgval bits of message objects 16 to 1. by reading out the msgval bits, the cpu can check which message object is valid. the msgval bit of a specific message object can be set/reset by the cpu via the ifx message interface registers. 36.6.3.8 can message valid 2 register this register contains the msgval bits of message objects 32 to 17. by reading out the msgval bits, the cpu can check which message object is valid. the msgval bit of a specific message object can be set/reset by the cpu via the ifx message interface registers. table 790. can interrupt pending 1 register (ir1, address 0x400e 2140 (c_can0) and 0x400a 4140 (c_can1)) bit description bit symbol description reset value access 15:0 intpnd16_1 interrupt pending bits of message objects 16 to 1. 0 = this message object is ignored by the message handler. 1 = this message object is the source of an interrupt. 0x00 r 31:16 - reserved - - table 791. can interrupt pending 2 register (ir2, addresses 0x400e 2144 (c_can0) and 0x400a 4144 (c_can1)) bit description bit symbol description reset value access 15:0 intpnd32_17 interrupt pending bits of message objects 32 to 17. 0 = this message object is ignored by the message handler. 1 = this message object is the source of an interrupt. 0x00 r 31:16 - reserved - - table 792. can message valid 1 register (msgv1, addresses 0x400e 2160 (c_can0) and 0x400a 4160 (c_can1)) bit description bit symbol description reset value access 15:0 msgval16_1 message valid bits of message objects 16 to 1. 0 = this message object is ignored by the message handler. 1 = this message object is configured and should be considered by the message handler. 0x00 r 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 837 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.6.4 can timing register 36.6.4.1 can clock divider register this register determines the can clock signal. the can_clk is derived from the peripheral clock pclk divided by the values in this register. 36.7 functional description 36.7.1 c_can controller state after reset after a hardware reset, the registers hold the values described in table 751 . additionally, the busoff state is reset and the output can_txd is set to recessive (high). the value 0x0001 (init = ?1?) in the can control regist er enables the software initialization. the can controller does not communicate with th e can bus until the cpu resets init to ?0?. the data stored in the message ram is not affected by a hardware reset. after power-on, the contents of the message ram is undefined. table 793. can message valid 2 register (msgv2, address 0x400e 2164 (c_can0) and 0x400a 4164 (c_can1)) bit description bit symbol description access reset value 15:0 msgval32_17 message valid bits of message objects 32 to 17. 0 = this message object is ignored by the message handler. 1 = this message object is configured and should be considered by the message handler. r0x00 31:16 - reserved - - table 794. can clock divider register (cl kdiv, address 0x400e 2180 (c_can0) and 0x400a 4180 (c_can1)) bit description bit symbol description reset value access 3:0 clkdivval clock divider value can_clk = pclk/(2 clkdivval -1 +1) 0000: can_clk = pclk divided by 1. 0001: can_clk = pclk divided by 2. 0010: can_clk = pclk divided by 3. 0010: can_clk = pclk divided by 4. 0011: can_clk = pclk divided by 5. 0100: can_clk = pclk divided by 9. 0101: can_clk = pclk divided by 17. ... 1111: can_clk = pclk divided by 1 6385. 0000 r/w 31:4 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 838 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.7.2 c_can operating modes 36.7.2.1 software initialization the software initia lization is started by setting the bit init in the can control register, either by software or by a hardware reset, or by entering the busoff state. during software initialization (init bit is set), the following conditions are present: ? all message transfer from a nd to the can bus is stopped. ? the status of the can output can_txd is recessive (high). ? the eml counters are unchanged. ? the configuration registers are unchanged. ? access to the bit timing register and the br p extension register is enabled if the cce bit in the can control register is also set. to initialize the can controller, software has to set up the bit timing register and each message object. if a message object is not needed, it is sufficient to set its msgval bit to not valid. otherwise, the whole mess age object has to be initialized. resetting the init bit finishes the software initialization. afterwards the bit stream processor bsp synchronizes itself to the data transfer on the can bus by waiting for the occurrence of a sequence of 11 consecutive re cessive bits (bus idle) before it can take part in bus activities and starts the message transfer. remark: the initialization of the message objects is independent of init and also can be done on the fly, but the message objects should all be configured to particular identifiers or set to not valid during so ftware initialization before the bsp starts the message transfer. to change the configuration of a message ob ject during normal operation, the cpu has to start by setting the msgval bit to not valid. when the configuration is completed, msagvalis set to valid again. 36.7.2.2 can message transfer once the can controller is initialized and init is reset to zero, the can core synchronizes itself to the can bus and starts the message transfer. received messages are stored into their appropriate message objects if they pass the message handler?s acceptance filtering. the whole message including all arbitration bits, dlc and eight data bytes is stored into the message object. if the identifier mask is used, the arbitration bits which are masked to ?don?t care? may be overwritten in the message object. the cpu may read or write each message any time via the interface registers. the message handler guarantees data consiste ncy in case of c oncurrent accesses. messages to be transmitted are updated by the cpu. if a permanent message object (arbitration and control bits set up during c onfiguration) exists for the message, only the data bytes are updated and then txrqut bit with newdat bit are set to start the transmission. if several transmit messages are assigned to the same message object (when the number of message objects is not sufficient), the whole message object has to be configured before the transmission of this message is requested. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 839 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can the transmission of any number of message objects may be requested at the same time, and they are transmitted subsequently according to their internal priority. messages may be updated or set to not valid any time, even when their r equested transmission is still pending. the old data will be discarded when a message is updated before its pending transmission has started. depending on the configuration of the message object, the transmission of a message may be requested autonomously by the reception of a remote frame with a matching identifier. 36.7.2.3 disabled automatic retransmission (dar) according to the can specification (iso11898, 6.3.3 recovery management) , the can controller provides means for automatic retransmission of frames that have lost arbitration or that have been disturbed by errors during transmission. th e frame transmission service will not be confirmed to the us er before the transmission is successfully completed. by default, the automatic retransmission on lost arbitration or error is enabled. it can be disabled to enable the can controller to wo rk within a time triggered can (ttcan, see iso11898-1) environment. the disable automatic retransmission mode is enabled by programming bit dar in the can control register to one. in this operat ion mode the programmer has to consider the different behavior of bits txrqst and newdat in the control registers of the message buffers: ? when a transmission starts, bit txrqst of the respective message buffer is reset while bit newdat remains set. ? when the transmission completed successfully, bit newdat is reset. ? when a transmission failed (lost arbitratio n or error), bit newdat remains set. to restart the transmission, the cpu has to set txrqst back to one. 36.7.2.4 test modes the test mode is entered by setting bit test in the can control register to one. in test mode the bits tx1, tx0, lback, silent, and basic in the test register are writable. bit rx monitors the state of pins rd0,1 and ther efore is only readable. all test register functions are disabled when bit test is reset to zero. 36.7.2.4.1 silent mode the can core can be set in silent mode by programming the test register bit silent to one. in silent mode, the can controller is able to receive valid data frames and valid remote frames, but it sends only recessive bits on the can bus, and it cannot start a transmission. if the can core is required to send a dominant bit (ack bit, overload flag, active error flag), the bit is rerouted internally so that the can core monitors this dominant bit, although the can bus may remain in recessive state. the silent mode can be used to analyze the traffic on a can bus without affecting it by the transmission of dominant bits (acknowledge bits, error frames). www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 840 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.7.2.4.2 loop-back mode the can core can be set in loop-back mode by programming the test register bit lback to one. in loop-back mode, the can co re treats its own transmitted messages as received messages and stores them (if they pass acceptance filtering) into a receive buffer. this mode is provided for self-test functions. to be independent from external stimulation, the can core ignores acknowledge errors (rec essive bit sampled in the acknowledge slot of a data/remote frame) in loop-back mode. in this mode the can core performs an internal feedback from its can_txd output to its can_rxd input. the actual value of the can_rxd input pin is disregarded by the can core. the transmitted messages can be monitored at the can_txd pin. 36.7.2.4.3 loop-back mode combined with silent mode it is also possible to combine loop-back mode and silent mode by programming bits lback and silent to one at the same time. this mode can be used for a ?hot selftest?, meaning the c_can can be tested without affecting a running can system connected to the pins can_txd and can_rxd. in this mo de the can_rxd pin is disconnected from the can core and the can_txd pin is held recessive. fig 125. can core in silent mode can core td0, td1 rd0, rd1 c_can = 1 rx tx fig 126. can core in loop-back mode can core td0, td1 rd0, rd1 c_can rx tx www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 841 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.7.2.4.4 basic mode the can core can be set in basic mode by programming the test register bit basic to one. in this mode the can controller runs without the message ram. the if1 registers are used as transmit buffer . the transmission of the contents of the if1 registers is requested by writing the bu sy bit of the if1 command request register to ?1?. the if1 registers are locked while the busy bit is set. the busy bit indicates that the transmission is pending. as soon the can bus is idle, the if1 registers are loaded into the shift register of the can core and the transmission is started. when the transmission has completed, the busy bit is reset and the locked if1 registers are released. a pending transmission can be aborted at any time by resetting the busy bit in the if1 command request register while the if1 regi sters are locked. if the cpu has reset the busy bit, a possible retransmission in case of lo st arbitration or in case of an error is disabled. the if2 registers are used as receive buff er. after the reception of a message the contents of the shift register is stored in to the if2 registers, without any acceptance filtering. additionally, the actual contents of the shift register can be monitored during the message transfer. each time a read message object is initiated by writing the busy bit of the if2 command request register to ?1?, the contents of the shift register is stored into the if2 registers. in basic mode the evaluation of all message object related control and status bits and of the control bits of the ifx command mask registers is turned off. the message number of the command request registers is not evaluated. the newdat and msglst bits of the if2 message control regi ster retain their function, dlc3 -0 will show the received dlc, the other control bits will be read as ?0?. in basic mode the ready output can_wait_b is disabled (always ?1?) 36.7.2.4.5 soft ware control of pin can_txd four output functions are availabl e for the can transmit pin can_txd: 1. serial data output (default). fig 127. can core in loop-back mo de combined with silent mode can core td0, td1 rd0, rd1 c_can = 1 rx tx www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 842 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 2. drives can sample point signal to monitor the can controller?s timing. 3. drives recessive constant value. 4. drives dominant constant value. the last two functions, combined with the readable can receive pin can_rxd, can be used to check the can bus? physical layer. the output mode of pin can_txd is selected by programming the test register bits tx1 and tx0 as described section 36.6.1.6 . remark: the three test functions for pin can_txd interfere with all can protocol functions. the can_txd pin must be left in its default function when can message transfer or any of the test modes loo-ba ck mode, silent mode, or basic mode are selected. 36.7.3 can message handler the message handler controls the data transfer between the rx/tx shift register of the can core, the message ram and the ifx registers, see figure 124 . the message handler controls the following functions: ? data transfer between ifx registers and the message ram ? data transfer from shift register to the message ram ? data transfer from mess age ram to shift register ? data transfer from shift register to the acceptance filtering unit ? scanning of message ram for a matching message object ? handling of txrqst flags ? handling of interrupts www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 843 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.7.3.1 management of message objects the configuration of the messa ge objects in the message ra m will (with the exception of the bits msgval, newdat, intpnd, and txrqst ) is not be affected by resetting the chip. all the message objects must be initialized by the cpu or they must be set to not valid (msgval = ?0?).the bit timing must be configured before the cpu clears the init bit in the can control register. the configuration of a message object is don e by programming mask, arbitration, control and data field of one of the two interface regist er sets to the desired values. by writing to the corresponding ifx command request register, the ifx message buffer registers are loaded into the addressed message object in the message ram. when the init bit in the can control regist er is cleared, the can protocol controller state machine of the can core and the message handler state machine control the can controller?s internal data flow. received messages that pass the acceptance filtering are stored into the message ram, and messages with pending transmission request are loaded into the can core?s shift regist er and are transmitted via the can bus. the cpu reads received messages and updates messages to be transmitted via the ifx interface registers. depending on the configur ation, the cpu is interrupted on certain can message and can error events. fig 128. block diagram of a message object transfer if1 mask1, 2 if1 arbitration 1/2 if1 message ctrl if1 data a1/2 if1 data b1/2 if2 mask1, 2 if2 arbitration 1/2 if2 message ctrl if2 data a1/2 if2 data b1/2 message ram message object 1 message object 2 . . . message object 32 transfer a message object read transfer write transfer apb bus message buffer registers if1 command request if1 command mask if2 command request if2 command mask interface command registers message handler transmission request 1/2 new data 1/2 interrupt pending1/2 message valid1/2 can bus receive transfer a can frame transmit can core/ shift registers www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 844 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.7.3.2 data transfer between ifx registers and the message ram when the cpu initiates a data transfer between the ifx registers and message ram, the message handler sets the busy bit in the respective command register to ?1?. after the transfer has completed, the busy bit is set back to ?0?. the command mask register spec ifies whether a complete message object or only parts of it will be transf erred. due to the st ructure of the message ram it is not possible to write single bits/bytes of one message object. software must always write a complete message object into the message ram. therefore the data transfer from the ifx registers to the message ram requires a read-modify-write cycle: 1. read the parts of the message object that are not to be changed from the message ram using the command mask register. ? after the partial read of a message object, the message buffer registers that are not selected in the command mask register will be left unchanged. 2. write the complete contents of the message buffer registers into the message object. ? after the partial write of a message object, the message buffer registers that are not selected in the command mask register will set to th e actual contents of the selected message object. 36.7.3.3 transmission of messages between t he shift registers in the can core and the message buffer if the shift register of the can core cell is ready for loading and if ther e is no data transfer between the ifx registers and message ram, the msgval bits in the message valid register txrqst bits in the transmission request register are evaluated. the valid message object with the highest priority pendi ng transmission request is loaded into the shift register by the message handler and the transmission is started. the message object?s newdat bit is reset. after a successful transmission and if no ne w data was written to the message object (newdat = ?0?) since the start of the transmission, the txrq st bit will be reset. if txie is set, intpnd will be set afte r a successful transmission. if the can controller has lost the arbitration or if an er ror occurred during the trans mission, the message will be retransmitted as soon as the can bus is free again. if meanwhile the transmission of a message with higher priority has been requested, the messages will be transmitted in the order of their priority. 36.7.3.4 acceptance filtering of received messages when the arbitration and control field (identifier + ide + rtr + dlc) of an incoming message is comple tely shifted into the rx/tx shift register of the can core, the message handler state machine starts the scanning of the message ram for a matching valid message object. to scan the message ram for a matching me ssage object, the acceptance filtering unit is loaded with the arbitration bits from the ca n core shift register. then the arbitration and mask fields (including msgval, umask, ne wdat, and eob) of message object 1 are loaded into the acceptance filtering unit and compared with the arbitration field from the shift register. this is repeated with each following message object until a matching message object is found or until th e end of the message ram is reached. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 845 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can if a match occurs, the scanning is stopped and the message handler state machine proceeds depending on the type of frame (data frame or remote frame) received. 36.7.3.4.1 reception of a data frame the message handler state machine stores the message from the can core shift register into the respective message object in the message ram. the data bytes, all arbitration bits, and the data length code are stored into the corresponding message object. this is implemented to keep the data bytes connected wi th the identifier even if arbitration mask registers are used. the newdat bit is set to indicate that new data (not yet seen by the cpu) has been received. the cpu/software should reset newdat when it reads the message object. if at the time of the reception the newdat bit was already set, msglst is set to indicate that the previous data (supposedly not seen by the cpu) is lost. if the rxie bit is set, the intpnd bit is also set, causing the interrupt register to point to this message object. the txrqst bit of this message object is reset to prevent the transmission of a remote frame, while the requested data frame has just been received. 36.7.3.4.2 reception of a remote frame when a remote frame is received, three di fferent configurations of the matching message object have to be considered: 1. dir = ?1? (direction = transmit), rmten = ?1?, umask = ?1? or ?0? on the reception of a matching remote frame, the txrqst bit of this message object is set. the rest of the message object remains unchanged. 2. dir = ?1? (direction = transm it), rmten = ?0?, umask = ?0? on the reception of a matching remote frame, the txrqst bit of this message object remains unchanged; the remote frame is ignored. 3. dir = ?1? (direction = transm it), rmten = ?0?, umask = ?1? on the reception of a matching remote frame, the txrqst bit of this message object is reset. the arbitration and contro l field (identifier + ide + rtr + dlc) from the shift register is stored into the me ssage object in the message ram, and the newdat bit of this message object is set. the data field of the message object remains unchanged; the remote frame is treated similar to a received data frame. 36.7.3.5 receive/transmit priority the receive/transmit priority for the message objects is attached to the message number. message object 1 has the highest priority, while message object 32 has the lowest priority. if more than one transmission requ est is pending, they are serviced due to the priority of the corresponding message object. 36.7.3.6 configuration of a transmit object table 795 shows how a transmit object should be initialized by software (see also table 761 ): www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 846 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can the arbitration registers (id28:0 and xtd bit) are given by the application. they define the identifier and the type of the outgoing message. if an 11-bit identifier (?standard frame?) is used, it is programmed to id28. in this case id18, id17 to id0 can be disregarded. if the txie bit is set, the in tpnd bit will be set after a su ccessful transmission of the message object. if the rmten bit is set, a matching received remote frame will cause the txrqst bit to be set, and the remo te frame will autonomously be answered by a data frame. the data registers (dlc3:0, data0:7) are given by the application. txrqst and rmten may not be set before the data is valid. the mask registers (msk28-0, umask, mxtd, and mdir bits) may be used (umask=?1?) to allow groups of remote frames with similar identifiers to set the txrqst bit. for details see section 36.7.3.4.2 . the dir bit should not be masked. 36.7.3.7 updating a transmit object the cpu may update the data bytes of a transmit object any time via the ifx interface registers. neither msgval nor txrqst have to be reset before the update. even if only a part of the data bytes are to be updated, all four bytes of the corresponding ifx data a register or ifx data b register have to be valid before the content of that register is transferred to the message object . either the cpu has to write all four bytes into the ifx data register or the message obje ct is transferred to the ifx data register before the cpu writes the new data bytes. when only the (eight) data bytes are updated, first 0x0087 is written to the command mask register. then the number of the message object is written to the command request register, concurrently updati ng the data bytes and setting txrqst. to prevent the reset of txrqst at the end of a transmission that may already be in progress while the data is updated, newdat has to be set together with txrqst. for details see section 36.7.3.3 . when newdat is set together with txrqst , newdat will be reset as soon as the new transmission has started. 36.7.3.8 configuration of a receive object table 796 shows how a receive object should be initialized by software (see also table 761 ) table 795. initialization of a transmit object msgval arbitration bits data bits mask bits eob dir newdat 1 application dependent application dependent application dependent 110 msglst rxie txie intpnd rmten txrqst 0 0 application dependent 0 application dependent 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 847 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can the arbitration registers (id28-0 and xtd bit) are given by the application. they define the identifier and type of accepted received me ssages. if an 11-bit identifier (?standard frame?) is used, it is programmed to id28 to id18. id17 to id0 can then be disregarded. when a data frame with an 11-bit identifier is received, id17 to id0 will be set to ?0?. if the rxie bit is set, the intpnd bit will be set when a received data frame is accepted and stored in the message object. the data length code (dlc[3:0] is given by the application. when the message handler stores a data frame in the message object, it will store the receiv ed data length code and eight data bytes. if the data length code is less than 8, the remaining bytes of the message object will be overwritten by no n specified values. the mask registers (msk[28:0], umask, mxtd, and mdir bits) may be used (umask=?1?) to allow groups of data frames with similar identifiers to be accepted. for details see section section 36.7.3.4.1 . the dir bit should not be masked in typical applications. 36.7.3.9 handling of received messages the cpu may read a received message any time via the ifx interface registers. the data consistency is guaranteed by the message handler state machine. to transfer the entire received message from message ram into the message buffer, software must write first 0x007f to the command mask register and then the number of the message object to the command request register. additionally, the bits newdat and intpnd are cleared in the message ram (not in the message buffer). if the message object uses masks for acceptance filtering, the arbitration bits show which of the matching messages has been received. the actual value of newdat shows whether a new message has been received since last time this message object was read. the actual value of msglst shows whether more than one message has been received since last time this message object was read. msglst will not be automatically reset. using a remote frame, the cpu may request another can node to provide new data for a receive object. setting the txrqst bit of a receive object will caus e the transm ission of a remote frame with the receive object?s identifier. this remote frame triggers the other can node to start the transmission of the matching data frame. if the matching data frame is received before the remote frame could be transmitted, the txrqst bit is automatically reset. table 796. initialization of a receive object msgval arbitration bits data bits mask bits eob dir newdat 1 application dependent application dependent application dependent 100 msglst rxie txie intpnd rmten txrqst 0 application dependent 000 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 848 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.7.3.10 configuration of a fifo buffer with the exception of the eob bit, the conf iguration of receive objects belonging to a fifo buffer is the same as the configuratio n of a (single) receive object, see section section 36.7.3.8 . to concatenate two or more message objects into a fifo buffer, the identifiers and masks (if used) of these message objects have to be programmed to matching values. due to the implicit pr iority of the message objects, the message object with the lowest number will be the first message object of th e fifo buffer. the eob bit of all message objects of a fifo buffer except the last have to be programmed to zero. the eob bits of the last message object of a fifo buffer is se t to one, configuring it as the end of the block. 36.7.3.10.1 recepti on of messages with fifo buffers received messages with identifiers matching to a fifo buffer are stored into a message object of this fifo buffer starting with the message object with the lowest message number. when a message is stored into a message object of a fifo buffer the newdat bit of this message object is set. by setting newdat while eob is zero the message object is locked for further write accesses by the message handler until the cpu has written the newdat bit back to zero. messages are stored into a fifo buffer until the last message object of this fifo buffer is reached. if none of the preceding message objects is released by writing newdat to zero, all further me ssages for this fifo buffer will be wr itten into the last message object of the fifo buffer and therefore overwrite previous messages. 36.7.3.10.2 reading from a fifo buffer when the cpu transfers the contents of message object to the ifx message buffer registers by writing its number to the ifx command request register, bits newdat and intpnd in the corresponding command mask register should be reset to zero (txrqst/newdat = ?1? and clrintpnd = ?1?). th e values of these bits in the message control register always reflect the status before resetting the bits. to assure the correct function of a fifo buffer, the cpu should read out the message objects starting at the fifo object with the lowest message number. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 849 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.7.4 interrupt handling if several interrupts are pending, the can inte rrupt register will po int to the pending interrupt with the highest prio rity, disregarding their chronological order. an interrupt remains pending until the cpu has cleared it. fig 129. reading a message from the fifo buffer to the message buffer start end read canir messagenum = intid read canifx_mctrl write messagenum to canifx_cmdreq read data from canifx_da/b messagenum = messagenum +1 read message to message buffer reset newdat = 0 reset intpnd = 0 intid = 0x8000 ? newdat = 1 eob = 1 intid = 0x0001 to 0x0020 ? intid = 0x0000 ? status change interrupt handling yes yes yes yes no no yes www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 850 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can the status interrupt has the highest priority . among the message interrupts, the message object?s interrupt priority decrea ses with increasing message number. a message interrupt is cleared by clearing the message object?s intpnd bit. the status interrupt is cleared by reading the status register. the interrupt identifier intid in the interrupt register indicates the cause of the interrupt. when no interrupt is p ending, the register w ill hold the value zero. if the value of the interrupt register is different fr om zero, then there is an interr upt pending and, if ie is set, the interrupt line to the cpu, irq_b, is acti ve. the interrupt line re mains active until the interrupt register is ba ck to value zero (the cause of the in terrupt is reset) or until ie is reset. the value 0x8000 indicates that an interrupt is pending because the can core has updated (not necessarily changed) the status re gister (error interrupt or status interrupt). this interrupt has the highest priority. the cpu can update (reset) the status bits rxok, txok and lec, but a write access of the cpu to the status register can never generate or reset an interrupt. all other values indicate that the source of the interrupt is one of the message objects where intid points to the pending message interrupt with the highest interrupt priority. the cpu controls whether a change of the status register may cause an interrupt (bits eie and sie in the can control register) and whether the interrupt line becomes active when the interrupt register is different from ze ro (bit ie in the can control register). the interrupt register will be updated even when ie is reset. the cpu has two possibilities to follow the source of a message interrupt: ? software can follow the intid in the interrupt register. ? software can poll the interrupt pending register. an interrupt service routine reading the message that is the source of the interrupt may read the message and reset the message object?s intpnd at the same time (bit clrintpnd in the command mask register). when intpnd is cleared, the interrupt register will point to the next messag e object with a pending in terrupt. 36.7.5 bit timing even if minor errors in the c onfiguration of the can bit timing do not result in immediate failure, the performance of a can network can be reduced significantly. in many cases, the can bit synchronization will amend a faulty configuration of the can bit timing to such a degree that only occasionally an error fr ame is generated. in the case of arbitration however, when two or more can nodes simu ltaneously try to transmit a frame, a misplaced sample point may cause one of the transmitters to become error passive. the analysis of such sporadic errors re quires a detailed knowledge of the can bit synchronization inside a can node and of the can nodes? interaction on the can bus. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 851 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can 36.7.5.1 bit time and bit rate can supports bit rates in the range of lower than 1 kbit/s up to 1000 kbit/s. each member of the can network has its own clock generat or, usually a quartz oscillator. the timing parameter of the bit time (i.e. the reciprocal of the bit rate) can be configured individually for each can node, creating a common bit ra te even though the can nodes? oscillator periods (f osc ) may be different. the frequencies of these oscilla tors are not absolu tely stable, as small variations are caused by changes in temperature or voltage and by deteriorating components. as long as the variations remain insi de a specific oscillator tolera nce range (df), the can nodes are able to compensate for the different bit rates by re-synchronizing to the bit stream. according to the can specification, the bi t time is divided into four segments ( figure 130 ). the synchronization segment, the propag ation time segment, the phase buffer segment 1, and the phase buffer segment 2. each segment consists of a specific, programmable number of time quanta (see table 797 ). the length of the time quantum (t q ), which is the basic time unit of the bit ti me, is defined by the can controller?s system clock f and the baud rate prescaler (brp): t q = brp / f sys . the c_can?s system clock f sys is the frequency c_can peripheral clock. the synchronization segment sync_seg is the part of the bit time where edges of the can bus level are expected to occur; the distance between an edge that occurs outside of sync_seg and the sync_seg is called the phase error of that edge. the propagation time segment prop_seg is intended to comp ensate for the physica l delay times within the can network. the phase buffer segments phase_seg1 and phase_seg2 surround the sample point. the (re-)synchroniza tion jump width (sjw) defines how far a re-synchronization may move the sample point inside the limits defined by the phase buffer segments to compensate for edge phase errors. table 797 describes the minimum programmable ra nges required by the can protocol. bit time parameters are programmed through the bt register, table 756 . for details on bit timing and examples, see the c_can user?s manual, revision 1.2 . table 797. parameters of the c_can bit time parameter range function brp (1...32) defines the length of the time quantum t q . sync_seg 1t q synchronization segment. fixed length. synchronization of bus input to system clock. prop_seg (1...8) ? t q propagation time segment. compensates for physical delay times. this parameter is determined by the system delay times in the c_can network. tseg1 (1...8) ? t q phase buffer segment 1. may be lengthened temporarily by synchronization. tseg2 (1...8) ? t q phase buffer segment 2. may be shortened temporarily by synchronization. sjw (1...4) ? t q (re-) synchronization jump width. may not be longer than either phase buffer segment. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 852 of 1164 nxp semiconductors UM10430 chapter 36: lpc18xx c_can fig 130. bit timing www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 853 of 1164 37.1 how to read this chapter the i2c-bus interfaces i2c0 and i2c1 are available on all lpc18xx parts. 37.2 basic configuration the i2c0/1 are configured as follows: ? see ta b l e 7 9 8 for clocking and power control. ? the i2c0/1 are reset by the i2c0/1_rst (reset # 48/49). ? the i2c0/1 interrupts are connected to slots # 18/19 in the nvic. ? configure the i2c0 pins for fast-mode plus , fast mode, or standard mode through the sfsi2c0 register in the syscon block (see ta b l e 2 0 5 ). 37.3 features ? standard i 2 c-compliant bus interfaces may be configured as master, slave, or master/slave. ? arbitration is handled between simultaneously transmitting masters without corruption of serial data on the bus. ? programmable clock allows adjustment of i 2 c transfer rates. ? data transfer is bidirectional between masters and slaves. ? serial clock synchronization allows devices with different bit rates to communicate via one serial bus. ? serial clock synchronization is used as a handshake mechanism to suspend and resume serial transfer. ? supports fast-mode plus. ? optional recognition of up to four distinct slave addresses. ? monitor mode allows observing all i 2 c-bus traffic, regardless of slave address. ? i 2 c-bus can be used for test and diagnostic purposes. ? the i 2 c-bus contains a standard i 2 c-compliant bus interface with two pins. UM10430 chapter 37: lpc18xx i2c-bus interface rev. 00.13 ? 20 july 2011 user manual table 798. i2c0/1 clocking and power control base clock branch clock maximum frequency clock to the i2c0 register interface and i2c0 peripheral clock. base_apb1_clk clk_apb1_i2c0 150 mhz clock to the i2c1 register interface and i2c1 peripheral clock. base_apb3_clk clk_apb3_i2c1 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 854 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.4 applications interfaces to external i 2 c standard parts, such as serial rams, lcds, tone generators, other microcontrollers, etc. 37.5 general description a typical i 2 c-bus configuration is shown in figure 131 . depending on the state of the direction bit (r/w), two types of data transfers are possible on the i 2 c-bus: ? data transfer from a master transmitter to a slave receiver. the first byte transmitted by the master is the slave address. next follows a number of data bytes. the slave returns an acknowledge bit after each received byte. ? data transfer from a slave transmitter to a master receiver. the first byte (the slave address) is transmitted by the master. the slave then returns an acknowledge bit. next follows the data bytes transmitted by th e slave to the master. the master returns an acknowledge bit after all received bytes other than the last byte. at the end of the last received byte, a ?not acknowledge? is returned. the master device generates all of the serial clock pulses and the start and stop conditions. a transfer is ended with a stop condition or with a repeated start condition. since a repeated start condition is also the beginning of the next serial transfer, the i 2 c bus will not be released. the i 2 c interface is byte oriented and has four operating modes: master transmitter mode, master receiver mode, slave transmitter mode and slave receiver mode. the i 2 c interface complies with the entire i 2 c specification, supporting the ability to turn power off to the processor without interf ering with other devices on the same i 2 c-bus. fig 131. i 2 c-bus configuration other device with i 2 c interface pull-up resistor other device with i 2 c interface lpc18xx sda scl i 2 c bus scl sda pull-up resistor www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 855 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.5.1 i 2 c fast-mode plus fast-mode plus supports a 1 mbit/sec transfer rate to communicate with the i 2 c-bus products which nxp semiconductors is now providing. in order to use fast-mode plus, the i 2 c pins must be properly configured in the sfsi2c0 register in the syscon block (see ta b l e 2 0 5 ). 37.6 pin description the i 2 c-bus pins must be config ured through syscon register s for standard/ fast-mode or fast-mode plus. 37.7 register description table 799. i 2 c-bus pin description pin type description sda0 input/output i 2 c data input/output. open-drain output (for i 2 c-bus compliance). scl0 input/output i 2 c clock input/output. open-drain output (for i 2 c-bus compliance). sda1 input/output i 2 c serial data. uses standard i/o pins (fast-mode only). scl1 input/output i 2 c serial clock. uses standard i/o pins (fast-mode only). table 800. register overview: i 2 c0 (base address 0x400a 1000) name access address offset description reset value [1] conset r/w 0x000 i2c control set register. when a one is written to a bit of this register, the corresponding bit in the i 2 c control register is set. writing a zero has no effect on the corresponding bit in the i 2 c control register. 0x00 stat ro 0x004 i2c status register. during i 2 c operation, this register provides detailed status codes that allow software to determine the next action needed. 0xf8 dat r/w 0x008 i2c data register. during master or slave transmit mode, data to be transmitted is written to this register. during master or slave receive mode, data that has been received may be read from this register. 0x00 adr0 r/w 0x00c i2c slave address register 0. contains the 7-bit slave address for operation of the i 2 c interface in slave mode, and is not used in master mode. the least significant bit determines whether a slave responds to the general call address. 0x00 sclh r/w 0x010 sch duty cycle register high half word. determines the high time of the i 2 c clock. 0x04 scll r/w 0x014 scl duty cycle register low half word. determines the low time of the i 2 c clock. scll and sclh together determine the clock frequency generated by an i 2 c master and certain times used in slave mode. 0x04 conclr wo 0x018 i2c control clear register. when a one is written to a bit of this register, the corresponding bit in the i 2 c control register is cleared. writing a zero has no effect on the corresponding bit in the i 2 c control register. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 856 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface [1] reset value reflects the data stored in used bi ts only. it does not include reserved bits content. mmctrl r/w 0x01c monitor mode control register. 0x00 adr1 r/w 0x020 i2c slave address register 1. contains the 7-bit slave address for operation of the i 2 c interface in slave mode, and is not used in master mode. the least significant bit determines whether a slave responds to the general call address. 0x00 adr2 r/w 0x024 i2c slave address register 2. contains the 7-bit slave address for operation of the i 2 c interface in slave mode, and is not used in master mode. the least significant bit determines whether a slave responds to the general call address. 0x00 adr3 r/w 0x028 i2c slave address register 3. contains the 7-bit slave address for operation of the i 2 c interface in slave mode, and is not used in master mode. the least significant bit determines whether a slave responds to the general call address. 0x00 data_buffe r ro 0x02c data buffer register. the contents of the 8 msbs of the dat shift register will be transferred to the data_buffer automatically after every nine bits (8 bits of data plus ack or nack) has been received on the bus. 0x00 mask0 r/w 0x030 i2c slave address mask register 0 . this mask register is associated with adr0 to determine an address match. the mask register has no effect when comparing to the general call address (?0000000?). 0x00 mask1 r/w 0x034 i2c slave address mask register 1 . this mask register is associated with adr0 to determine an address match. the mask register has no effect when comparing to the general call address (?0000000?). 0x00 mask2 r/w 0x038 i2c slave address mask register 2 . this mask register is associated with adr0 to determine an address match. the mask register has no effect when comparing to the general call address (?0000000?). 0x00 mask3 r/w 0x03c i2c slave address mask register 3 . this mask register is associated with adr0 to determine an address match. the mask register has no effect when comparing to the general call address (?0000000?). 0x00 table 800. register overview: i 2 c0 (base address 0x400a 1000) ?continued name access address offset description reset value [1] table 801. register overview: i 2 c1 (base address 0x400e 0000) name access address offset description reset value [1] conset r/w 0x000 i2c control set register. when a one is written to a bit of this register, the corresponding bit in the i 2 c control register is set. writing a zero has no effect on the corresponding bit in the i 2 c control register. 0x00 stat ro 0x004 i2c status register. during i 2 c operation, this register provides detailed status codes that allow software to determine the next action needed. 0xf8 idat r/w 0x008 i2c data register. during master or slave transmit mode, data to be transmitted is written to this register. during master or slave receive mode, data that has been received may be read from this register. 0x00 adr0 r/w 0x00c i2c slave address register 0. contains the 7-bit slave address for operation of the i 2 c interface in slave mode, and is not used in master mode. the least significant bit determines whether a slave responds to the general call address. 0x00 sclh r/w 0x010 sch duty cycle register high half word. determines the high time of the i 2 c clock. 0x04 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 857 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface [1] reset value reflects the data stored in used bi ts only. it does not include reserved bits content. 37.7.1 i 2 c control set register the conset registers control setting of bits in the con register that controls operation of the i 2 c interface. writing a one to a bit of this register causes the corresponding bit in the i 2 c control register to be set. writing a zero has no effect. scll r/w 0x014 scl duty cycle register low half word. determines the low time of the i 2 c clock. i2nscll and nsclh together determine the clock frequency generated by an i 2 c master and certain times used in slave mode. 0x04 conclr wo 0x018 i2c control clear register. when a one is written to a bit of this register, the corresponding bit in the i 2 c control register is cleared. writing a zero has no effect on the corresponding bit in the i 2 c control register. - mmctrl r/w 0x01c monitor mode control register. 0x00 adr1 r/w 0x020 i2c slave address register 1. contains the 7-bit slave address for operation of the i 2 c interface in slave mode, and is not used in master mode. the least significant bit determines whether a slave responds to the general call address. 0x00 adr2 r/w 0x024 i2c slave address register 2. contains the 7-bit slave address for operation of the i 2 c interface in slave mode, and is not used in master mode. the least significant bit determines whether a slave responds to the general call address. 0x00 adr3 r/w 0x028 i2c slave address register 3. contains the 7-bit slave address for operation of the i 2 c interface in slave mode, and is not used in master mode. the least significant bit determines whether a slave responds to the general call address. 0x00 data_ buffer ro 0x02c data buffer register. the contents of the 8 msbs of the dat shift register will be transferred to the data_buffer automatically after every nine bits (8 bits of data plus ack or nack) has been received on the bus. 0x00 mask0 r/w 0x030 i2c slave address mask register 0 . this mask register is associated with adr0 to determine an address match. the mask register has no effect when comparing to the general call address (?0000000?). 0x00 mask1 r/w 0x034 i2c slave address mask register 1 . this mask register is associated with adr0 to determine an address match. the mask register has no effect when comparing to the general call address (?0000000?). 0x00 mask2 r/w 0x038 i2c slave address mask register 2 . this mask register is associated with adr0 to determine an address match. the mask register has no effect when comparing to the general call address (?0000000?). 0x00 mask3 r/w 0x03c i2c slave address mask register 3 . this mask register is associated with adr0 to determine an address match. the mask register has no effect when comparing to the general call address (?0000000?). 0x00 table 801. register overview: i 2 c1 (base address 0x400e 0000) ?continued name access address offset description reset value [1] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 858 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface i2en i 2 c interface enable. when i2en is 1, the i 2 c interface is enabled. i2en can be cleared by writing 1 to the i2enc bit in the conclr register. when i2en is 0, the i 2 c interface is disabled. when i2en is ?0?, the sda and sc l input signals are ignored, the i 2 c block is in the ?not addressed? slave state, and the sto bit is forced to ?0?. i2en should not be used to temporarily release the i 2 c-bus since, when i2en is reset, the i 2 c-bus status is lost. the aa flag should be used instead. sta is the start flag. setting this bit causes the i 2 c interface to enter master mode and transmit a start condition or transmit a repeated start condition if it is already in master mode. when sta is 1 and the i 2 c interface is not already in mast er mode, it enters master mode, checks the bus and generates a start condition if the bus is free. if the bus is not free, it waits for a stop condition (w hich will free the bus) and generates a start condition after a delay of a half clock period of the internal clock generator. if the i 2 c interface is already in master mode and data has been transmitted or received, it transmits a repeated start condition. sta may be set at any time, including when the i 2 c interface is in an addressed slave mode. sta can be cleared by writing 1 to the stac bit in the conclr register. when sta is 0, no start condition or repeated start condition will be generated. if sta and sto are both set, then a stop condition is transmitted on the i 2 c-bus if it the interface is in master mode, and transmit s a start condition thereafter. if the i 2 c interface is in slave mode, an internal stop condition is generated, but is not transmitted on the bus. sto is the stop flag. setting this bit causes the i 2 c interface to transmit a stop condition in master mode, or recover from an error condition in slave mode. when sto is 1 in master mode, a stop condition is transmitted on the i 2 c-bus. when the bus detects the stop condition, sto is cleared automatically. in slave mode, setting this bit can recover from an error condition. in this case, no stop condition is transmitted to the bus. the hardware behaves as if a stop condition has been received and it switches to ?not addr essed? slave receiver mode. the sto flag is cleared by hardware automatically. table 802. i 2 c control set register (conset - address 0x400a 1000 (i2c0) and 0x400e 0000 (i2c1)) bit description bit symbol description reset value 1:0 - reserved. user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 2 aa assert acknowledge flag. 3si i 2 c interrupt flag. 0 4 sto stop flag. 0 5 sta start flag. 0 6i2en i 2 c interface enable. 0 31:7 - reserved. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 859 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface si is the i 2 c interrupt flag. this bit is set when the i 2 c state changes. however, entering state f8 does not set si since there is nothing for an interrupt service routine to do in that case. while si is set, the low period of the serial clock on the scl line is stretched, and the serial transfer is suspended. when scl is high, it is unaffected by the state of the si flag. si must be reset by software, by writing a 1 to the sic bit in conclr register. aa is the assert acknowledge flag. when set to 1, an acknowledge (low level to sda) will be returned during the acknowledge cloc k pulse on the scl line on the following situations: 1. the address in the slave address register has been received. 2. the general call address has been received wh ile the general call bit (gc) in adr is set. 3. a data byte has been received while the i 2 c is in the master receiver mode. 4. a data byte has been received while the i 2 c is in the addressed slave receiver mode the aa bit can be cleared by writing 1 to the aac bit in the conclr register. when aa is 0, a not acknowledge (high le vel to sda) will be returned during the acknowledge clock pulse on the scl line on the following situations: 1. a data byte has been received while the i 2 c is in the master receiver mode. 2. a data byte has been received while the i 2 c is in the addressed slave receiver mode. 37.7.2 i 2 c status register each i 2 c status register reflects the condition of the corresponding i 2 c interface. the i 2 c status register is read-only. the three least significant bits are always 0. ta ken as a byte, the status register contents represent a status code. ther e are 26 possible status codes. when the status code is 0xf8, there is no relevant information available and the si bit is not set. all other 25 status codes correspond to defined i 2 c states. when any of these st ates entered, the si bit will be set. for a complete list of status codes, refer to tables from table 818 to table 823 . 37.7.3 i 2 c data register this register contains the data to be trans mitted or the data just received. the cpu can read and write to this register only while it is not in the proc ess of shifting a byte, when the si bit is set. data in dat remains stable as long as the si bit is set. data in dat is always shifted from right to left: the first bit to be transmitted is the msb (bit 7), and after a byte has been received, the first bit of received data is located at the msb of dat. table 803. i 2 c status register (stat - address 0x400a 1004 (i2c0) and 0x400e 0004 (i2c1)) bit description bit symbol description reset value 2:0 - these bits are unused and are always 0. 0 7:3 status these bits give the actual status information about the i 2 c interface. 0x1f 31:8 - reserved. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 860 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.7.4 i 2 c slave address register 0 this register is readable and writable and are only used when an i 2 c interface is set to slave mode. in master mode, this register has no effect. the lsb of adr is the general call bit. when this bit is set, the general call address (0x00) is recognized. if this register contains 0x00, the i 2 c will not acknowledge any address on the bus. this register will be cl eared to this di sabled state on reset. see also ta b l e 8 11 . 37.7.5 i 2 c scl high and low duty cycle registers 37.7.5.1 selecting the appropriate i 2 c data rate and duty cycle software must set values for the registers sclh and scll to select the appropriate data rate and duty cycle. sclh defines the number of c_pclk cycles for the scl high time, scll defines the number of i2c_pclk cycles for the scl low time. the frequency is determined by the following formula (i2c_p clk is the frequency of the peripheral i2c clock): table 804. i 2 c data register (dat - 0x400a 1008 (i2c0) and 0x400e 0008 (i2c1)) bit description bit symbol description reset value 7:0 data this register holds data values that have been received or are to be transmitted. 0 31:8 - reserved. the value read from a reserved bit is not defined. - table 805. i 2 c slave address register 0 (adr0 - address 0x400a 100c (i2c0) and 0x400e 000c (i2c1)) bit description bit symbol description reset value 0 gc general call enable bit. 0 7:1 address the i 2 c device address for slave mode. 0x00 31:8 - reserved. the value read from a reserved bit is not defined. - table 806. i 2 c scl high duty cycle register (sclh - address 0x400a 1010 (i2c0) and 0x400e 0010 (i2c1)) bit description bit symbol description reset value 15:0 sclh count for scl high time period selection. 0x0004 31:16 - reserved. the value read from a reserved bit is not defined. - table 807. i 2 c scl low duty cycle register (scll - address 0x400a 1014 (i2c0) and 0x400e 0014 (i2c1)) bit description bit symbol description reset value 15:0 scll count for scl low time period selection. 0x0004 31:16 - reserved. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 861 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface (10) the values for scll and sclh must ensure t hat the data rate is in the appropriate i 2 c data rate range. each register value must be greater than or equal to 4. table 808 gives some examples of i 2 c-bus rates based on i2c_pclk frequency and scll and sclh values. scll and sclh values should not necessarily be the same. software can set different duty cycles on scl by setting these two registers. for example, the i 2 c-bus specification defines the scl low time and high time at di fferent values for a fast-mode and fast-mode plus i 2 c. 37.7.6 i 2 c control clear register the conclr registers control clearing of bits in the con register that controls operation of the i 2 c interface. writing a one to a bit of this register causes the corresponding bit in the i 2 c control register to be cleared. writing a zero has no effect. aac is the assert acknowledge clear bit. writing a 1 to this bit clears the aa bit in the conset register. writing 0 has no effect. table 808. scll + sclh values for selected i 2 c clock values i 2 c mode i 2 c bit frequency i2c_pclk (mhz) 6 8 10 12 16 20 30 40 50 sclh + scll standard mode 100 khz 60 80 100 120 160 200 300 400 500 fast-mode 400 khz 15 20 25 30 40 50 75 100 125 fast-mode plus 1 mhz - 8 10 12 16 20 30 40 50 i 2 c bitfrequency i2cpclk i2csclh i2cscll + -------------------------------------------------------- - = table 809. i 2 c control clear register (conclr - address 0x400a 1018 and 0x400e 0018 (i2c1)) bit description bit symbol description reset value 1:0 - reserved. user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 2 aac assert acknowledge clear bit. 3sic i 2 c interrupt clear bit. 0 4 - reserved. user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 5 stac start flag clear bit. 0 6i2enci 2 c interface disable bit. 0 7 - reserved. user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 31:8 - reserved. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 862 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface sic is the i 2 c interrupt clear bit. writing a 1 to this bit clears the si bit in the conset register. writing 0 has no effect. stac is the start flag clear bit. writing a 1 to this bit clears the sta bit in the conset register. writing 0 has no effect. i 2enc is the i 2 c interface disable bit. writing a 1 to this bit clears the i2en bit in the conset register. writing 0 has no effect. 37.7.7 i 2 c monitor mode control register this register controls the monitor mode which allows the i 2 c module to monitor traffic on the i 2 c bus without actually pa rticipating in traffic or interfering with the i 2 c bus. table 810. i 2 c monitor mode control register (mmctrl - address 0x400a 101c (i2c0) and 0x400e 001c (i2c1)) bit description bit symbol value description reset value 0 mm_ena monitor mode enable. 0 0 monitor mode disabled. 1the i 2 c module will enter monitor mode. in this mode the sda output will be forced high. this will prevent the i 2 c module from outputting data of any kind (including ack) onto the i 2 c data bus. depending on the state of the ena_scl bit, the output may be also forced high, preventing the module from having control over the i 2 c clock line. 1 ena_scl scl output enable. 0 0 when this bit is cleared to ?0?, the scl output will be forced high when the module is in monitor mode. as described above, this will prevent the module from having any control over the i 2 c clock line. 1 when this bit is set, the i 2 c module may exercise the same control over the clock line that it would in normal operation. this means that, acting as a slave peripheral, the i 2 c module can ?stretch? the clock line (hold it low) until it has had time to respond to an i 2 c interrupt. [1] 2 match_all select interrupt register match. 0 0 when this bit is cleared, an interrupt will only be generated when a match occurs to one of the (up-to) four address registers described above. that is, the module will respond as a normal slave as far as address-recognition is concerned. 1 when this bit is set to ?1? and the i2c is in monitor mode, an interrupt will be generated on any address received. this will enable the part to monitor all traffic on the bus. 31:3 - - reserved. the value read from reserved bits is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 863 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface [1] when the ena_scl bit is cleared and the i 2 c no longer has the ability to st all the bus, interrupt response time becomes important. to give the part more time to respond to an i 2 c interrupt under these conditions, a data _buffer register is used ( section 37.7.9 ) to hold received data for a full 9-bit word transmission time. remark: the ena_scl and match_all bits have no effect if the mm_ena is ?0? (i.e. if the module is not in monitor mode). 37.7.7.1 interrupt in monitor mode all interrupts will occur as no rmal when the module is in monitor mode. this means that the first interrupt will occur when an address-match is det ected (any addre ss received if the match_all bit is set, otherwise an ad dress matching one of the four address registers). subsequent to an addres s-match detection, interrupts will be gene rated after each data byte is received for a slave-write transfer, or af ter each byte that the module ?thinks? it has transmitted for a slave-read transfer. in this second case, the data register will actually contain data transmitted by some other slave on the bus which was actually addressed by the master. following all of these interrupts, the processor may read the data register to see what was actually transmitted on the bus. 37.7.7.2 loss of arbitration in monitor mode in monitor mode, the i 2 c module will not be able to respond to a requ est for information by the bus master or issu e an ack). some other slave on th e bus will respond instead. this will most probably result in a lost-arbitration state as far as our module is concerned. software should be aware of the fact that the module is in monitor mode and should not respond to any loss of arbitration state that is detected. 37.7.8 i 2 c slave address registers these registers are readable and writable and are only used when an i 2 c interface is set to slave mode. in master mode, this register has no effect. the lsb of adr is the general call bit. when this bit is set, the general call address (0x00) is recognized. if these registers contain 0x00, the i 2 c will not acknowledge any address on the bus. all four registers (including adr0, see table 805 ) will be cleared to this disabled state on reset. table 811. i 2 c slave address registers (adr - address 0x400a 1020 (adr1) to 0x400a 1028 (adr3) (i2c0) and 0x400e 0020 (adr1) to 0x400e 0028 (adr3) (i2c1)) bit description bit symbol description reset value 0 gc general call enable bit. 0 7:1 address the i 2 c device address for slave mode. 0x00 31:8 - reserved. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 864 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.7.9 i 2 c data buffer register in monitor mode, the i 2 c module may lose the ability to stretch the cl ock (stall the bus) if the ena_scl bit is not set. this means that the processor will have a limited amount of time to read the contents of the data received on the bus. if the processor reads the dat shift register, as it ordinarily would, it co uld have only one bit-time to respond to the interrupt before the received dat a is overwritten by new data. to give the processor more time to respond, a new 8-bit, read-only data_buffer register will be added. the contents of th e 8 msbs of the dat shift register will be transferred to the data_buffer automatically after every nine bits (8 bits of data plus ack or nack) has been received on the bus. this means that the processor will have nine bit transmission times to respond to the interrupt and read the data before it is overwritten. the processor will still have the ability to read dat directly, as usual, and the behavior of dat will not be altered in any way. although the data_buffer register is primarily intended for use in monitor mode with the ena_scl bit = ?0?, it will be available for reading at any time under any mode of operation. 37.7.10 i 2 c mask registers the four mask registers each contain seven acti ve bits (7:1). any bit in these registers which is set to ?1? will cause an automati c compare on the corres ponding bit of the received address when it is compared to t he adrn register associated with that mask register. in other words, bits in an adrn register which are masked are not taken into account in determining an address match. on reset, all mask register bits are cleared to ?0?. the mask register has no effect on comparison to the general call address (?0000000?). bits(31:8) and bit(0) of the mask registers are unused and should not be written to. these bits will always r ead back as zeros. when an address-match interrup t occurs, the processo r will have to read the data register (dat) to determine what the received addr ess was that actually caused the match. table 812. i 2 c data buffer register (data_buffer - address 0x400a 102c (i2c0) and 0x400e 002c (i2c1)) bit description bit symbol description reset value 7:0 data this register holds contents of the 8 msbs of the dat shift register. 0 31:8 - reserved. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 865 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.8 i 2 c operating modes in a given application, the i 2 c block may operate as a master, a slave, or both. in the slave mode, the i 2 c hardware looks for any one of its f our slave addresses and the general call address. if one of these addres ses is detected, an interrupt is requested. if the processor wishes to become the bus master, the hardw are waits until the bus is free before the master mode is entered so that a possible slave operation is not interrupted. if bus arbitration is lost in the master mode, the i 2 c block switches to the slave mode immediately and can detect its own slave address in the same serial transfer. 37.8.1 master transmitter mode in this mode data is transmitted from master to slave. before the ma ster transmitter mode can be entered, the conset register must be initialized as shown in table 814 . i2en must be set to 1 to enable the i 2 c function. if the aa bit is 0, the i 2 c interface will not acknowledge any address when another device is master of the bus, so it can not enter slave mode. the sta, sto and si bits must be 0. the si bit is cleared by writing 1 to the sic bit in the conclr register. the sta bit should be cleared after writing the slave address. the first byte transmitted contains the slave address of the receiving device (7 bits) and the data direction bit. in this mode the data direction bit (r/w) should be 0 which means write. the first byte transmitted contains the slave address and write bit. data is transmitted 8 bits at a time. after each byte is transmitted, an acknowledge bit is received. start and stop conditions are output to indi cate the beginning and the end of a serial transfer. the i 2 c interface will enter master transmitter m ode when software sets the sta bit. the i 2 c logic will send the start condition as s oon as the bus is free. after the start condition is transmitted, the si bit is set, and the status code in the stat register is 0x08. this status code is used to vector to a state servic e routine which will load the slave address and write bit to the dat register, and then clear the si bit. si is cleared by writing a 1 to the sic bit in the conclr register. table 813. i 2 c mask registers (mask - address 0x400a 1030 (mask0) to 0x400a 103c (mask3) (i2c0) and 0x400e 0030 (mask0) to 0x400e 003c (mask3) (i2c1)) bit description bit symbol description reset value 0 - reserved. user software should not write ones to reserved bits. this bit reads always back as 0. 0 7:1 mask mask bits. 0x00 31:8 - reserved. the value read from a reserved bit is not defined. - table 814. conset used to configure master mode bit 7 6 5 4 3 2 1 0 symbol - i2en sta sto si aa - - value- 10000- - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 866 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface when the slave address and r/w bit have been transmitted and an acknowledgment bit has been received, the si bit is set again, and the possible status codes now are 0x18, 0x20, or 0x38 for the master mode, or 0x68, 0x78, or 0xb0 if the slave mode was enabled (by setting aa to 1). the appropriate actions to be taken for each of these status codes are shown in ta b l e 8 1 8 to table 823 . 37.8.2 master receiver mode in the master receiver mode, data is received from a slave transmitter. the transfer is initiated in the same way as in the master transmitter mode. when the start condition has been transmitted, the interrupt service routine must load the slave address and the data direction bit to the i 2 c data register (dat), and then cl ear the si bit. in this case, the data direction bit (r/w) should be 1 to indicate a read. when the slave address and data direction bit have been transmitted and an acknowledge bit has been received, the si bit is set, and the status register will show the status code. for master mode, the possible status codes are 0x40 , 0x48, or 0x38. for slave mode, the possible status codes are 0x68, 0x78, or 0xb0. for details, refer to table 819 . after a repeated start condition, i 2 c may switch to the master transmitter mode. fig 132. format in the master transmitter mode a = acknowledge (sda low) a = not acknowledge (sda high) s = start condition p = stop condition s slave address rw=0 a data a a/a p from master to slave from slave to master data n bytes data transmitted fig 133. format of master receiver mode data a = acknowledge (sda low) a = not acknowledge (sda high) s = start condition p = stop condition s slave address rw=1 a data p n bytes data received from master to slave from slave to master a a www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 867 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.8.3 slave receiver mode in the slave receiver mode, data bytes are received from a master transmitter. to initialize the slave receiver mode, write any of the sl ave address registers (adr0-3) and write the i 2 c control set register (conset) as shown in table 815 . i2en must be set to 1 to enable the i 2 c function. aa bit must be set to 1 to acknowledge its own slave address or the general call address. the sta, sto and si bits are set to 0. after adr and conset are initialized, the i 2 c interface waits until it is addressed by its own address or general address followed by the data direction bit. if the direction bit is 0 (w), it enters slave receiver mode. if the dire ction bit is 1 (r), it enters slave transmitter mode. after the address and direction bit have been received, the si bit is set and a valid status code can be read from the status register (stat). refer to table 822 for the status codes and actions. fig 134. a master receiver switches to master transmitter after sending repeated start a = acknowledge (sda low) a = not acknowledge (sda high) s = start condition p = stop condition sla = slave address sr = repeated start condition data n bytes data transmitted from master to slave from slave to master a data a a sla r sr w p s sla data a a table 815. conset used to configure slave mode bit 7 6 5 4 3 2 1 0 symbol - i2en sta sto si aa - - value- 10001- - fig 135. format of slave receiver mode a a = acknowledge (sda low) a = not acknowledge (sda high) s = start condition p = stop condition sr = repeated start condition a a/a n bytes data received from master to slave from slave to master s slave address rw=0 data p/sr data www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 868 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.8.4 slave transmitter mode the first byte is received and handled as in the slave receiver mode. however, in this mode, the direction bit will be 1, indicating a read operation. serial da ta is transmitted via sda while the serial clock is input through scl. start and stop conditions are recognized as the beginning and end of a se rial transfer. in a given application, i 2 c may operate as a master and as a slave. in the slave mode, the i 2 c hardware looks for its own slave address and the general call address. if one of these addres ses is detected, an interrupt is requested. when the microcontrollers wishes to become the bus master, the hardware waits until the bus is free before the master mode is entered so that a possible slave action is not interrupted. if bus arbi tration is lost in the master mode, the i 2 c interface switches to the slave mode immediat ely and can detect its own slave address in the same serial transfer. 37.9 i 2 c implementation and operation figure 137 shows how the on-chip i 2 c-bus interface is implemented, and the following text describes the individual blocks. fig 136. format of slave transmitter mode data a = acknowledge (sda low) a = not acknowledge (sda high) s = start condition p = stop condition a data n bytes data transmitted from master to slave from slave to master s slave address rw=1 a p a www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 869 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.9.1 input filters and output stages input signals are synchronized with the inter nal clock, and spikes shorter than three clocks are filtered out. the output for i 2 c is a special pad designed to conform to the i 2 c specification. fig 137. i 2 c serial interface block diagram ap b bus status register i2cnstat control register and scl duty cyle registers i2cnconset, i2cnconclr, i2cnsclh, i2cnscll address registers mask and compare shift register i2cndat ack bit counter/ arbitration and monitor mode register i2cnmmctrl sync logic serial clock generator timing and control logic status decoder status bus interrupt pclk input filter output stage scl input filter output stage sda i2cnaddr0 to i2cnaddr3 mask registers i2cnmask0 to i2cnmask3 i2cndatabuffer matchall i2cnmmctrl[3] 8 8 8 16 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 870 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.9.2 address registers, adr0 to adr3 these registers may be loaded with the 7-bit slave address (7 most significant bits) to which the i 2 c block will respond when programmed as a slave transmitter or receiver. the lsb (gc) is used to enable general call addre ss (0x00) recognition. when multiple slave addresses are enabled, the actual address receiv ed may be read from the dat register at the state where the own slave address has been received. 37.9.3 address mask regist ers, mask0 to mask3 the four mask registers each contain seven acti ve bits (7:1). any bit in these registers which is set to ?1? will cause an automati c compare on the corres ponding bit of the received address when it is compared to t he adrn register associated with that mask register. in other words, bits in an adrn register which are masked are not taken into account in determining an address match. when an address-match interrup t occurs, the processo r will have to read the data register (i2dat) to determine which received address actually caused the match. 37.9.4 comparator the comparator compares the received 7-bit slave address with its own slave address (7 most significant bits in adr). it also compares the first received 8-bit byte with the general call address (0x00). if an equality is found, the appropriate status bits are set and an interrupt is requested. 37.9.5 shift register, dat this 8-bit register contains a byte of serial data to be transmitted or a byte which has just been received. data in dat is always shifted from right to left; the first bit to be transmitted is the msb (bit 7) and, after a byte has been received, the first bit of received data is located at the msb of dat. while data is being shifted out, data on the bus is simultaneously being shifted in; dat always contains the last byte present on the bus. thus, in the event of lost arbitration, the transition from master transmitter to slave receiver is made with the correct data in dat. 37.9.6 arbitration and synchronization logic in the master transmitter mode, the arbitratio n logic checks that every transmitted logic 1 actually appears as a logic 1 on the i 2 c-bus. if another device on the bus overrules a logic 1 and pulls the sda line low, arbitration is lost, and the i 2 c block immediately changes from master transmitter to slave receiver. the i 2 c block will continue to output clock pulses (on scl) until transmission of the current serial byte is complete. arbitration may also be lost in the master re ceiver mode. loss of arbitration in this mode can only occur while the i 2 c block is returning a ?not acknowledge?: (logic 1) to the bus. arbitration is lost when another device on th e bus pulls this signal low. since this can occur only at the end of a serial byte, the i 2 c block generates no further clock pulses. figure 138 shows the arbitration procedure. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 871 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface the synchronization logic will sy nchronize the serial clock ge nerator with the clock pulses on the scl line from another device. if two or more master devices generate clock pulses, the ?mark? duration is determ ined by the device that generat es the shortest ?marks?, and the ?space? duration is determined by the device that generates the longest ?spaces?. figure 139 shows the synchronization procedure. a slave may stretch the space duration to slow down the bus master. the space duration may also be stretched for handshaking purposes. this can be done after each bit or after a complete byte transfer. the i 2 c block will stretch the scl sp ace duration after a byte has been transmitted or received and the acknowle dge bit has been transferred. the serial interrupt flag (si) is set, and the stretching continues until the serial interrupt flag is cleared. 37.9.7 serial clock generator this programmable clock pulse generator pr ovides the scl clock pulses when the i 2 c block is in the master transmitter or master re ceiver mode. it is switched off when the i 2 c block is in slave mode. the i 2 c output clock frequency and duty cycle is programmable (1) another device transmits serial data. (2) another device overrules a logic (dotted line) transmitted this i 2 c master by pulling the sda line low. arbitration is lost, and this i 2 c enters slave receiver mode. (3) this i 2 c is in slave receiver mode but still generates clock pulses until the current byte has been transmitted. this i 2 c will not generate clock pulses for the next byte. data on sda originates from the new master once it has won arbitration. fig 138. arbitration procedure (1) another device pulls the scl line low before this i 2 c has timed a complete high time. the other device effectively determines the (shorter) high period. (2) another device continues to pull the scl line low after this i 2 c has timed a complete low time and released scl. the i 2 c clock generator is forced to wait until scl goes high. the other device effectively determines the (longer) low period. (3) the scl line is released , and the cloc k generator begins timing the high time. fig 139. serial clock synchronization sda line scl line 12 34 8 9 ack (1) (2) (1) (3) sda line scl line (2) (1) (3) high period low period (1) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 872 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface via the i 2 c clock control registers. see the descri ption of the scll and sclh registers for details. the output clock pulses have a duty cycle as programmed unless the bus is synchronizing with other scl cl ock sources as described above. 37.9.8 timing and control the timing and control logic generates the timing and control signals for serial byte handling. this logic block provides the shift pulses for dat, enables the comparator, generates and detects start and stop condit ions, receives and transmits acknowledge bits, controls the master and slave modes, co ntains interrupt request logic, and monitors the i 2 c-bus status. 37.9.9 control register, conset and conclr the i 2 c control register contains bits used to control the following i 2 c block functions: start and restart of a serial transfer, termination of a serial transfer, bit rate, address recognition, and acknowledgment. the contents of the i 2 c control register may be read as conset. wr iting to conset will set bits in the i 2 c control register that correspond to ones in the value written. conversely, writing to conclr will clear bits in the i 2 c control register that correspond to ones in the value written. 37.9.10 status decoder and status register the status decoder takes all of the internal status bits and compresses them into a 5-bit code. this code is unique for each i 2 c-bus status. the 5-bit code may be used to generate vector addresses for fast processi ng of the various service routines. each service routine processes a particular bus status. there are 26 possible bus states if all four modes of the i 2 c block are used. the 5-bit status co de is latched into the five most significant bits of the status register when th e serial interrupt flag is set (by hardware) and remains stable until the interrupt flag is cleared by software. the three least significant bits of the status register are always zero. if the status code is used as a vector to service routines, then the routines are displaced by ei ght address locations. ei ght bytes of code is sufficient for most of the service routines (see the software example in this section). 37.10 details of i 2 c operating modes the four operating modes are: ? master transmitter ? master receiver ? slave receiver ? slave transmitter data transfers in each mode of operation are shown in figure 140 , figure 141 , figure 142 , figure 143 , and figure 144 . table 816 lists abbreviations used in these figures when describing the i 2 c operating modes. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 873 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface in figure 140 to figure 144 , circles are used to indicate w hen the serial interrupt flag is set. the numbers in the circles show the status code held in the stat register. at these points, a service routine must be executed to continue or complete the serial transfer. these service routines are not critical since th e serial transfer is suspended until the serial interrupt flag is cleared by software. when a serial interrupt routine is entered, the status code in stat is used to branch to the appropriate service routine. for each status co de, the required software action and details of the following serial transfer are given in tables from table 818 to table 824 . 37.10.1 master transmitter mode in the master transmitter mode, a number of da ta bytes are transmitted to a slave receiver (see figure 140 ). before the master transmitter mode can be entered, con must be initialized as follows: the i 2 c rate must also be configured in the sc ll and sclh registers. i2en must be set to logic 1 to enable the i 2 c block. if the aa bit is reset, the i 2 c block will not acknowledge its own slave address or the general call address in the event of another device becoming master of the bus. in other words, if aa is reset, the i 2 c interface cannot enter slave mode. sta, sto, and si must be reset. table 816. abbreviations used to describe an i 2 c operation abbreviation explanation s start condition sla 7-bit slave address r read bit (high level at sda) w write bit (low level at sda) a acknowledge bit (low level at sda) a not acknowledge bit (high level at sda) data 8-bit data byte p stop condition table 817. conset used to initialize master transmitter mode bit 7 6 5 4 3 2 1 0 symbol - i2en sta sto si aa - - value- 1000x- - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 874 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface the master transmitter mode may now be entered by setting the sta bit. the i 2 c logic will now test the i 2 c-bus and generate a start condition as soon as the bus becomes free. when a start condition is transmitted, the seri al interrupt flag (si) is set, and the status code in the status register (s tat) will be 0x08. this status code is used by the interrupt service routine to enter the appropriate state service routine that loads dat with the slave address and the data direction bit (sla+w). the si bit in con must then be reset before the serial transfer can continue. when the slave address and the direction bit have been transmitted and an acknowledgment bit has been received, the serial interrupt flag (si) is set again, and a number of status codes in stat are possible. there are 0x18, 0x20, or 0x38 for the master mode and also 0x68, 0x78, or 0xb0 if the slave mode was enabled (aa = logic 1). the appropriate action to be taken for eac h of these status codes is detailed in ta b l e 8 1 8 . after a repeated start condition (state 0x10). the i 2 c block may switch to the master receiver mode by loading dat with sla+r). www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 875 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface table 818. master transmitter mode status code (stat) status of the i 2 c-bus and hardware application software response next action taken by i 2 c hardware to/from dat to con sta sto si aa 0x08 a start condition has been transmitted. load sla+w; clear sta x 0 0 x sla+w will be transmitted; ack bit will be received. 0x10 a repeated start condition has been transmitted. load sla+w or x 0 0 x as above. load sla+r; clear sta x 0 0 x sla+r will be transmitted; the i 2 c block will be switched to mst/rec mode. 0x18 sla+w has been transmitted; ack has been received. load data byte or 0 0 0 x data byte will be transmitted; ack bit will be received. no dat action or 1 0 0 x repeated start will be transmitted. no dat action or 0 1 0 x stop condition will be transmitted; sto flag will be reset. no dat action 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset. 0x20 sla+w has been transmitted; not ack has been received. load data byte or 0 0 0 x data byte will be transmitted; ack bit will be received. no dat action or 1 0 0 x repeated start will be transmitted. no dat action or 0 1 0 x stop condition will be transmitted; sto flag will be reset. no dat action 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset. 0x28 data byte in dat has been transmitted; ack has been received. load data byte or 0 0 0 x data byte will be transmitted; ack bit will be received. no dat action or 1 0 0 x repeated start will be transmitted. no dat action or 0 1 0 x stop condition will be transmitted; sto flag will be reset. no dat action 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset. 0x30 data byte in dat has been transmitted; not ack has been received. load data byte or 0 0 0 x data byte will be transmitted; ack bit will be received. no dat action or 1 0 0 x repeated start will be transmitted. no dat action or 0 1 0 x stop condition will be transmitted; sto flag will be reset. no dat action 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset. 0x38 arbitration lost in sla+r/w or data bytes. no dat action or 0 0 0 x i 2 c-bus will be released; not addressed slave will be entered. no dat action 1 0 0 x a start condition will be transmitted when the bus becomes free. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 876 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface fig 140. format and states in the master transmitter mode data a r w sla s data a w sla to master receive mode, entry = mr mt to corresponding states in slave mode a or a a or a a other master continues other master continues a other master continues 20h 08h 18h 28h 30h 10h 68h 78h b0h 38h 38h arbitration lost in slave address or data byte not acknowledge received after a data byte not acknowledge received after the slave address next transfer started with a repeated start condition arbitration lost and addressed as slave successful transmission to a slave receiver from master to slave from slave to master any number of data bytes and their associated acknowledge bits n this number (contained in i2sta) corresponds to a defined state of the i 2 c bus a p p s p www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 877 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.10.2 master receiver mode in the master receiver mode, a number of dat a bytes are received from a slave transmitter (see figure 141 ). the transfer is initialized as in the master transm itter mode. when the start condition has been transmitted, the inte rrupt service routine must load dat with the 7-bit slave address and the data direction bit (sla+r). the si bit in con must then be cleared before the serial transfer can continue. when the slave address and the data direction bit have been transmitted and an acknowledgment bit has been received, the serial interrupt flag (si) is set again, and a number of status codes in stat are possible. these are 0x40, 0x48, or 0x38 for the master mode and also 0x68, 0x78, or 0xb0 if the slave mode was enabled (aa = 1). the appropriate action to be taken for each of these status codes is detailed in table 819 . after a repeated start condition (state 0x10), the i 2 c block may switch to the master transmitter mode by loading dat with sla+w. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 878 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface table 819. master receiver mode status code (stat) status of the i 2 c-bus and hardware application software response next action taken by i 2 c hardware to/from dat to con sta sto si aa 0x08 a start condition has been transmitted. load sla+r x 0 0 x sla+r will be transmitted; ack bit will be received. 0x10 a repeated start condition has been transmitted. load sla+r or x 0 0 x as above. load sla+w x 0 0 x sla+w will be transmitted; the i 2 c block will be switched to mst/trx mode. 0x38 arbitration lost in not ack bit. no dat action or 0 0 0 x i 2 c-bus will be released; the i 2 c block will enter slave mode. no dat action 1 0 0 x a start condition will be transmitted when the bus becomes free. 0x40 sla+r has been transmitted; ack has been received. no dat action or 0 0 0 0 data byte will be received; not ack bit will be returned. no dat action 0 0 0 1 data byte will be received; ack bit will be returned. 0x48 sla+r has been transmitted; not ack has been received. no dat action or 1 0 0 x repeated start condition will be transmitted. no dat action or 0 1 0 x stop condition will be transmitted; sto flag will be reset. no dat action 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset. 0x50 data byte has been received; ack has been returned. read data byte or 0 0 0 0 data byte will be received; not ack bit will be returned. read data byte 0 0 0 1 data byte will be received; ack bit will be returned. 0x58 data byte has been received; not ack has been returned. read data byte or 1 0 0 x repeated start condition will be transmitted. read data byte or 0 1 0 x stop condition will be transmitted; sto flag will be reset. read data byte 1 1 0 x stop condition followed by a start condition will be transmitted; sto flag will be reset. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 879 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface fig 141. format and states in the master receiver mode a to master transmit mode, entry = mt mr to corresponding states in slave mode a r sla s r sla s w a a or a a p other master continues other master continues a other master continues 48h 40h 58h 10h 68h 78h b0h 38h 38h arbitration lost in slave address or acknowledge bit not acknowledge received after the slave address next transfer started with a repeated start condition arbitration lost and addressed as slave successful transmission to a slave transmitter from master to slave from slave to master any number of data bytes and their associated acknowledge bits n this number (contained in i2sta) corresponds to a defined state of the i 2 c bus data a data 50h a data p 08h www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 880 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.10.3 slave receiver mode in the slave receiver mode, a number of data bytes are received from a master transmitter (see figure 142 ). to initiate the slave receiver mode, adr and con must be loaded as follows: the upper 7 bits are the address to which the i 2 c block will respond wh en addressed by a master. if the lsb (gc) is set, the i 2 c block will respond to the general call address (0x00); otherwise it ignores the general call address. the i 2 c-bus rate settings do not affect the i 2 c block in the slave mode. i2en must be set to logic 1 to enable the i 2 c block. the aa bit must be set to enable the i 2 c block to acknowledge its own slave address or the gene ral call address. sta, sto, and si must be reset. when adr and con have been initialized, the i 2 c block waits until it is addressed by its own slave address followed by the data dire ction bit which must be ?0? (w) for the i 2 c block to operate in the slave receiver mode. after its own slave address and the w bit have been received, the serial interrupt flag (s i) is set and a valid status code can be read from stat. this status code is used to vect or to a state service r outine. the appropriate action to be taken for each of these status codes is detailed in table 822 . the slave receiver mode may also be entered if arbitration is lost while the i 2 c block is in the master mode (see status 0x68 and 0x78). if the aa bit is reset during a transfer, the i 2 c block will return a not acknowledge (logic 1) to sda after the next received data byte. while aa is reset, the i 2 c block does not respond to its own slave address or a general call address. however, the i 2 c-bus is still monitored and address recognition may be resumed at any time by setting aa. this means that the aa bit may be us ed to temporarily isolate the i 2 c block from the i 2 c-bus. table 820. adr usage in slave receiver mode bit 7 6 5 4 3 2 1 0 symbol own slave 7-bit address gc table 821. conset used to initialize slave receiver mode bit 7 6 5 4 3 2 1 0 symbol - i2en sta sto si aa - - value- 10001- - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 881 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface table 822. slave receiver mode status code (stat) status of the i 2 c-bus and hardware application software response next action taken by i 2 c hardware to/from dat to con sta sto si aa 0x60 own sla+w has been received; ack has been returned. no dat action or x 0 0 0 data byte will be received and not ack will be returned. no dat action x 0 0 1 data byte will be received and ack will be returned. 0x68 arbitration lost in sla+r/w as master; own sla+w has been received, ack returned. no dat action or x 0 0 0 data byte will be received and not ack will be returned. no dat action x 0 0 1 data byte will be received and ack will be returned. 0x70 general call address (0x00) has been received; ack has been returned. no dat action or x 0 0 0 data byte will be received and not ack will be returned. no dat action x 0 0 1 data byte will be received and ack will be returned. 0x78 arbitration lost in sla+r/w as master; general call address has been received, ack has been returned. no dat action or x 0 0 0 data byte will be received and not ack will be returned. no dat action x 0 0 1 data byte will be received and ack will be returned. 0x80 previously addressed with own slv address; data has been received; ack has been returned. read data byte or x 0 0 0 data byte will be received and not ack will be returned. read data byte x 0 0 1 data byte will be received and ack will be returned. 0x88 previously addressed with own sla; data byte has been received; not ack has been returned. read data byte or 0 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. read data byte or 0 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if adr[0] = logic 1. read data byte or 1 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. a start condition will be transmitted when the bus becomes free. read data byte 1 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if adr[0] = logic 1. a start condition will be transmitted when the bus becomes free. 0x90 previously addressed with general call; data byte has been received; ack has been returned. read data byte or x 0 0 0 data byte will be received and not ack will be returned. read data byte x 0 0 1 data byte will be received and ack will be returned. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 882 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 0x98 previously addressed with general call; data byte has been received; not ack has been returned. read data byte or 0 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. read data byte or 0 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if adr[0] = logic 1. read data byte or 1 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. a start condition will be transmitted when the bus becomes free. read data byte 1 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if adr[0] = logic 1. a start condition will be transmitted when the bus becomes free. 0xa0 a stop condition or repeated start condition has been received while still addressed as slv/rec or slv/trx. no stdat action or 0 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. no stdat action or 0 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if adr[0] = logic 1. no stdat action or 1 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. a start condition will be transmitted when the bus becomes free. no stdat action 1 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if adr[0] = logic 1. a start condition will be transmitted when the bus becomes free. table 822. slave receiver mode ?continued status code (stat) status of the i 2 c-bus and hardware application software response next action taken by i 2 c hardware to/from dat to con sta sto si aa www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 883 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface fig 142. format and states in the slave receiver mode a a p or s a w sla s p or s a a 68h 60h 80h 88h reception of the general call address and one or more data bytes arbitration lost as master and addressed as slave last data byte received is not acknowledged arbitration lost as master and addressed as slave by general call reception of the own slave address and one or more data bytes all are acknowledged from master to slave from slave to master any number of data bytes and their associated acknowledge bits n this number (contained in i2sta) corresponds to a defined state of the i 2 c bus data a data 80h a0h last data byte is not acknowledged a p or s a 70h 90h data a data 90h a0h general call a 98h p or s a 78h data www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 884 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.10.4 slave transmitter mode in the slave transmitter mode, a number of dat a bytes are transmitted to a master receiver (see figure 143 ). data transfer is initialized as in the slave receiver mode. when adr and con have been initialized, the i 2 c block waits until it is addressed by its own slave address followed by the data direction bit which must be ?1? (r) for the i 2 c block to operate in the slave transmitter mode. after its own slave address and the r bit have been received, the serial interrupt flag (si) is set and a valid status code can be read from stat. this status code is used to vector to a stat e service routine, and the appropriate action to be taken for each of these status codes is detailed in table 823 . the slave transmitter mode may also be entered if arbitration is lost while the i 2 c block is in the master mode (see state 0xb0). if the aa bit is reset during a transfer, the i 2 c block will transmit the la st byte of the transfer and enter state 0xc0 or 0xc8. the i 2 c block is switched to the not addressed slave mode and will ignore the master receiver if it continues the tr ansfer. thus the master receiver receives all 1s as serial data. while aa is reset, the i 2 c block does not respond to its own slave address or a general call address. however, the i 2 c-bus is still m onitored, and address recognition may be resumed at any time by setting aa. this means that the aa bit may be used to temporarily isolate the i 2 c block from the i 2 c-bus. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 885 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface table 823. slave transmitter mode status code (stat) status of the i 2 c-bus and hardware application software response next action taken by i 2 c hardware to/from dat to con sta sto si aa 0xa8 own sla+r has been received; ack has been returned. load data byte or x 0 0 0 last data byte will be transmitted and ack bit will be received. load data byte x 0 0 1 data byte will be transmitted; ack will be received. 0xb0 arbitration lost in sla+r/w as master; own sla+r has been received, ack has been returned. load data byte or x 0 0 0 last data byte will be transmitted and ack bit will be received. load data byte x 0 0 1 data byte will be transmitted; ack bit will be received. 0xb8 data byte in dat has been transmitted; ack has been received. load data byte or x 0 0 0 last data byte will be transmitted and ack bit will be received. load data byte x 0 0 1 data byte will be transmitted; ack bit will be received. 0xc0 data byte in dat has been transmitted; not ack has been received. no dat action or 0 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. no dat action or 0 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if adr[0] = logic 1. no dat action or 1 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. a start condition will be transmitted when the bus becomes free. no dat action 1 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if adr[0] = logic 1. a start condition will be transmitted when the bus becomes free. 0xc8 last data byte in dat has been transmitted (aa = 0); ack has been received. no dat action or 0 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. no dat action or 0 0 0 1 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if adr[0] = logic 1. no dat action or 1 0 0 0 switched to not addressed slv mode; no recognition of own sla or general call address. a start condition will be transmitted when the bus becomes free. no dat action 1 0 0 01 switched to not addressed slv mode; own sla will be recognized; general call address will be recognized if adr.0 = logic 1. a start condition will be transmitted when the bus becomes free. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 886 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.10.5 miscellaneous states there are two stat codes that do not correspond to a defined i 2 c hardware state (see table 824 ). these are discussed below. 37.10.5.1 stat = 0xf8 this status code indicates that no relevant information is available because the serial interrupt flag, si, is not yet set. this occurs between other states and when the i 2 c block is not involved in a serial transfer. 37.10.5.2 stat = 0x00 this status code indicates that a bus error has occurred during an i 2 c serial transfer. a bus error is caused when a star t or stop conditio n occurs at an illegal position in the format frame. examples of su ch illegal positions are during the serial transfer of an address byte, a data byte, or an acknowledge bit. a bus error may also be caused when external interference disturbs the internal i 2 c block signals. when a bus error occurs, si is set. to recover from a bus error, the sto flag must be set and si must be cleared. this fig 143. format and states in the slave transmitter mode data a a r sla s p or s a a b0h a8h c0h c8h last data byte transmitted. switched to not addressed slave (aa bit in i2con = ?0?) arbitration lost as master and addressed as slave reception of the own slave address and one or more data bytes all are acknowledged from master to slave from slave to master any number of data bytes and their associated acknowledge bits n this number (contained in i2sta) corresponds to a defined state of the i 2 c bus a data b8h all ones a data p or s www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 887 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface causes the i 2 c block to enter the ?not addressed? slave mode (a defined state) and to clear the sto flag (no other bits in con are affected). the sda and scl lines are released (a stop condition is not transmitted). 37.10.6 some special cases the i 2 c hardware has facilities to handle the following special ca ses that may occur during a serial transfer: ? simultaneous repeated start conditions from two masters ? data transfer after loss of arbitration ? forced access to the i 2 c-bus ? i 2 c-bus obstructed by a low level on scl or sda ? bus error 37.10.6.1 simultaneous repeated start conditions from two masters a repeated start condition may be generated in the master transmitter or master receiver modes. a special case occurs if another master simultaneously generates a repeated start condition (see figure 144 ). until this occurs, arbitration is not lost by either master since they were both transmitting the same data. if the i 2 c hardware detects a repeated start condition on the i 2 c-bus before generating a repeated start condition itself, it will re lease the bus, and no interrupt r equest is generated. if another master frees the bu s by generating a stop condition, the i 2 c block will transmit a normal start co ndition (state 0x08), and a re try of the total serial data transfer can commence. table 824. miscellaneous states status code (stat) status of the i 2 c-bus and hardware application software response next action taken by i 2 c hardware to/from dat to con sta sto si aa 0xf8 no relevant state information available; si = 0. no dat action no con action wait or proceed current transfer. 0x00 bus error during mst or selected slave modes, due to an illegal start or stop condition. state 0x00 can also occur when interference causes the i 2 c block to enter an undefined state. no dat action 0 1 0 x only the internal hardware is affected in the mst or addressed slv modes. in all cases, the bus is released and the i 2 c block is switched to the not addressed slv mode. sto is reset. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 888 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.10.6.2 data transfer after loss of arbitration arbitration may be lost in the master tr ansmitter and master receiver modes (see figure 138 ). loss of arbitration is indicated by the following states in stat; 0x38, 0x68, 0x78, and 0xb0 (see figure 140 and figure 141 ). if the sta flag in con is set by the routines which service these states, then, if the bus is free again, a start condition (state 0x08) is transmitted without intervention by the cpu, and a retry of the total serial transfer can commence. 37.10.6.3 forced access to the i 2 c-bus in some applications, it may be possible for an uncontrolled source to cause a bus hang-up. in such situations, the problem may be caused by interference, temporary interruption of the bus or a temporary short-circuit between sda and scl. if an uncontrolled source generates a superfluous start or masks a stop condition, then the i 2 c-bus stays busy indefinitely. if the sta flag is set and bus access is not obtained within a reasonable amount of time, then a forced access to the i 2 c-bus is possible. this is achieved by setting the sto flag while the st a flag is still set. no stop condition is transmitted. the i 2 c hardware behaves as if a stop condition was received and is able to transmit a start condition. the sto flag is cleared by hardware (see figure 145 ). fig 144. simultaneous repeated start conditions from two masters sla a w sla s 18h 08h a data 28h 08h other master continues other master sends repeated start earlier s retry s p fig 145. forced access to a busy i 2 c-bus sda line scl line sta flag sto flag time limit start condition www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 889 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.10.6.4 i 2 c-bus obstructed by a low level on scl or sda an i 2 c-bus hang-up can occur if either the sda or scl line is held low by any device on the bus. if the scl line is obstructed (pulled lo w) by a device on the bus, no further serial transfer is possible, and the problem must be resolved by t he device that is pulling the scl bus line low. typically, the sda line may be obstructed by another device on the bus that has become out of synchronization with the current bus master by either mi ssing a clock, or by sensing a noise pulse as a clock. in this case, the problem can be solved by transmitting additional clock pulses on the scl line (see figure 146 ). the i 2 c interface does not include a dedicated time-out timer to detect an obstructed bus, but this can be implemented using another timer in the system. when detected, software can force clocks (up to 9 may be required) on scl until sda is released by the offending device. at that point, the slave may still be out of synchronizat ion, so a start should be gen erated to insure that all i 2 c peripherals are synchronized. 37.10.6.5 bus error a bus error occurs when a start or stop cond ition is detected at an illegal position in the format frame. examples of illegal positions are during the serial transfer of an address byte, a data bit, or an acknowledge bit. the i 2 c hardware only reacts to a bus error when it is involved in a serial transfer either as a master or an addressed slave. when a bus error is detected, the i 2 c block immediately switches to the not addressed slave mode, releases the sda and scl lines, sets the interrupt flag, and loads the status register with 0x00. this status code may be used to vector to a state service routin e which either attempts the aborted serial transfer again or simply recovers from the error condition as shown in table 824 . 37.10.7 i 2 c state service routines this section provides examples of operations that must be performed by various i 2 c state service routines. this includes: ? initialization of the i 2 c block after a reset. ? i 2 c interrupt service ? the 26 state service routines providing support for all four i 2 c operating modes. (1) unsuccessful attempt to send a start condition. (2) sda line is released. (3) successful attempt to send a start condition. state 08h is entered. fig 146. recovering from a bus obstruction caused by a low level on sda sda line scl line (1) (2) (1) (3) sta flag start condition www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 890 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.10.8 initialization in the initialization example, the i 2 c block is enabled for both master and slave modes. for each mode, a buffer is used for transmissi on and reception. the initialization routine performs the following functions: ? i2adr is loaded with the part?s own sl ave address and the general call bit (gc) ? the i 2 c interrupt enable and interrupt priority bits are set ? the slave mode is enabled by simultaneously setting the i2en and aa bits in con and the serial clock frequency (for master modes) is defined by is defined by loading the sclh and scll registers . the master routines must be started in the main program. the i 2 c hardware now begins checking the i 2 c-bus for its own slave address and general call. if the general call or the own slave add ress is detected, an interrupt is requested and stat is loaded with the appropriate state information. 37.10.9 i 2 c interrupt service when the i 2 c interrupt is entered, stat contains a status code which identifies one of the 26 state services to be executed. 37.10.10 the state service routines each state routine is part of the i 2 c interrupt routine and handles one of the 26 states. 37.10.11 adapting state servi ces to an application the state service examples show the typical actions that must be performed in response to the 26 i 2 c state codes. if one or more of the four i 2 c operating modes are not used, the associated state services can be omitted, as long as care is taken that the those states can never occur. in an application, it may be desirable to implement some kind of time-out during i 2 c operations, in order to trap an inoper ative bus or a lost service routine. 37.11 software example 37.11.1 initialization routine example to initialize i 2 c interface as a slave and/or master. 1. load adr with own slave address, enable general call recognition if needed. 2. enable i 2 c interrupt. 3. write 0x44 to conset to set the i2en and aa bits, enabling slave functions. for master only functions, write 0x40 to conset. 37.11.2 start master transmit function begin a master transmit operation by settin g up the buffer, pointer, and data count, then initiating a start. 1. initialize master data counter. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 891 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 2. set up the slave address to which data will be transmitted, and add the write bit. 3. write 0x20 to conset to set the sta bit. 4. set up data to be transmitted in master transmit buffer. 5. initialize the master data counter to match the length of the message being sent. 6. exit 37.11.3 start master receive function begin a master receive operation by setting up the buffer, pointer, and data count, then initiating a start. 1. initialize master data counter. 2. set up the slave address to which data will be transmitted, and add the read bit. 3. write 0x20 to conset to set the sta bit. 4. set up the master receive buffer. 5. initialize the master data counter to match the length of the message to be received. 6. exit 37.11.4 i 2 c interrupt routine determine the i 2 c state and which state routin e will be used to handle it. 1. read the i 2 c status from sta. 2. use the status value to branch to one of 26 possible state routines. 37.11.5 non mode specific states 37.11.5.1 state: 0x00 bus error. enter not addressed slave mode and release bus. 1. write 0x14 to conset to set the sto and aa bits. 2. write 0x08 to conclr to clear the si flag. 3. exit 37.11.5.2 master states state 08 and state 10 are for both master transmit and master receive modes. the r/w bit decides whether the next state is within master transmit mode or master receive mode. 37.11.5.3 state: 0x08 a start condition has been transmitted. the slave ad dress + r/w bit will be transmitted, an ack bit will be received. 1. write slave address with r/w bit to dat. 2. write 0x04 to con set to set the aa bit. 3. write 0x08 to conclr to clear the si flag. 4. set up master transmit mode data buffer. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 892 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 5. set up master receive mode data buffer. 6. initialize master data counter. 7. exit 37.11.5.4 state: 0x10 a repeated start condition ha s been transmitted. the slav e address + r/w bit will be transmitted, an ack bit will be received. 1. write slave address with r/w bit to dat. 2. write 0x04 to con set to set the aa bit. 3. write 0x08 to conclr to clear the si flag. 4. set up master transmit mode data buffer. 5. set up master receive mode data buffer. 6. initialize master data counter. 7. exit 37.11.6 master transmitter states 37.11.6.1 state: 0x18 previous state was state 8 or state 10, sl ave address + write has been transmitted, ack has been received. the first data byte will be transmitted, an ac k bit will be received. 1. load dat with first data byte from master transmit buffer. 2. write 0x04 to con set to set the aa bit. 3. write 0x08 to conclr to clear the si flag. 4. increment master transmit buffer pointer. 5. exit 37.11.6.2 state: 0x20 slave address + write has been transmitted, not ack has been received. a stop condition will be transmitted. 1. write 0x14 to conset to set the sto and aa bits. 2. write 0x08 to conclr to clear the si flag. 3. exit 37.11.6.3 state: 0x28 data has been transmitted, ack has been received. if the transmitted data was the last data byte then transmit a stop condition, otherwise transmit the next data byte. 1. decrement the master data counter, skip to step 5 if not the last data byte. 2. write 0x14 to conset to set the sto and aa bits. 3. write 0x08 to conclr to clear the si flag. 4. exit 5. load dat with next data byte from master transmit buffer. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 893 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 6. write 0x04 to con set to set the aa bit. 7. write 0x08 to conclr to clear the si flag. 8. increment master transmit buffer pointer 9. exit 37.11.6.4 state: 0x30 data has been transmitted, not ack receiv ed. a stop condition will be transmitted. 1. write 0x14 to conset to set the sto and aa bits. 2. write 0x08 to conclr to clear the si flag. 3. exit 37.11.6.5 state: 0x38 arbitration has been lost during slave address + write or data. the bus has been released and not addr essed slave mode is entered. a new start condition will be transmitted when the bus is free again. 1. write 0x24 to conset to set the sta and aa bits. 2. write 0x08 to conclr to clear the si flag. 3. exit 37.11.7 master receive states 37.11.7.1 state: 0x40 previous state was state 08 or state 10. slave address + read has been transmitted, ack has been received. data will be received an d ack returned. 1. write 0x04 to con set to set the aa bit. 2. write 0x08 to conclr to clear the si flag. 3. exit 37.11.7.2 state: 0x48 slave address + read has been transmitted, not ack has been received. a stop condition will be transmitted. 1. write 0x14 to conset to set the sto and aa bits. 2. write 0x08 to conclr to clear the si flag. 3. exit 37.11.7.3 state: 0x50 data has been received, ack ha s been returned. data will be read from dat. additional data will be received. if this is the last data byte then not ack will be returned, otherwise ack will be returned. 1. read data byte from dat into master receive buffer. 2. decrement the master data counter, skip to step 5 if not the last data byte. 3. write 0x0c to conclr to cl ear the si flag and the aa bit. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 894 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 4. exit 5. write 0x04 to con set to set the aa bit. 6. write 0x08 to conclr to clear the si flag. 7. increment master receive buffer pointer 8. exit 37.11.7.4 state: 0x58 data has been received, not ac k has been returned. data will be read from dat. a stop condition will be transmitted. 1. read data byte from dat into master receive buffer. 2. write 0x14 to conset to set the sto and aa bits. 3. write 0x08 to conclr to clear the si flag. 4. exit 37.11.8 slave receiver states 37.11.8.1 state: 0x60 own slave address + write has been received, ack has been returned. data will be received and ack returned. 1. write 0x04 to con set to set the aa bit. 2. write 0x08 to conclr to clear the si flag. 3. set up slave receive mode data buffer. 4. initialize slave data counter. 5. exit 37.11.8.2 state: 0x68 arbitration has been lost in slave address and r/w bit as bus master. own slave address + write has been received, ac k has been return ed. data will be rece ived and ack will be returned. sta is set to restart master mode after the bus is free again. 1. write 0x24 to conset to set the sta and aa bits. 2. write 0x08 to conclr to clear the si flag. 3. set up slave receive mode data buffer. 4. initialize slave data counter. 5. exit. 37.11.8.3 state: 0x70 general call has been receiv ed, ack has been returned. da ta will be received and ack returned. 1. write 0x04 to con set to set the aa bit. 2. write 0x08 to conclr to clear the si flag. 3. set up slave receive mode data buffer. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 895 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 4. initialize slave data counter. 5. exit 37.11.8.4 state: 0x78 arbitration has been lost in slave address + r/w bit as bus master. general call has been received and ack has been returned. data will be received and ack returned. sta is set to restart master mode af ter the bus is free again. 1. write 0x24 to conset to set the sta and aa bits. 2. write 0x08 to conclr to clear the si flag. 3. set up slave receive mode data buffer. 4. initialize slave data counter. 5. exit 37.11.8.5 state: 0x80 previously addressed with own slave addr ess. data has been received and ack has been returned. addition al data will be read. 1. read data byte from dat into the slave receive buffer. 2. decrement the slave data counter, skip to step 5 if not the last data byte. 3. write 0x0c to conclr to cl ear the si flag and the aa bit. 4. exit. 5. write 0x04 to con set to set the aa bit. 6. write 0x08 to conclr to clear the si flag. 7. increment slave receive buffer pointer. 8. exit 37.11.8.6 state: 0x88 previously addressed with own slave addr ess. data has been received and not ack has been returned. received data will not be saved. not addressed slave mode is entered. 1. write 0x04 to con set to set the aa bit. 2. write 0x08 to conclr to clear the si flag. 3. exit 37.11.8.7 state: 0x90 previously addressed with gener al call. data has been received, ack has been returned. received data will be saved. on ly the first data byte will be received with ack. additional data will be received with not ack. 1. read data byte from dat into the slave receive buffer. 2. write 0x0c to conclr to cl ear the si flag and the aa bit. 3. exit www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 896 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 37.11.8.8 state: 0x98 previously addressed with general call. data has been received, not ack has been returned. received data will not be saved. no t addressed slave mode is entered. 1. write 0x04 to con set to set the aa bit. 2. write 0x08 to conclr to clear the si flag. 3. exit 37.11.8.9 state: 0xa0 a stop condition or repeated start has been received, while still addressed as a slave. data will not be saved. not addressed slave mo de is entered. 1. write 0x04 to con set to set the aa bit. 2. write 0x08 to conclr to clear the si flag. 3. exit 37.11.9 slave tran smitter states 37.11.9.1 state: 0xa8 own slave address + read ha s been received, ack has been return ed. data will be transmitted, ack bi t will be received. 1. load dat from slave transmit buffer with first data byte. 2. write 0x04 to con set to set the aa bit. 3. write 0x08 to conclr to clear the si flag. 4. set up slave transmit mode data buffer. 5. increment slave transmit buffer pointer. 6. exit 37.11.9.2 state: 0xb0 arbitration lost in slave address and r/w bit as bus master. own slave address + read has been received, ack has been returned. data will be transmitted, ack bit will be received. sta is set to restart master mode after the bus is free again. 1. load dat from slave transmit buffer with first data byte. 2. write 0x24 to conset to set the sta and aa bits. 3. write 0x08 to conclr to clear the si flag. 4. set up slave transmit mode data buffer. 5. increment slave transmit buffer pointer. 6. exit 37.11.9.3 state: 0xb8 data has been transmitted, ac k has been received. data will be transmitted, ack bit will be received. 1. load dat from slave transmit buffer with data byte. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 897 of 1164 nxp semiconductors UM10430 chapter 37: lpc18xx i2c-bus interface 2. write 0x04 to con set to set the aa bit. 3. write 0x08 to conclr to clear the si flag. 4. increment slave transmit buffer pointer. 5. exit 37.11.9.4 state: 0xc0 data has been transmitted, not ack has bee n received. not addre ssed slave mode is entered. 1. write 0x04 to con set to set the aa bit. 2. write 0x08 to conclr to clear the si flag. 3. exit. 37.11.9.5 state: 0xc8 the last data byte has been transmitted, ack has been received. not addressed slave mode is entered. 1. write 0x04 to con set to set the aa bit. 2. write 0x08 to conclr to clear the si flag. 3. exit www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 898 of 1164 38.1 how to read this chapter the adc0 and adc1 are available on all lpc18xx parts. the following configuration options apply to parts lpc1850_30_20_10 rev ?a? only: ? the adc start inputs are configured through the gima (see section 14.3 ). ? the adc0 and adc1 functions are multiplexed with digital functions and need to be configured using the enaio0/1 registers (see section 13.4.3 and section 13.4.5 . 38.2 basic configuration the adc0 and adc1 are configured as follows: ? see ta b l e 8 2 5 for clocking and power control. ? the adc0 is reset by th e adc0_rst (reset # 40). ? the adc1 is reset by th e adc1_rst (reset # 41). ? the adc0 interrupt is connected to interrupt slot # 17 in the nvic. ? the adc1 interrupt is connected to interrupt slot # 21 in the nvic. ? for connecting to the gpdma, use the dmamux register ( table 35 ) in the creg block and enable the gpdma channel in t he dma channel configuration registers section 16.6.20 . ? external pins (adctrig0/1), the motocon pwm mcoa2 output, and two sct outputs can be selected as conversion triggers for adc0/1 (see figure 25 ). ? the adc start inputs are configured through the gima (see section 14.3 ). ? the adc0 and adc1 functions are multiplexed with digital functions and need to be configured using the enaio0/1 registers (see section 13.4.3 and section 13.4.5 . 38.3 features ? 10 bit successive approximation analog to digital converter. UM10430 chapter 38: lpc18xx 10-bit adc0/1 rev. 00.13 ? 20 july 2011 user manual table 825. adc0/1 clocki ng and power control base clock branch clock maximum frequency notes adc0 clock base_apb3_clk clk_apb3_adc0 150 mhz for register interface and adc0 conversion rate. adc1 clock base_apb3_clk clk_apb3_adc1 150 mhz for register interface and adc1 conversion rate. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 899 of 1164 nxp semiconductors UM10430 chapter 38: lpc18xx 10-bit adc0/1 ? input multiplexing among 8 pins. ? power-down mode. ? measurement range 0 to 3.3 v. ? 10 bit conversion time ? 2.44 ? s. ? burst conversion mode for single or multiple inputs. ? optional conversion on transition on input pin or timer match signal. ? individual result registers for each a/d channel to reduce interrupt overhead. 38.4 general description basic clocking for the a/d converters is provided by the apb clocks (clk_apb3_adc0/1). a programmable divider is included in each converter to scale this clock to the 4.5 mhz (max) clock needed by th e successive approximation process. a fully accurate conversion requires 11 of these clocks. 38.5 pin description table 826 gives a brief summary of each of adc related pins. 38.6 register description the register addresses for the adc0 are shown in ta b l e 8 2 7 table 826. adc pin description pin type description adc[7:0] input analog inputs. the a/d converter cell can measure the voltage on any of these input signals. the inputs are shared between adc0 and adc1. remark: the adc0 pin is shared with the dac0 pin. adctrig0 input trigger inputs to the adc0/1. adctrig1 input trigger inputs to the adc0/1. vdda power analog power. also voltage reference vref for both adcs. vssa ground analog ground. table 827. register overview: adc0 (base address 0x400e 3000) name access address offset description reset value [1] cr r/w 0x000 a/d control register. the ad0cr register must be written to select the operating mode before a/d conversion can occur. 0x0000 0000 gdr r0 0x004 a/d global data register. contains the result of the most recent a/d conversion. - - - 0x008 reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 900 of 1164 nxp semiconductors UM10430 chapter 38: lpc18xx 10-bit adc0/1 [1] reset value reflects the data stored in used bi ts only. it does not include reserved bits content. inten r/w 0x00c a/d interrupt enable register. this register contains enable bits that allow the done flag of each a/d channel to be included or excluded from contributing to the generation of an a/d interrupt. 0x0000 0100 dr0 ro 0x010 a/d channel 0 data register. this register contains the result of the most recent conversion completed on channel 0 - dr1 ro 0x014 a/d channel 1 data register. this register contains the result of the most recent conversion completed on channel 1. - dr2 ro 0x018 a/d channel 2 data register. this register contains the result of the most recent conversion completed on channel 2. - dr3 ro 0x01c a/d channel 3 data register. this register contains the result of the most recent conversion completed on channel 3. - dr4 ro 0x020 a/d channel 4 data register. this register contains the result of the most recent conversion completed on channel 4. - dr5 ro 0x024 a/d channel 5 data register. this register contains the result of the most recent conversion completed on channel 5. - dr6 ro 0x028 a/d channel 6 data register. this register contains the result of the most recent conversion completed on channel 6. - dr7 ro 0x02c a/d channel 7 data register. this register contains the result of the most recent conversion completed on channel 7. - stat ro 0x030 a/d status register. this register contains done and overrun flags for all of the a/d channels, as well as the a/d interrupt flag. 0 table 828. register overview: adc1 (base address 0x400e 4000) name access address offset description reset value [1] cr r/w 0x000 a/d control register. the ad1cr register must be written to select the operating mode before a/d conversion can occur. 0x0000 0000 gdr r0 0x004 a/d global data register. contains the result of the most recent a/d conversion. - - - 0x008 reserved. - inten r/w 0x00c a/d interrupt enable register. this register contains enable bits that allow the done flag of each a/d channel to be included or excluded from contributing to the generation of an a/d interrupt. 0x0000 0100 table 827. register overview: adc0 (base address 0x400e 3000) name access address offset description reset value [1] www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 901 of 1164 nxp semiconductors UM10430 chapter 38: lpc18xx 10-bit adc0/1 [1] reset value reflects the data stored in used bi ts only. it does not include reserved bits content. 38.6.1 a/d control register the a/d control register provides bits to sele ct a/d channels to be converted, a/d timing, a/d modes, and the a/d start trigger. dr0 ro 0x010 a/d channel 0 data register. this register contains the result of the most recent conversion completed on channel 0 - dr1 ro 0x014 a/d channel 1 data register. this register contains the result of the most recent conversion completed on channel 1. - dr2 ro 0x018 a/d channel 2 data register. this register contains the result of the most recent conversion completed on channel 2. - dr3 ro 0x01c a/d channel 3 data register. this register contains the result of the most recent conversion completed on channel 3. - dr4 ro 0x020 a/d channel 4 data register. this register contains the result of the most recent conversion completed on channel 4. - dr5 ro 0x024 a/d channel 5 data register. this register contains the result of the most recent conversion completed on channel 5. - dr6 ro 0x028 a/d channel 6 data register. this register contains the result of the most recent conversion completed on channel 6. - dr7 ro 0x02c a/d channel 7 data register. this register contains the result of the most recent conversion completed on channel 7. - stat ro 0x030 a/d status register. this register contains done and overrun flags for all of the a/d channels, as well as the a/d interrupt flag. 0 table 828. register overview: adc1 (base address 0x400e 4000) name access address offset description reset value [1] table 829. a/d control register (cr - address 0x400e 3000 (adc0) and 0x400e 4000 (adc1)) bit description bit symbol value description reset value 7:0 sel selects which of the adc[7:0] pins are to be sampled and converted. bit 0 selects pin adc0, bit 1 selects pin ad1,..., and bit 7 selects pin adc7. in software-controlled mode, only one of these bits should be 1. in hardware scan mode, any value containing 1 to 8 ones. all zeroes is equivalent to 0x01. 0 15:8 clkdiv the adc clock is divided by the clkdiv value plus one to produce the clock for the a/d converter, which should be less than or equal to 4.5 mhz. typically, software should program the smallest value in this field that yields a clock of 4.5 mhz or slightly less, but in certain cases (such as a high-impedance analog source) a slower clo ck may be desirable. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 902 of 1164 nxp semiconductors UM10430 chapter 38: lpc18xx 10-bit adc0/1 16 burst burst mode 0 0 conversions are software cont rolled and require 11 clocks. 1 the ad converter does repeated conversions at the rate selected by the clks field, scanning (if necessary) through the pins selected by 1s in the sel field. the first conversion after the start corresponds to the least-significant 1 in the sel field, then higher numbered 1 bits (pins) if applicable. repeated conversions can be terminated by clearing this bit, but the conversion that?s in progress when this bit is cleared will be completed. important: start bits must be 000 when burst = 1 or conversions will not start. 19:17 clks this field selects the number of clocks used for each conversion in burst mode, and the number of bits of accuracy of the result in the ls bits of addr, between 11 clocks (10 bits) and 4 clocks (3 bits). 000 0x0 11 clocks / 10 bits 0x1 10 clocks / 9 bits 0x2 9 clocks / 8 bits 0x3 8 clocks / 7 bits 0x4 7 clocks / 6 bits 0x5 6 clocks / 5 bits 0x6 5 clocks / 4 bits 0x7 4 clocks / 3 bits 20 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 21 pdn power mode 0 0 the a/d converter is in power-down mode. 1 the a/d converter is operational. 23:22 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 26:24 start when the burst bit is 0, these bits control whether and when an a/d conversion is started: 0 0x0 no start (this value should be used when clearing pdn to 0). 0x1 start conversion now. 0x2 start conversion when the edge selected by bit 27 occurs on ctout_15 (combined timer output 15, adc start0). 0x3 start conversion when the edge selected by bit 27 occurs on ctout_8 (combined timer output 8, adc start1). 0x4 start conversion when the edge selected by bit 27 occurs on adctrig0 input (adc start3). 0x5 start conversion when the edge selected by bit 27 occurs on adctrig1 input (adc start4). 0x6 start conversion when the edge selected by bit 27 occurs on motocon pwm output mcoa2 (adc start5). 0x7 reserved. table 829. a/d control register (cr - address 0x400e 3000 (adc0) and 0x400e 4000 (adc1)) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 903 of 1164 nxp semiconductors UM10430 chapter 38: lpc18xx 10-bit adc0/1 38.6.2 a/d global data register the a/d global data register contains the resu lt of the most recent a/d conversion. this includes the data, done, and overrun flags, and the number of the a/d channel to which the data relates. 38.6.3 a/d interrupt enable register this register allows contro l over which a/d channels generate an interrupt when a conversion is complete. for example, it may be desirable to use some a/d channels to monitor sensors by continuously performi ng conversions on them. the most recent results are read by the application program whenever they are needed. in this case, an interrupt is not desirable at the end of each conversion for some a/d channels. 27 edge this bit is significant only when the start field contains 0x2 -0x6. in these cases: 0 0 start conversion on a rising edge on the selected signal. 1 start conversion on a falling edge on the selected signal. 31:28 - - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 829. a/d control register (cr - address 0x400e 3000 (adc0) and 0x400e 4000 (adc1)) bit description bit symbol value description reset value table 830. a/d global data register (gdr - address 0x400e 3004 (adc0) and 0x400e 4004 (adc1)) bit description bit symbol description reset value 5:0 - reserved. these bits always read as zeroes. 0 15:6 v_vref when done is 1, this field contains a binary fraction representing the voltage on the adcn pin selected by the sel field, divided by the reference voltage on the vdda pin. zero in the field indicates that the voltage on the adcn input pin was less than, equal to, or close to that on vssa, while 0x3f f indicates that the voltage on adcn input pin was close to, equal to, or greater than that on vdda. - 23:16 - reserved. these bits always read as zeroes. 0 26:24 chn these bits contain the channel from which the ls bits were converted. - 29:27 - reserved. these bits always read as zeroes. 0 30 overrun this bit is 1 in burst mode if the results of one or more conversions was (were) lost and overwritten before the conversion that produced the result in the v_vref bits. 0 31 done this bit is set to 1 when an analog-to-digital conversion completes. it is cleared when this register is read and when the ad0/1cr register is written. if the ad0/1cr is written while a conversion is still in progress, this bit is set and a new conversion is started. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 904 of 1164 nxp semiconductors UM10430 chapter 38: lpc18xx 10-bit adc0/1 38.6.4 a/d data registers the a/d data register hold the result when an a/d conversion is complete, and also include the flags that indicate when a conversion has been completed and when a conversion overrun has occurred. 38.6.5 a/d status register the a/d status register allows checking the status of all a/d channels simultaneously. the done and overrun flags appearing in the ad0/1drn register for each a/d channel n are mirrored in adstat. the interrupt flag (the logical or of all done flags) is also found in adstat. table 831. a/d interrupt enable register (inten - address 0x400e 300c (adc0) and 0x400e 400c (adc1)) bit description bit symbol description reset value 7:0 adinten these bits allow control over which a/d channels generate interrupts for conversion completion. when bit 0 is one, completion of a conversion on a/d channel 0 will generate an interrupt, when bit 1 is one, completion of a conversion on a/d channel 1 will generate an interrupt, etc. 0x00 8 adginten when 1, enables the global done flag in addr to generate an interrupt. when 0, only the individual a/d channels enabled by adinten 7:0 will generate interrupts. 1 31:9 - reserved. always 0. 0 table 832. a/d data registers (dr - addresses 0x400e 3010 (dr0) to 0x400e 302c (dr7) (adc0); 0x400e 4010 (dr0) to 0x400e 402 c (dr7) (adc1)) bit description bit symbol description reset value 5:0 - reserved. always 0. 0 15:6 v_vref when done is 1, this field cont ains a binary fraction representing the voltage on the adcn input pin selected in table 829 , divided by the voltage on the vdda pin. zero in the field indicates that the voltage on the adcn input pin was less than, equal to, or close to that on vdda, while 0x3ff indicates that the voltage on adcn input pin was close to, equal to, or greater than that on vdda. - 29:16 - reserved. always 0. 0 30 overrun this bit is 1 in burst mode if the results of one or more conversions was (were) lost and overwritten before the conversion that produced the result in the v_vref bits in this register.this bit is cleared by reading this register. 0 31 done this bit is set to 1 when an a/d conversion completes. it is cleared when this register is read. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 905 of 1164 nxp semiconductors UM10430 chapter 38: lpc18xx 10-bit adc0/1 38.7 operation 38.7.1 hardware-triggered conversion if the burst bit in the adcr is 0 and the start field contains any value between 0x2 and 0x6, the a/d converter will start a conversion when a transi tion occurs on a selected pin or timer signal. the choices include the two adctrig external input pins, an output from the motocon pwm, and two combined timer outputs (see section 38.6.1 ). 38.7.2 interrupts an interrupt is requested to the vectored interrupt controller (vic) when the adint bit in the adstat register is 1. the adint bit is one when any of the done bits of a/d channels that are enabled for interrupts (via the adinten register) are one. software can use the interrupt enable bit in the vic that corresponds to th e adc to control whether this results in an interrupt. the result register for an a/d channel that is generating an interrupt must be read in order to clear the corresponding done flag. 38.7.3 dma control a dma transfer request is generated from t he adc interrupt request line. to generate a dma transfer the same conditions must be met as the conditions for generating an interrupt. a pending dma request is cleared after the dma has read from the requesting channel?s a/d data register (dr[7:0]). readin g from the global data register (gdr) does not clear any pending dma requests. for dma transfers, only burst requests are suppo rted. the burst size can be set to one in the dma channel control register (see table 214 ). if the number of adc channels is not equal to one of the other dma-supported burst sizes (applicable dma burst sizes are 1, 4, 8), set the burst size to one. the dma transfer size determines when a dma interrupt is generated. the transfer size can be set to the number of adc channels being converted (see section 16.6.19 ). non-contiguous channels can be transferred by the dma using the scatter/gather linked lists (see section 16.8.5 ). table 833. a/d status register (stat - address 0x400e 3030 (adc0) and 0x400e 4030 (adc1)) bit description bit symbol description reset value 7:0 done these bits mirror the done status flags that appear in the result register for each a/d channel. 0 15:8 overun these bits mirror the over rrun status flags that appear in the result register for each a/d channel. reading adstat allows checking the status of all a/d channels simultaneously. 0 16 adint this bit is the a/d interrupt flag. it is one when any of the individual a/d channel done flags is asserted and enabled to contribute to the a/d interrupt via the adinten register. 0 31:17 - reserved. always 0. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 906 of 1164 39.1 how to read this chapter the dac is available on all lpc18xx parts. 39.2 basic configuration the dac is configured as follows: ? see ta b l e 8 3 4 for clocking and power control. ? the dac is reset by the dac_rst (reset # 42). ? the dac interrupt is connected to interrupt slot # 0 in the nvic. ? for connecting to the gpdma, use the dmamux register ( table 35 ) in the creg block and enable the gpdma channel in t he dma channel configuration registers section 16.6.20 . 39.3 features ? 10-bit resolution ? monotonic by design (resistor string architecture) ? controllable conversion speed ? low power consumption 39.4 pin description table 835 gives a brief summary of each of dac related pins. UM10430 chapter 39: lpc18xx dac rev. 00.13 ? 20 july 2011 user manual table 834. dac clocking and power control base clock branch clock maximum frequency notes clock to the dac register interface and rate clock for the dma counter. base_apb3_clk clk_apb3_dac 150 mhz - table 835. dac pin description pin type description adc0 output analog output. after the selected settling time after the dacr is written with a new value, the voltage on this pin (with respect to v ssa ) is value/1024 ? vref. the dacout pin is shared with the channel 0 input pin of adc0 and adc1. vdda power analog power and voltage reference. this pin provides a voltage reference level for the d/a converter. vssa - ground. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 907 of 1164 nxp semiconductors UM10430 chapter 39: lpc18xx dac 39.5 register description 39.5.1 d/a converter register this read/write register includes the digital value to be converted to an analog output value and a bit that trades off performance vs. power. 39.5.2 d/a converter control register this read/write register enables the dm a operation and controls the dma timer. table 836. register overview: dac (base address 0x400e 1000) name access address offset description reset value cr r/w 0x000 dac register. holds the conversion data. 0 ctrl r/w 0x004 dac control register. 0 cntval r/w 0x008 dac counter value register. 0 table 837: d/a converter register (cr - address 0x400e 1000) bit description bit symbol value description reset value 5:0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 15:6 value after the selected settling time after this field is written with a new value, the voltage on the dacout pin (with respect to v ssa ) is value/1024 ? vdda. 0 16 bias settling time 0 0 the settling time of the dac is 1 ? s max, and the maximum current is 700 ? a. 1 the settling time of the dac is 2.5 ? s and the maximum current is 350 ? a. 31:17 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 838. d/a control register (ctrl - address 0x400e 1004) bit description bit symbol value description reset value 0 int_dma_req dma request 0 0 this bit is cleared on any write to the dacr register. 1 this bit is set by hardware when the timer times out. 1 dblbuf_ena dma double-buffering 0 0 dacr double-buffering is disabled. 1 when this bit and the cnt_ena bit are both set, the double-buffering feature in the dacr register will be enabled. writes to the dacr register are written to a pre-buffer and then transferred to the dacr on the next time-out of the counter. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 908 of 1164 nxp semiconductors UM10430 chapter 39: lpc18xx dac 39.5.3 d/a converter counter value register this read/write register contains the reload value for the interrupt/dma counter. 39.6 functional description 39.6.1 dma counter when the counter enab le bit cnt_ena in dacctrl is set, a 16-bit counter will begin counting down, at the rate selected by cl k_apb3_dac, from the va lue programmed into the daccntval register. the counter is decremented each time the counter reaches zero, the counter will be reloaded by the value of da ccntval and the dma request bit int_dma_req will be set in hardware. note that the contents of the dacctrl and daccntval registers are read and write accessible, but the timer itself is not accessible for either read or write. if the dma_ena bit is set in the dacctrl re gister, the dac dma re quest will be routed to the gpdma. when the dma_ena bit is cleared, the default state after a reset, dac dma requests are blocked. 39.6.2 double buffering double-buffering is enabled only if both, the cnt_ena and the dblbuf_ena bits are set in dacctrl. in this case, an y write to the dacr register will only load the pre-buffer, which shares its register address with the da cr register. the dacr itself will be loaded from the pre-buffer whenever the counter reache s zero and the dma request is set. at the same time the counter is reloaded with the countval register value. reading the dacr register will on ly return the contents of the dacr register itself, not the contents of the pre-buffer register. 2 cnt_ena dma time-out 0 0 time-out counter operation is disabled. 1 time-out counter operation is enabled. 3 dma_ena dma enable 0 0 dma access is disabled. 1 dma burst request input 15 is enabled for the dac (see table 195 ). 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 838. d/a control register (ctrl - address 0x400e 1004) bit description bit symbol value description reset value table 839: d/a converter counter value register (cntval - address 0x400e 1008) bit description bit symbol description reset value 15:0 value 16-bit reload value for the dac interrupt/dma timer. 0 31:16 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 909 of 1164 nxp semiconductors UM10430 chapter 39: lpc18xx dac if either the cnt_ena or the dblbuf_ena bits are 0, any writes to the dacr address will go directly to the dacr register. fig 147. dac control with dma interrupt and timer cntval counter pre-buffer mux dacr ld ld ld en 16 16 pbus pbus set_intrpt dblbuf_ena cnt_ena ena_cnt_and_dblbuf pbus_wr_to_dacr 1 0 pbus pbus pbus_wr_todacr zero dac value 3 2 1 0 s c set_intrpt pbus pbus_wr_to_dacr dma_ena intrptdma_req www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 910 of 1164 40.1 how to read this chapter the flash programming interface is available for parts with on-chip flash. a reduced set of isp commands is supported for flashless parts (see table 843 ). see chapter 3 for details of the boot process for flashless parts. 40.2 introduction the boot loader controls initial operation after reset and also provides the tools for programming the flash memory. this could be initial programming of a blank device, erasure and re-programming of a previously programmed device, or programming of the flash memory by the application program in a running system. 40.3 features ? in-system programming: in-system pr ogramming (isp) is programming or reprogramming the on-chip flash memory, us ing the boot loader software and uart0 serial port. this can be done when the part resides in the end-user board. ? for parts without on-chip flash, isp allows to load data to on-chip sram and to execute code from on-chip sram. ? in application programming: in-application (iap) programming is performing erase and write operation on the on-chip flash memory, as directed by the end-user application code. ? flash signature generation: built-in hardware can generate a signature for a range of flash addresses or for the entire flash memory. 40.4 description the flash boot loader code is executed every ti me the part is powered on or reset. the loader can execute the isp command handler or the user application code. a low level after reset at pin p2_7 is considered an external hardware request to start the isp command handler. assuming that power supply pins are on their nominal levels when the rising edge on reset pin is generated, it may take up to 3 ms before p2_7 is sampled and the decision on whether to continue with user code or isp handler is made. if p2_7 is sampled low and the watchdog overflow flag is set, the external hardw are request to start the isp command handler is ignored. if there is no request for the isp command handler execution (p2_7 is sampled high after reset), a search is made for a valid user program. if a valid user program is found then the executi on control is transferred to it. if a valid user program is not found, the auto-baud routine is invoked. pin p2_7 is used as a hardw are request signal for isp a nd therefore requires special attention. since p2_7 is in high impedance mo de after reset, it is important that the user provides external hardware (a pull-up resistor or other device) to put the pin in a defined state. otherwise unintended entry into isp mode may occur. UM10430 chapter 40: lpc18xx flash programming interface rev. 00.13 ? 20 july 2011 user manual www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 911 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface when isp mode is entered after a power on reset, the irc and pll1 are used to generate the cclk of 96 mhz. the uart0 pins are set to p2_0 and p2_1. after determining the host?s baud rate, the test string ?synchronized? is sent to a host. after a successful handshake, isp enters the command interpret mode. a hardware flash signature gener ation capability is built in to the flash memory. this feature can be used to create a signature that can then be used to verify flash contents. details of flash signature generation are shown in section 40.11 . 40.4.1 memory map after any reset when a user program begins execution after re set, the interrupt vector s are set to point to the beginning of flash memory (see figure 7 ). 40.4.1.1 criterion for valid user code the reserved cortex-m3 exception vector locati on 7 (offset 0x 001c in the vector table) should contain the 2?s complement of the check-sum of table entries 0 through 6. this causes the checksum of the first 8 table entries to be 0. the boot loader code checksums the first 8 locations in sector 0 of the flash. if the result is 0, then execution control is transferred to the user code. if the signature is not valid, the auto-baud routin e synchronizes with the host via serial port 0. the host should send a ??? (0x3f) as a synchronization character and wait for a response. the host side serial port settings should be 8 data bits, 1 stop bit and no parity. the auto-baud routine measures the bit time of the received synchronization character in terms of its own frequency and programs the baud rate generator of the serial port. it also sends an ascii string ("synchronized") to the host. in response to this the host should send the same string ("synchronized< cr>"). the auto-baud routine looks at the received characters to verify synchroniz ation. if synchronization is verified then "ok" string is sent to the host. the host should respond by sending the crystal frequency (in khz) at which the part is running. for example, if the part is running at 10 mhz, the response from the host should be "10000". "ok" string is sent to the host after receivin g the crystal frequency. if synchronization is not verified then the auto-baud routine waits again for a synchronization character. for auto-baud to work correctly in case of user invoked isp, the cc lk frequency should be greater than or equal to 10 mhz. once the crystal frequency is received the part is initialized and the isp command handler is invoked. for safety reasons an "unlock" command is required before executing the commands resulting in flash erase/write operations and the "go" command. the rest of the commands can be executed without the unlock command. the unlock command is required to be executed once per isp session. the unlock command is explained in section 40.8 ? isp commands ? on page 917 . 40.4.2 communication protocol all isp commands should be sent as single as cii strings. strings should be terminated with carriage return (cr) and/or line fe ed (lf) control characters. extra and characters are ignored. all isp respon ses are sent as terminated ascii strings. data is sent and received in uu-encoded format. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 912 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.4.2.1 isp command format "command parameter_0 parameter_1 ? parameter_n" "data" (data only for write commands). 40.4.2.2 isp response format "return_coderesponse_0response_1 ? response_n" "data" (data only for read commands). 40.4.2.3 isp data format the data stream is in uu-encoded format. the uu-encode algorithm converts 3 bytes of binary data in to 4 bytes of printable ascii ch aracter set. it is more efficient than hex format which converts 1 byte of binary data in to 2 bytes of ascii hex. the sender should send the check-sum after transmitting 20 uu-encoded lines. the length of any uu-encoded line should not exceed 61 characters (bytes) i.e. it can hold 45 data bytes. the receiver should compare it with the check-sum of the received bytes. if the check-sum matches then the receiver should respond with "ok" to continue further transmission. if the check-sum does not match the receiver should respond with "resend". in response the se nder should retransmit the bytes. 40.4.2.4 isp flow control a software xon/xoff flow control scheme is used to prevent data loss due to buffer overrun. when the data arrives rapidly, the as cii control character dc3 (0x13) is sent to stop the flow of data. data flow is resume d by sending the ascii control character dc1 (0x11). the host should also support the same flow control scheme. 40.4.2.5 isp command abort commands can be aborted by sending the ascii control character "esc" (0x1b). this feature is not documented as a command under "isp commands" section. once the escape code is received the isp command handler waits for a new command. 40.4.2.6 interrupts during iap the on-chip flash memory is not accessible du ring erase/write operat ions. when the user application code starts executing the interrupt vectors from the user flash area are active. the user should either disable interrupts, or en sure that user interrup t vectors are active in ram and that the interrupt handlers reside in ram, before making a flash erase/write iap call. the iap code does not use or disable interrupts. 40.4.2.7 ram used by isp command handler isp commands use on-chip ram from 0x1000 0118 to 0x1000 01ff. the user could use this area, but the contents may be lost up on reset. flash programming commands use the top 32 bytes of on-chip ram. the stack is located at ram top - 32. the maximum stack usage is 256 bytes and grows downwards. 40.4.2.8 ram used by iap command handler flash programming commands use the top 32 bytes of on-chip ram. the maximum stack usage in the user allocated stack space is 128 bytes and grows downwards. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 913 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.5 boot process flowchart (1) for details on handling the crystal frequency, see section 40.9.9 ? re-invoke isp ? on page 930 (2) for details on available isp commands based on the crp settings see section 40.7 ? code read protection (crp) ? fig 148. boot process flowchart watchdog flag set? crp1/2/3 enabled? yes no initialize reset enable debug yes run isp command handler 2 receive crystal frequency 1 no auto-baud successful? yes run auto-baud user code valid? yes no crp3 enabled? enter isp mode? (p2_7=low) user code valid? yes yes no yes no no a a execute internal user code www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 914 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.6 sector numbers some iap and isp commands operate on "sec tors" and specify sector numbers. the following table indicate the correspondence between sector numbers and memory addresses for lpc18xx device. iap and isp routines are located in the boot rom. table 840. flash configuration flash bank sector number sector size [kb] start address end address lpc18x2 lpc18x3 lpc18x5 lpc18x7 a 0 8 0x1a00 0000 0x1a00 1fff x x x x a 1 8 0x1a00 2000 0x1a00 3fff x x x x a 2 8 0x1a00 4000 0x1a00 5fff x x x x a 3 8 0x1a00 6000 0x1a00 7fff x x x x a 4 8 0x1a00 8000 0x1a00 9fff x x x x a 5 8 0x1a00 a000 0x1a00 bfff x x x x a 6 8 0x1a00 c000 0x1a00 dfff x x x x a 7 8 0x1a00 e000 0x1a00 ffff x x x x a 8 64 0x1a01 0000 0x1a01 ffff x x x x a 9 64 0x1a02 0000 0x1a02 ffff x x x x a 10 64 0x1a03 0000 0x1a03 ffff x x x x a 11 64 0x1a04 0000 0x1a04 ffff x x x a 12 64 0x1a05 0000 0x1a05 ffff x x x a 13 64 0x1a06 0000 0x1a06 ffff x x a 14 64 0x1a07 0000 0x1a07 ffff x x b 0 8 0x1b00 0000 0x1b00 1fff x x x b 1 8 0x1b00 2000 0x1b00 3fff x x x b 2 8 0x1b00 4000 0x1b00 5fff x x x b 3 8 0x1b00 6000 0x1b00 7fff x x x b 4 8 0x1b00 8000 0x1b00 9fff x x x b 5 8 0x1b00 a000 0x1b00 bfff x x x b 6 8 0x1b00 c000 0x1b00 dfff x x x b 7 8 0x1b00 e000 0x1b00 ffff x x x b 8 64 0x1b01 0000 0x1b01 ffff x x x b 9 64 0x1b02 0000 0x1b02 ffff x x x b 10 64 0x1b03 0000 0x1b03 ffff x x x b 11 64 0x1b04 0000 0x1b04 ffff x x b 12 64 0x1b05 0000 0x1b05 ffff x x b 13 64 0x1b06 0000 0x1b06 ffff x b 14 64 0x1b07 0000 0x1b07 ffff x www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 915 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.7 code read protection (crp) code read protection is a mechanism that allows user to enable different levels of security in the system so that access to the on-chip flash and use of the isp can be restricted. when needed, crp is invoked by programming a specific pattern in flash location at 0x000002fc. iap commands are not affected by the code read protection. important: any crp change becomes effective only after the device has gone through a power cycle. table 841. code read protection options name pattern programmed in 0x000002fc description crp1 0x12345678 access to chip via the jtag pins is disabled. this mode allows partial flash update using the following isp commands and restrictions: ? because the isp code uses sram, the write to ram command can not access sram below 0x1000 0200, see section 40.4.2.7 . ? read memory command: disabled. ? copy ram to flash command: cannot write to sector 0. ? go command: disabled. ? erase sector(s) command: can erase any individual sector except sector 0 only, or can erase all sectors at once. ? compare command: disabled this mode is useful when crp is required and flash field updates are needed but all sectors can not be erased. the compare command is disabled, so in the case of partial flash updates the secondary loader should implement a checksum mechanism to verify the integrity of the flash. crp2 0x87654321 this is similar to crp1 with the following additions: ? write to ram command: disabled. ? copy ram to flash: disabled. ? erase command: only allows erase of all sectors. crp3 0x43218765 this is similar to crp2, but isp entry by pulling p2_7 low is disabled if a valid user code is present in flash sector 0. this mode effectively disables isp override using the p2_7 pin. it is up to the user?s application to provide for flash updates by using iap calls or by invoking isp with uart0. caution: if crp3 is selected, no future factory testing can be performed on the device. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 916 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface if any crp mode is enabled and access to the chip is allowed via the isp, an unsupported or restricted isp co mmand will be terminated with return code code_read_protection_enabled. table 842. code read protection hardware/software interaction crp option user code valid p2_7 pin at reset jtag enabled lpc18xx enters isp mode partial flash update in isp mode none no x yes yes yes yes high yes no na yes low yes yes yes crp1 no x no yes yes yeshighnonona yes low no yes yes crp2 no x no yes no yeshighnonona yes low no yes no crp3 no x no yes no yes x no no na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 917 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.8 isp commands the following commands are accepted by the isp command handler. detailed status codes are supported for each command. the command handler sends the return code invalid_command when an undefined command is received. commands and return codes are in ascii format. cmd_success is sent by isp command handl er only when received isp command has been completely executed and the new isp command can be given by the host. exceptions from this rule are "set baud rate ", "write to ram", "read memory", and "go" commands. 40.8.1 unlock table 843. isp command summary isp command usage flashless parts parts with flash described in unlock u yes yes ta b l e 8 4 4 set baud rate b yes yes ta b l e 8 4 5 echo a yes yes ta b l e 8 4 7 write to ram w yes yes ta b l e 8 4 8 read memory r
yes yes ta b l e 8 4 9 prepare sector(s) for write operation p no yes ta b l e 8 5 0 copy ram to flash c no yes ta b l e 8 5 1 go g
yes yes ta b l e 8 5 2 erase sector(s) e no yes ta b l e 8 5 3 blank check sector(s) i no yes ta b l e 8 5 4 read part id j yes yes ta b l e 8 5 5 read boot code version k yes yes ta b l e 8 5 7 read serial number n yes yes ta b l e 8 5 8 compare m no yes ta b l e 8 5 9 table 844. isp unlock command command u input unlock code: 23130 10 return code cmd_success | invalid_code | param_error description this command is used to unlock flash write, erase, and go commands. example "u 23130" unlocks the flash write/erase & go commands. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 918 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.8.2 set baud rate [1] isp entry after reset uses the on chip irc and pll to run the device at cclk = 14.748 mhz 40.8.3 echo 40.8.4 write to ram the host should send the data only after receiving the cmd_success return code. the host should send the check-sum after transmitting 20 uu-encoded lines. the checksum is generated by adding raw data (before uu-encoding) bytes and is reset after transmitting 20 uu-encoded lines. the length of any uu-encoded line should not exceed 61 characters (bytes) i.e. it can hold 45 data bytes. when the data fits in less than 20 uu-encoded lines then the ch eck-sum should be of the actual number of bytes sent. table 845. isp set baud rate command command b input baud rate: 9600 | 19200 | 38400 | 57600 | 115200 | 230400 stop bit: 1 | 2 return code cmd_success | invalid_baud_rate | invalid_stop_bit | param_error description this command is used to change the baud rate. the new baud rate is effective after the command handler send s the cmd_success return code. example "b 57600 1" sets the serial port to baud rate 57600 bps and 1 stop bit. table 846. correlation between possible isp baudrates and cclk frequency (in mhz) isp baudrate .vs. cclk frequency 9600 19200 38400 57600 115200 230400 10.0000 + + + 11.0592 + + + 12.2880 + + + 14.7456 [1] ++++++ 15.3600 + 18.4320 + + + 19.6608 + + + 24.5760 + + + 25.0000 + + + table 847. isp echo command command a input setting: on = 1 | off = 0 return code cmd_success | param_error description the default setting for echo command is on. when on the isp command handler sends the received serial data back to the host. example "a 0" turns echo off. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 919 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface the isp command handler compares it with th e check-sum of the received bytes. if the check-sum matches, the isp command handler responds with "ok" to continue further transmission. if the check-sum does not match, the isp command handler responds with "resend". in response the host should retransmit the bytes. 40.8.5 read memory the data stream is followed by the command success return code. t he check-sum is sent after transmitting 20 uu-encoded lines. the checksum is generated by adding raw data (before uu-encoding) bytes and is reset after transmitting 20 uu-encoded lines. the length of any uu-encoded line should not exceed 61 characters (bytes) i.e. it can hold 45 data bytes. when the data fits in less than 20 uu-encoded lines then the check-sum is of actual number of bytes sent. the host sh ould compare it with the checksum of the received bytes. if the check-sum matches then the host should respond with "ok" to continue further transmissi on. if the check-sum does not match then the host should respond with "resend". in response the isp command handler sends the data again. table 848. isp write to ram command command w input start address: ram address where data bytes are to be written. this address should be a word boundary. number of bytes: number of bytes to be written. count should be a multiple of 4 return code cmd_success | addr_error (address not on word boundary) | addr_not_mapped | count_error (byte count is not multiple of 4) | param_error | code_read_protection_enabled description this command is used to download data to ram. data should be in uu-encoded format. this command is blocked when code read protection levels crp2 or crp3 are enabled. example "w 268435968 4" writes 4 bytes of data to address 0x1000 0200. table 849. isp read memory command command r input start address: address from where data bytes are to be read. this address should be a word boundary. number of bytes: number of bytes to be read. count should be a multiple of 4. return code cmd_success followed by | addr_error (address not on word boundary) | addr_not_mapped | count_error (byte count is not a multiple of 4) | param_error | code_read_protection_enabled description this command is used to read data from ram or flash memory. this command is blocked when any level of code read protection is enabled. example "r 268435968 4" reads 4 bytes of data from address 0x1000 0200. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 920 of 1164 nxp semiconductors
UM10430 chapter 40: lpc18xx flash programming interface 40.8.6 prepare sector(s) for write ope ration this command makes flash write/erase operation a two step process. 40.8.7 copy ram to flash table 850. isp prepare sector(s) for write operation command command p input start sector number end sector number: should be greater than or equal to start sector number. return code cmd_success | busy | invalid_sector | param_error description this command must be executed before executing "copy ram to flash" or "erase sector(s)" command. successful execution of the "copy ram to flash" or "erase sector(s)" command causes releva nt sectors to be protected again. to prepare a single sector use the same "start" and "end" sector numbers. example "p 0 0" prepares the flash sector 0. table 851. isp copy command command c input flash address(dst): destination flash address where data bytes are to be written. the destination address should be a 256 byte boundary. ram address(src): source ram address from where data bytes are to be read. number of bytes: number of bytes to be written. should be 256 | 512 | 1024 | 4096. return code cmd_success | src_addr_error (address not on word boundary) | dst_addr_error (address not on correct boundary) | src_addr_not_mapped | dst_addr_not_mapped | count_error (byte count is not 256 | 512 | 1024 | 4096) | sector_not_prepared_for write_operation | busy | cmd_locked | param_error | code_read_protection_enabled description this command is used to program the flash memory. the "p repare sector(s) for write operation" command should precede this command. the affected sectors are automatically protected again once the copy command is successfully executed. this command is blocked when code read protection levels crp2 or crp3 are enabled. when code read protection level crp1 is enabled, individual sectors other than sector 0 can be written. example "c 0 268468224 512" copies 512 bytes from the ram address 0x1000 8000 to the flash address 0. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 921 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.8.8 go
when the go command is used, execution begins at the specified address (assuming it is an executable address) with the device left as it was configured for the isp code. this means that some things are different than th ey would be for entering user code directly following a chip reset. most importantly, the main pll will be ru nning and co nnected, configured to generate a cpu clock with a frequency of approximately 14.7456 mhz. 40.8.9 erase sector(s) table 852. isp go command command g input address: flash or ram address from which the code execution is to be started. this address should be on a word boundary. mode (retained for backward compatibility): t (execute program in thumb mode) | a (not allowed). return code cmd_success | addr_error | addr_not_mapped | cmd_locked | param_error | code_read_protection_enabled description this command is used to execute a program residing in ram or flash memory. it may not be possible to return to the isp command handler once this command is successfully executed. this command is blocked when any level of code read protection is enabled. example "g 0 t" branches to address 0x0000 0000. table 853. isp erase sector command command e input start sector number end sector number: should be greater than or equal to start sector number. return code cmd_success | busy | invalid_sector | sector_not_prepared_for_write_operation | cmd_locked | param_error | code_read_protection_enabled description this command is used to erase one or more sector(s) of on-chip flash memory. this command is blocked when code read protection level crp3 is enabled. when code read protection level crp1 is enabled, individual sectors other than sector 0 can be erased. all sectors can be erased at once in crp1 and crp2. example "e 2 3" erases the flash sectors 2 and 3. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 922 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.8.10 blank check sector(s) 40.8.11 read part identification number 40.8.12 read boot co de version number 40.8.13 read device serial number table 854. isp blank check sector command command i input start sector number: end sector number: should be greater than or equal to start sector number. return code cmd_success | sector_not_blank (followed by ) | invalid_sector | param_error | description this command is used to blank check one or more sectors of on-chip flash memory. example "i 2 3" blank c hecks the flash sectors 2 and 3. table 855. isp read part identification command command j input none. return code cmd_succ ess followed by part identification number in ascii (see table 856 ? lpc18xx part identification numbers ? ). description this command is used to read the part identification number. the part identification number maps to a feature subset within a device family. this number will not normally change as a result of technical revisions. table 856. lpc18xx part identification numbers device ascii/dec coding hex coding table 857. isp read boot code version number command command k input none return code cmd_success fo llowed by 2 bytes of boot code version number in ascii format. it is to be interpreted as .. description this command is used to read the boot code version number. table 858. isp read device serial number command command n input none. return code cmd_success fo llowed by the device serial num ber in 4 decimal ascii groups, each representing a 32-bit value. description this command is used to read the device serial number. the serial number may be used to uniquely identify a single unit among all lpc18xx devices. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 923 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.8.14 compare 40.8.15 isp return codes table 859. isp compare command command m input address1 (dst): starting flash or ram address of data bytes to be compared. this address should be a word boundary. address2 (src): starting flash or ram address of data bytes to be compared. this address should be a word boundary. number of bytes: number of bytes to be compared; should be a multiple of 4. return code cmd_success | (sourc e and destination data are equal) compare_error | (followed by the offset of first mismatch) count_error (byte count is not a multiple of 4) | addr_error | addr_not_mapped | param_error | description this command is used to compare the memory contents at two locations. this command is blocked when any level of code read protection is enabled. example "m 8192 268435968 4" compares 4 bytes from the ram address 0x1000 0200 to the 4 bytes from the flash address 0x2000. table 860. isp return codes summary return code mnemonic description 0 cmd_success command is executed successfully. sent by isp handler only when command given by the host has been completely and successfully executed. 1 invalid_command invalid command. 2 src_addr_error source address is not on word boundary. 3 dst_addr_error destination address is not on a correct boundary. 4 src_addr_not_mapped source address is not mapped in the memory map. count value is taken into consideration where applicable. 5 dst_addr_not_mapped destination addres s is not mapped in the memory map. count value is taken into consideration where applicable. 6 count_error byte count is not multiple of 4 or is not a permitted value. 7 invalid_sector sector number is invalid or end sector number is greater than start sector number. 8 sector_not_blank sector is not blank. 9 sector_not_prepared_for_ write_operation command to prepare sector for write operation was not executed. 10 compare_error source and destination data not equal. 11 busy flash programming hardware interface is busy. 12 param_error insufficient number of parameters or invalid parameter. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 924 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 13 addr_error address is not on word boundary. 14 addr_not_mapped address is not mapped in the memory map. count value is taken in to consideration where applicable. 15 cmd_locked command is locked. 16 invalid_code unlock code is invalid. 17 invalid_baud_rate invalid baud rate setting. 18 invalid_stop_bit invalid stop bit setting. 19 code_read_protection_ enabled code read protection enabled. table 860. isp return codes summary return code mnemonic description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 925 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.9 iap commands for in application programming the iap routine should be called with a word pointer in register r0 pointing to memory (ram) cont aining command code and parameters. result of the iap command is returned in the result table pointed to by register r1. the user can reuse the command table for result by passing the same pointer in registers r0 and r1. the parameter table should be big enough to hold all the results in case if number of results are more than number of parameters. parameter pa ssing is illustrated in the figure 149 . the number of parameters and results vary according to the iap command. the maximum number of parameters is 5, passed to the "copy ram to flash" command. the maximum number of results is 4, returned by the "read device serial number" command. the command handler sends the status code invalid_command when an undefined command is received. the iap routine resides at location 0x1fff 1ff0. the iap function could be called in the following way using c. define the iap location entry point. bit 0 of the iap location is set since the cortex-m3 uses only thumb mode. #define iap_location 0x1fff1ff1 define data structure or pointers to pass i ap command table and result table to the iap function: unsigned long command[5]; unsigned long result[5]; or unsigned long * command; unsigned long * result; command=(unsigned long *) 0x... result= (unsigned long *) 0x... define pointer to function type, which takes two parameters and returns void. note the iap returns the result with the base address of the table residing in r1. typedef void (*iap)(unsigned int [],unsigned int[]); iap iap_entry; setting function pointer: iap_entry=(iap) iap_location; whenever you wish to call iap you could use the following statement. iap_entry (command, result); the iap call could be simplified further by using the symbol definition file feature supported by arm linker in ads (arm deve loper suite). you could also call the iap routine using assembly code. as per the arm specification (the arm thumb procedure call standard sws espc 0002 a-05) up to 4 parameters can be passed in the r0, r1, r2 and r3 registers respectively. additional parame ters are passed on the stack. up to 4 parameters can be www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 926 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface returned in the r0, r1, r2 and r3 registers respectively. additional parameters are returned indirectly via memory. some of the iap calls require more than 4 parameters. if the arm suggested scheme is used for the parameter passing/returning then it might create problems due to difference in the c compiler implementation from different vendors. the suggested parameter passing scheme reduces such risk. the flash memory is not accessible during a write or erase operation. iap commands, which results in a flash write/erase operation, use 32 bytes of space in the top portion of the on-chip ram for execution. the user program should not be use this space if iap flash programming is permitted in the application. 40.9.1 prepare sector(s) for write operation this command makes flash write/erase operation a two step process. table 861. iap command summary iap command command code described in prepare sector(s) for write operation 50 10 table 862 copy ram to flash 51 10 table 863 erase sector(s) 52 10 table 864 blank check sector(s) 53 10 table 865 read part id 54 10 table 866 read boot code version 55 10 table 867 read device serial number 58 10 table 868 compare 56 10 table 869 reinvoke isp 57 10 table 870 fig 149. iap parameter passing command code parameter 1 parameter 2 parameter n status code result 1 result 2 result n command parameter table command result table arm register r0 arm register r1 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 927 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.9.2 copy ram to flash table 862. iap prepare sector(s) for write operation command command prepare sector(s) for write operation input command code: 50 (decimal) param0: start sector number param1: end sector number (should be greater than or equal to start sector number). return code cmd_success | busy | invalid_sector result none description this command must be executed before executing "copy ram to flash" or "erase sector(s)" command. successful execution of the "copy ram to flash" or "erase sector(s)" command causes releva nt sectors to be protected again. to prepare a single sector use the same "start" and "end" sector numbers. table 863. iap copy ram to flash command command copy ram to flash input command code: 51 (decimal) param0(dst): destination flash address where data bytes are to be written. this address should be a 256 byte boundary. param1(src): source ram address from which data bytes are to be read. this address should be a word boundary. param2: number of bytes to be written. should be 256 | 512 | 1024 | 4096. param3: cpu clock frequency (cclk) in khz. return code cmd_success | src_addr_error (address not a word boundary) | dst_addr_error (address not on correct boundary) | src_addr_not_mapped | dst_addr_not_mapped | count_error (byte count is not 256 | 512 | 1024 | 4096) | sector_not_prepared_for_write_operation | busy | result none description this command is used to program the flash memory. the affected sectors should be prepared first by calling "prepare sector for write operation" command. the affected sectors are automatically protected again once the copy command is successfully executed. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 928 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.9.3 erase sector(s) 40.9.4 blank check sector(s) 40.9.5 read part identification number table 864. iap erase sector(s) command command erase sector(s) input command code: 52 (decimal) param0: start sector number param1: end sector number (should be greater than or equal to start sector number). param2: cpu clock frequency (cclk) in khz. return code cmd_success | busy | sector_not_prepared_for_write_operation | invalid_sector result none description this command is used to erase a sector or multiple sectors of on-chip flash memory. to erase a single sector use the same "start" and "end" sector numbers. table 865. iap blank check sector(s) command command blank check sector(s) input command code: 53 (decimal) param0: start sector number param1: end sector number (should be greater than or equal to start sector number). return code cmd_success | busy | sector_not_blank | invalid_sector result result0: offset of the first non blank word location if the status code is sector_not_blank. result1: contents of non blank word location. description this command is used to blank check a sector or multiple sectors of on-chip flash memory. to blank check a single sector use the same "start" and "end" sector numbers. table 866. iap read part identification number command command read part identification number input command code: 54 (decimal) parameters: none return code cmd_success | result result0: part identification number. description this command is used to read the part identification number. the value returned is the hexadecimal version of the part id. see ta b l e 8 5 6 ? lpc18xx part identification numbers ? . www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 929 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.9.6 read boot code version number 40.9.7 read device serial number 40.9.8 compare table 867. iap read boot code version number command command read boot code version number input command code: 55 (decimal) parameters: none return code cmd_success | result result0: 2 bytes of boot code version number in ascii format. it is to be interpreted as . description this command is used to read the boot code version number. table 868. iap read device serial number command command read device serial number input command code: 58 (decimal) parameters: none return code cmd_success | result result0: first 32-bit word of device identification number (at the lowest address) result1: second 32-bit word of device identification number result2: third 32-bit word of device identification number result3: fourth 32-bit word of device identification number description this command is used to read the device identification number. the serial number may be used to uniquely identify a single unit among all lpc18xx devices. table 869. iap compare command command compare input command code: 56 (decimal) param0(dst): starting flash or ram address of data bytes to be compared. this address should be a word boundary. param1(src): starting flash or ram address of data bytes to be compared. this address should be a word boundary. param2: number of bytes to be compared; should be a multiple of 4. return code cmd_success | compare_error | count_error (byte count is not a multiple of 4) | addr_error | addr_not_mapped result result0: offset of the first mismatch if the status code is compare_error. description this command is used to compare the memory contents at two locations. the result may not be correct when the source or destination includes any of the first 64 bytes starting from address zero. the first 64 bytes can be re-mapped to ram. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 930 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.9.9 re-invoke isp 40.9.10 iap status codes 40.10 jtag flash pr ogramming interface debug tools can write parts of the flash image to the ram and then execute the iap call "copy ram to flash" repeatedly with proper offset. table 870. re-invoke isp command compare input command code: 57 (decimal) return code none result none. description this command is used to invoke the boot loader in isp mode. it maps boot vectors, sets the clock to 96 mhz, configures uart0 pins u0_rx and u0_tx, resets timer1 and resets the u0fdr (see table 678 ). this command may be used when a valid user program is present in the internal flash memory and the p2_7 pin is not accessible to force the isp mode. the command does not disable the pll1 hence it is possible to invoke the boot loader when the part is running off the pll1. in this case, the isp utility must pass the pll1 output frequency after the autobaud handshake. another option is to disable the pll1 and select the irc as the clock source before making this iap call. in this case,the frequency sent by isp is ignored and irc and pll1 are used to generate a 14.748 mhz clock. table 871. iap status codes summary status code mnemonic description 0 cmd_success command is executed successfully. 1 invalid_command invalid command. 2 src_addr_error source address is not on a word boundary. 3 dst_addr_error destination address is not on a correct boundary. 4 src_addr_not_mapped source address is not mapped in the memory map. count value is taken in to consideration where applicable. 5 dst_addr_not_mapped destination addr ess is not mapped in the memory map. count value is taken in to consideration where applicable. 6 count_error byte count is not multiple of 4 or is not a permitted value. 7 invalid_sector sector number is invalid. 8 sector_not_blank sector is not blank. 9 sector_not_prepared_ for_write_operation command to prepare sector for write operation was not executed. 10 compare_error source and destination data is not same. 11 busy flash programming hardware interface is busy. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 931 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.11 flash signature generation the flash module contains a built-in signatu re generator. this generator can produce a 128-bit signature from a range of flash memory. a typical usage is to verify the flashed contents against a calculated signature (e.g. during programming). the address range for generating a signature must be aligned on flash-word boundaries, i.e. 128-bit boundaries. once started, si gnature generation completes independently. while signature generation is in progress, t he flash memory cannot be accessed for other purposes, and an attempted read will cause a wait state to be as serted until signature generation is complete. code outside of the flash (e.g. internal ram) can be executed during signature generation. this can include interrupt services, if the interrupt vector table is re-mapped to memory other than the flash memory. the code that initiates signature generation should also be placed outside of the flash memory. 40.11.1 register descriptio n for signature generation table 872. register overview: fmc (base address 0x4008 4000) name description access reset value address reference fmsstart signature start address register r/w 0 0x4008 4020 table 873 fmsstop signature stop-address register r/w 0 0x4008 4024 table 874 fmsw0 128-bit signature word 0 r - 0x4008 402c table 875 fmsw1 128-bit signature word 1 r - 0x4008 4030 table 876 fmsw2 128-bit signature word 2 r - 0x4008 4034 table 877 fmsw3 128-bit signature word 3 r - 0x4008 4038 table 878 fmstat signature generation status register r 0 0x4008 4fe0 section 40.11.1.3 fmstatclr signature generation status clear register w - 0x4008 4fe8 section 40.11.1.4 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 932 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.11.1.1 signature generation address and control registers these registers control automatic signature generation. a signature can be generated for any part of the flash memory contents. the address range to be us ed for generation is defined by writing the start address to the signature start address register (fmsstart) and the stop address to the si gnature stop address register (fmsstop. the start and stop addresses must be aligned to 128-bit boun daries and can be derived by dividing the byte address by 16. signature generation is starte d by setting the sig_start bit in the fmsstop register. setting the sig_start bit is typically combined with the signature stop address in a single write. table 873 and table 874 show the bit assignments in the fmsstart and fmsstop registers respectively. 40.11.1.2 signature generation result registers the signature generation result registers re turn the flash signature produced by the embedded signature generator. the 128-bit signa ture is reflected by the four registers fmsw0, fmsw1, fmsw2 and fmsw3. the generated flash signature can be used to verify the flash memory contents. the generated signature can be compared with an expected signature and thus makes saves time and code space. the method for generating the signature is described in section 40.11.2 . table 878 show bit assignment of the fmsw0 and fmsw1, fmsw2, fmsw3 registers respectively. table 873. flash module signature start register (fmsstart - 0x4008 4020) bit description bit symbol description reset value 31:17 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na 16:0 start signature generation start address (corresponds to ahb byte address bits[20:4]). 0 table 874. flash module signature stop register (fmsstop - 0x4008 4024) bit description bit symbol value description reset value 31:18 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na 17 sig_start start control bit for signature generation. 0 0 signature generation is stopped 1 initiate signature generation 16:0 stop bist stop address divided by 16 (corresponds to ahb byte address [20:4]). 0 table 875. fmsw0 register bit description (fmsw0, address: 0x4008 402c) bit symbol description reset value 31:0 sw0[31:0] word 0 of 128-bit signature (bits 31 to 0). - table 876. fmsw1 register bit description (fmsw1, address: 0x4008 4030) bit symbol description reset value 31:0 sw1[63:32] word 1 of 128-bit signature (bits 63 to 32). - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 933 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.11.1.3 flash module status register (fmstat - 0x0x4008 4fe0) the read-only fmstat register provides a means of determining when signature generation has comple ted. completion of si gnature generation ca n be checked by polling the sig_done bit in fmstat. sig_done should be cleared via the fmstatclr register before starting a signature genera tion operation, otherw ise the status might indicate completion of a previous operation. 40.11.1.4 flash module status clear register (fmstatclr - 0x0x4008 4fe8) the fmstatclr register is used to clear the signature generation completion flag. table 877. fmsw2 register bit description (fmsw2, address: 0x4008 4034) bit symbol description reset value 31:0 sw2[95:64] word 2 of 128-bit signature (bits 95 to 64). - table 878. fmsw3 register bit description (fmsw3, address: 0x4008 4038) bit symbol description reset value 31:0 sw3[127:96] word 3 of 128-bit signature (bits 127 to 96). - table 879. flash module status register (fmstat - 0x4008 4fe0) bit description bit symbol description reset value 31:2 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na 2 sig_done when 1, a previously started signature generation has completed. see fmstatclr register description for clearing this flag. 0 1:0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 880. flash module status clear register (fmstatclr - 0x0x4008 4fe8) bit description bit symbol description reset value 31:2 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na 2 sig_done_clr writing a 1 to this bits clears the signature generation completion flag (sig_done) in the fmstat register. 0 1:0 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 934 of 1164 nxp semiconductors UM10430 chapter 40: lpc18xx flash programming interface 40.11.2 algorithm and procedure for signature generation signature generation a signature can be generated for any part of the flash contents. the address range to be used for signature generation is defined by writing the start address to the fmsstart register, and the stop address to the fmsstop register. the signature generation is started by writing a ?1? to fmsstop.misr_start. starting the signature generation is typically combined with defining the stop address, which is done in another field fmsstop.fmsstop of the same register. the time that the signature generation takes is proportional to the address range for which the signature is generated. reading of the flash memory for signature generation uses a self-timed read mechanism and does not de pend on any configurable timing settings for the flash. a safe estimation for the duration of the signature generation is: duration = int( (60 / tcy) + 3 ) x (fmsstop - fmsstart + 1) when signature generation is triggered via software, the duration is in ahb clock cycles, and tcy is the time in ns for one ahb clock. the sig_done bit in fmstat can be polled by software to determine when signature generation is complete. if signature generation is triggered via jtag, the duration is in jtag tck cycles, and tcy is the time in ns for one jtag clock. polling the sig_done bit in fmstat is not possible in this case. after signature generation, a 128-bit signat ure can be read from the fmsw0 to fmsw3 registers. the 128-bit signature reflects the co rrected data read from the flash. the 128-bit signature reflects flash parity bits and check bit values. content verification the signature as it is read from the fmsw 0 to fmsw3 registers must be equal to the reference signature. the algorithms to de rive the reference signature is given in figure 150 . fig 150. algorithm for generating a 128 bit signature sign = 0 for address = fmstart.fmstart to fmstop.fmstop { for i = 0 to 126 nextsign[i] = f_q[address][i] xor sign[i+1] nextsign[127] = f_q[address][127] xor sign[0] xor sign[2] xor sign[27] xor sign[29] sign = nextsign } signature128 = sign www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 935 of 1164 41.1 how to read this chapter the power management controller is identical on all lpc18xx parts. 41.2 features ? supports both standard jtag and arm serial wire debug modes. ? direct debug access to all memories, registers, and peripherals. ? no target resources are required for the debugging session. ? trace port provides cpu inst ruction trace capab ility. output can be via a 4-bit trace data port, or serial wire viewer. ? eight breakpoints. six instruction breakpoints that can also be used to remap instruction addresses for code patches. two data comparators that can be used to remap addresses for patches to literal values. ? four data watchpoints that can also be used as trace triggers. ? instrumentation trace macrocell allows additional software controlled trace. 41.3 introduction debug and trace functions are integrated into the arm cortex-m3. serial wire debug and trace functions are supported in addition to a standard jtag debug and parallel trace functions. the arm cortex-m3 is configured to support up to eight breakpoints and four watchpoints. 41.4 description debugging with the lpc18xx defaults to jtag. once in the jtag debug mode, the debug tool can switch to serial wire debug mode. trace can be done using either a 4-bit parallel interface or the serial wire output. 41.5 pin description the tables below indicate the various pin func tions related to debug and trace. some of these functions share pins with other functions which therefore may not be used at the same time. use of the jtag port excludes use of serial wire debug and serial wire output. use of the parallel trace requires 5 pins that may be part of the user application, limiting debug possibilities for th ose features. trace using the serial wire output does not have this limitation, but has a limited bandwidth. UM10430 chapter 41: lpc18xx jtag, seri al wire debug (swd), and trace functions rev. 00.13 ? 20 july 2011 user manual www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 936 of 1164 nxp semiconductors UM10430 chapter 41: lpc18xx jtag, serial wire debug (swd), and trace 41.6 debug notes important: the user should be aware of certai n limitations during debugging. the most important is that, due to limitations of th e cortex-m3 integration, the lpc18xx cannot wake up in the usual manner from deep sleep and power-down modes. it is recommended not to use these modes during debug. another issue is that debug mode changes the way in which reduced power modes are handled by the cortex-m3 cpu. this causes power modes at the device level to be different from normal modes operation. these differences mean that power measurements should not be made while debugging , the results will be higher than during normal operation in an application. table 881. jtag pin description pin name type description tck input jtag test clock. this pin is the clock for debug logic when in the jtag debug mode. tms input jtag test mode select. the tms pin selects the next state in the tap state machine. tdi input jtag test data in. this is the serial data input for the shift register. tdo output jtag test data output. this is the serial data output from the shift register. data is shifted out of the device on the negative edge of the tck signal. trst input jtag test reset. the trst pin can be used to reset the test logic within the debug logic. table 882. serial wire debug pin description pin name type description swdclk input serial wire clock. this pin is the clock for debug logic when in the serial wire debug mode. swdio input / output serial wire debug data input/output. the swdio pin is used by an external debug tool to communicate with and control the cortex-m3 cpu. swo output serial wire output. the swo pin optionally provides data from the itm and/or the etm for an external debug tool to evaluate. table 883. parallel trace pin description pin name type description traceclk input trace clock. this pin provides the sample clock for trace data on the tracedata pins when tracing is enabled by an external debug tool. tracedata[3:0] output trace data bits 3 to 0. these pins provide etm trace data when tracing is enabled by an external debug tool. the debug tool can then interpret the compressed information and make it available to the user. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 937 of 1164 nxp semiconductors UM10430 chapter 41: lpc18xx jtag, serial wire debug (swd), and trace during a debugging session, the system tick timer and the repetitive interrupt timers are automatically stopped whenever the cp u is stopped. other peripherals are not affected. if the repetitive inte rrupt timer is configured such that its pclk rate is lower than the cpu clock rate, the rit may not increment predictably during some debug operations, such as single stepping. debugging is disabled if code read protection is enabled. 41.7 debug memory re-mapping following chip reset, a portion of the boot rom is mapped to address 0 so that it will be automatically executed. the boot rom switches the map to point to . in this way a user normally does not need to know that this re-mapping occurs. however, when a debugger halts cpu execution immediately following reset, the boot rom is still mapped to addre ss 0 and can cause confusion. ideally, the debugger should correct the mapping automatically in this case, so that a user does not need to deal with it. 41.8 jtag tap identification the jtag tap controller contains device id that can be used by debugging software to identify the general type of device. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 938 of 1164 42.1 lpc1850/30/20/10 rev ?-? nvic 42.1.1 how to read this chapter remark: this chapter describes th e nvic connections of parts lpc1850/30/20/10 rev ?-?. the available nvic interrupt sources vary for different parts. ? ethernet interrupt: available on lpc1850/30. ? usb0 interrupt: available on lpc1850/30/20. ? usb1 interrupt: available on lpc1850/30. ? sdio interrupt: not available. 42.1.2 basic configuration the nvic is part of the arm cortex-m3 core. 42.1.3 features ? nested vectored interrupt controller that is an integral part of the arm cortex-m3 ? tightly coupled interrupt controller provides low interrupt latency ? controls system exceptions and peripheral interrupts ? on the lpc18xx, the nvic supports 32 vectored interrupts ? 32 programmable interrupt priority levels , with hardware priority level masking ? relocatable vector table ? non-maskable interrupt ? software interr upt generation 42.1.4 general description the nested vectored interrupt controller (nvic) is an integral part of the cortex-m3. the tight coupling to the cpu allows for low interr upt latency and efficient processing of late arriving interrupts. refer to the cortex-m3 user guide for details of nvic operation. 42.1.5 pin description UM10430 chapter 42: appendix rev. 00.13 ? 20 july 2011 user manual table 884. nvic pin description function direction description nmi i external non-maskable interrupt (nmi) input www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 939 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.6 interrupt sources table 885 lists the interrupt sources for each peri pheral function. each peripheral device may have one or more interrupt lines to the vectored interrupt controller. each line may represent more than one interrupt source, as noted. exception numbers relate to where entries ar e stored in the exception vector table. interrupt numbers are used in some other contexts, such as software interrupts. in addition, the nvic handles the non-maskab le interrupt (nmi). in order for nmi to operate from an external signal, the nmi func tion must be connected to the related device pin (p4_0 or pe_4). when connected, a logic 1 on th e pin will cause the nmi to be processed. for details, refer to the cortex-m3 user guide. table 885. connection of interrupt sources to the nvic interrupt id exception number vector offset function flag(s) 016 0x40dac 1 17 0x44 event router combined interrupt from the event router sources 218 0x48dma 3 19 0x4c - reserved 4 20 0x50 - reserved 5 21 0x54 ethernet sbd_intr_o ethernet interrupt 622 0x58sdio 723 0x5clcd 8 24 0x60 usb0 otg interrupt 9 25 0x64 usb1 10 26 0x68 sct sct combined interrupt 11 27 0x6c ri timer 12 28 0x70 timer0 13 29 0x74 timer1 14 30 0x78 timer2 15 31 0x7c timer3 16 32 0x80 motor control pwm 17 33 0x84 adc0 18 34 0x88 i2c0 19 35 0x8c i2c1 20 36 0x90 - reserved. 21 37 0x94 adc1 22 38 0x98 ssp0 23 39 0x9c ssp1 24 40 0xa0 uart0 25 41 0xa4 uart1 also modem interrupt 26 42 0xa8 uart2 27 43 0xac uart3 also irda interrupt 28 44 0xb0 i2s www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 940 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.7 vector table remapping the cortex-m3 incorporates a me chanism that allows remapping the interrupt vector table to alternate locations in the memory map. th is is controlled via the vector table offset register (vtor) contained in the cortex-m3. the vector table may be located anywhere wi thin the bottom 1 gb of cortex-m3 address space. the vector table should be located on a 256 word (1024 byte) boundary. refer to the cortex-m3 user guide for details of the vector table offset feature. arm describes bit 29 of the vtor (tbloff) as selecting a memory region, either code or sram. for simplicity, this bit can be thought as simply part of the address offset since the split between the ?code? space and t he ?sram? space occurs at the location corresponding to bit 29 in a memory address. examples: to place the vector table at the beginning of the ?local? static ram, starting at address 0x1000 0000, place the value 0x1000 0000 in the vtor register. this indicates address 0x1000 0000 in the code space, since bit 29 of the vtor equals 0. to place the vector table at the beginning of the ahb static ram, starting at address 0x2007 c000, place the value 0x2007 c000 in the vtor register. this indicates address 0x2007 c000 in the sram space, since bit 29 of the vtor equals 1. 29 45 0xb4 aes 30 46 0xb8 spifi 31 47 0xbc - reserved 32 - 40 48 - 56 0xc0 - 0xe0 -reserved table 885. connection of interrupt sources to the nvic interrupt id exception number vector offset function flag(s) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 941 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.8 register description the following table summarizes the registers in the nvic as implemented in the lpc18xx. the cortex-m3 user guide provides a functional description of the nvic. table 886. register overview: nvic (base address 0xe000 e000) name access address offset description reset value iser0 rw 0x100 interrupt set-enable register 0. this register allows enabling interrupts and reading back the interrupt enables for specific peripheral functions. 0 - rw 0x104 reserved. 0 icer0 rw 0x180 interrupt clear-enable register 0. this register allows disabling interrupts and reading back the interrupt enables for specific peripheral functions. 0 - rw 0x184 reserved. 0 ispr0 rw 0x200 interrupt set-pending register 0. this register allows changing the interrupt state to pending and reading back the interrupt pending state for specific peripheral functions. 0 - rw 0x204 reserved. 0 icpr0 rw 0x280 interrupt clear-pending register 0. this register allows changing the interrupt state to not pending and reading back the interrupt pending state for specific peripheral functions. 0 - rw 0x284 reserved. 0 iabr0 ro 0x300 interrupt active bit register 0. th is register allows reading the current interrupt active state for specific peripheral functions. 0 - ro 0x304 reserved. 0 ipr0 rw 0x400 interrupt priority registers 0. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr1 rw 0x404 interrupt priority registers 1 this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr2 rw 0x408 interrupt priority registers 2. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr3 rw 0x40c interrupt priority registers 3. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr4 rw 0x410 interrupt priority registers 4. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr5 rw 0x414 interrupt priority registers 5. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr6 rw 0x418 interrupt priority registers 6. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 ipr7 rw 0x41c interrupt priority registers 7. this register allows assigning a priority to each interrupt. each register contains the 5-bit priority fields for 4 interrupts. 0 stir wo 0xf00 software trigger interrupt register. this register allows software to generate an interrupt. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 942 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.8.1 interrupt set-enable register 0 register the iser0 register allows enabling the firs t 32 peripheral interrupts or reading the enabled state of those interrupts. disabling in terrupts is done through the icer0 register ( section 42.1.8.2 ). table 887. interrupt set-enable register 0 register (iser0 - address 0xe000 e100) bit description bit symbol description reset value 0 ise_dac dac interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 1 ise_er event router interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 2 ise_dma xxx interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 3- reserved. 0 4- reserved. 0 5 ise_ethernet ethernet interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 6 ise_sdio sdio interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 7 ise_lcd lcd interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 8 ise_usb0 usb0 in terrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 9 ise_usb1 usb1 in terrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 10 ise_sct sct interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 11 ise_rit rit interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 12 ise_timer0 timer0 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 943 of 1164 nxp semiconductors UM10430 chapter 42: appendix 13 ise_timer1 timer1 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 14 ise_timer2 timer2 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 15 ise_timer3 timer3 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 16 ise_motocon pwm motoconpwm interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 17 ise_adc0 adc0 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 18 ise_i2c0 i2c0 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 19 ise_i2c1 i2c1 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 20 - reserved. 0 21 ise_adc1 adc1 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 22 ise_ssp0 ssp0 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 23 ise_usart0 usart0 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 24 ise_uart1 uart1 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 25 ise_usart2 usart2 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 26 ise_usart3 usart3 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 table 887. interrupt set-enable register 0 register (iser0 - address 0xe000 e100) bit description ?continued bit symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 944 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.8.2 interrupt clear-enable register 0 the icer0 register allows disabling the first 32 peripheral interrupts, or for reading the enabled state of those interrupts. enabling inte rrupts is done through the iser0 register ( section 42.1.8.1 ). 27 ise_i2s is2 interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 28 ise_aes aes interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 29 ise_spifi spifi interrupt enable. write: writing 0 has no effect, writing 1 enables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 31:30 - reserved. 0 table 887. interrupt set-enable register 0 register (iser0 - address 0xe000 e100) bit description ?continued bit symbol description reset value table 888. interrupt clear-enable register 0 (icer0 - address 0xe000 e180) bit description bit symbol description reset value 0 ice_dac dac interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 1 ice_er event router interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 2 ice_dma dma interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 4:3 - reserved 0 5 ice_ethernet ethernet interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 6 ice_sdio sdio interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 7 ice_lcd lcd interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 8 ice_usb0 usb0 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 945 of 1164 nxp semiconductors UM10430 chapter 42: appendix 9 ice_usb1 usb1 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 10 ice_sct sct interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 11 ice_rit xxx interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 12 ice_timer0 timer0 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 13 ice_timer1 timer1 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 14 ice_timer2 timer2 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 15 ice_timer3 timer3 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 16 ice_motocon pwm motoconpwm interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 17 ice_adc0 adc0 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 18 ice_i2c0 i2c0 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 19 ice_i2c1 i2c1 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 20 - reserved. 0 21 ice_adc1 adc1 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 22 ice_ssp0 ssp0 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 table 888. interrupt clear-enable register 0 (icer0 - address 0xe000 e180) bit description ?continued bit symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 946 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.8.3 interrupt set-pending register 0 register the ispr0 register allows setting the pending st ate of the first 32 peripheral interrupts, or for reading the pending state of those interrupts . clearing the pending state of interrupts is done through the icpr0 register ( section 42.1.8.4 ). 23 ice_ssp1 ssp1 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 24 ice_usart0 usart0 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 25 ice_uart1 uart1 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 26 ice_usart2 usart2 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 27 ice_usart3 usart3 interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 28 ice_i2s i2s interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 29 ice_aes aes interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 30 ice_spifi spifi interrupt disable. write: writing 0 has no effect, writing 1 disables the interrupt. read: 0 indicates that the interrupt is disabled, 1 indicates that the interrupt is enabled. 0 31: 30 - reserved. 0 table 888. interrupt clear-enable register 0 (icer0 - address 0xe000 e180) bit description ?continued bit symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 947 of 1164 nxp semiconductors UM10430 chapter 42: appendix table 889. interrupt set-pending register 0 register (ispr0 - address 0xe000 e200) bit description bit symbol description reset value 0 isp_dac dac interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 1 isp_er event router interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 2 isp_dma dma interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 4:3 - xxx interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 5 isp_ethernet ethernet interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 6 isp_sdio sdio interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 7 isp_lcd lcd interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 8 isp_usb0 usb0 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 9 isp_usb1 usb1 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 10 isp_sct sct interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 11 isp_rit rit interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 12 isp_timer0 timer0 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 13 isp_timer1 timer1 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 14 isp_timer2 timer2 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 948 of 1164 nxp semiconductors UM10430 chapter 42: appendix 15 isp_timer3 timer3 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 16 isp_motocon pwm motoconpwm interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 17 isp_adc0 adc0 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 18 isp_i2c0 i2c0 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 19 isp_i2c1 i2c1 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 20 - reserved. 0 21 isp_adc1 adc1 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 22 isp_ssp0 ssp0 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 23 isp_ssp1 ssp1 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 24 isp_usart0 usart0 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 25 isp_uart1 uart1 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 26 isp_usart2 usart2 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 27 isp_usart3 usart3 interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 28 isp_i2s i2s interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 table 889. interrupt set-pending register 0 register (ispr0 - address 0xe000 e200) bit description ?continued bit symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 949 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.8.4 interrupt clear-pending register 0 register the icpr0 register allows clearing the pending state of the peripheral interrupts, or for reading the pending state of those interrupts. setting the pending state of interrupts is done through the ispr0 register ( section 42.1.8.3 ). 29 isp_aes aes interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 30 isp_spifi spifi interrupt pending set. write: writing 0 has no effect, writing 1 changes the interrupt state to pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 31: 30 - reserved 0 table 889. interrupt set-pending register 0 register (ispr0 - address 0xe000 e200) bit description ?continued bit symbol description reset value table 890. interrupt clear-pending register 0 register (icpr0 - address 0xe000 e280) bit description bit symbol description reset value 0 icp_dac dac interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 1 icp_er event router interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 2 icp_dma dma interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 4:3 - reserved. 0 5 icp_ethernet ethernet interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 6 icp_sdio sdio interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 7 icp_lcd lcd interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 8 icp_usb0 usb0 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 9 icp_usb1 usb1interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 950 of 1164 nxp semiconductors UM10430 chapter 42: appendix 10 icp_sct sct interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 11 icp_rit rit interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 12 icp_timer0 timer0 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 13 icp_timer1 timer1 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 14 icp_timer2 timer2 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 15 icp_timer3 timer3 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 16 icp_motocon pwm motoconpwm interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 17 icp_adc0 adc0 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 18 icp_i2c0 i2c0 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 19 icp_i2c1 i2c1 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 20 - reserved. 0 21 icp_adc1 adc1 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 22 icp_ssp0 ssp0 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 23 icp_ssp1 ssp1 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 table 890. interrupt clear-pending register 0 register (icpr0 - address 0xe000 e280) bit description ?continued bit symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 951 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.8.5 interrupt active bit register 0 the iabr0 register is a read-onl y register that allows reading the active state of the first 32 peripheral interrupts. this allows determining which peripherals are asserting an interrupt to the nvic. an interrupt may also be pending if enabled. 24 icp_usart0 usart0 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 25 icp_uart1 uart1 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 26 icp_usart2 usart2 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 27 icp_usart3 usart3 interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 28 icp_i2s i2s interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 29 icp_aes aes interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 30 icp_spifi spifi interrupt pending clear. write: writing 0 has no effect, writing 1 changes the interrupt state to not pending. read: 0 indicates that the interrupt is not pending, 1 indicates that the interrupt is pending. 0 31: 30 - reserved. 0 table 890. interrupt clear-pending register 0 register (icpr0 - address 0xe000 e280) bit description ?continued bit symbol description reset value table 891. interrupt active bit register 0 (i abr0 - address 0xe000 e300) bit description bit symbol description reset value 0 iab_dac dac interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 1 iab_er event router interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 2 iab_dma dma interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 4:3 - 0 5 iab_etherne t ethernet interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 6 iab_sdio sdio interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 952 of 1164 nxp semiconductors UM10430 chapter 42: appendix 7 iab_lcd lcd interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 8 iab_usb0 usb0 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 9 iab_usb1 usb1 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 10 iab_sct sct interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 11 iab_rit rit interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 12 iab_timer0 timer0 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 13 iab_timer1 timer1 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 14 iab_timer2 timer2 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 15 iab_timer3 timer3 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 16 iab_motoco npwm motoconpwm interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 17 iab_adc0 adc0 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 18 iab_i2c0 i2c0 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 19 iab_i2c1 i2c1 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 20 - reserved. 0 21 iab_adc1 adc1 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 22 iab_ssp0 ssp0 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 23 iab_ssp1 ssp1 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 24 iab_usart0 usart0 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 25 iab_uart1 uart1 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 26 iab_usart2 usart2 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 27 iab_usart3 usart3 interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 table 891. interrupt active bit register 0 (i abr0 - address 0xe000 e300) bit description ?continued bit symbol description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 953 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.8.6 interrupt priority register 0 the ipr0 register controls the priority of the first 4 peripheral interrupts. each interrupt can have one of 32 priorities, where 0 is the highest priority. 42.1.8.7 interrupt priority register 1 the ipr1 register controls the priority of th e second group of 4 peripheral interrupts. each interrupt can have one of 32 prioriti es, where 0 is the highest priority. 28 iab_i2s i2s interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 29 iab_aes aes interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 30 iab_spifi spifi interrupt active. read: 0 indicates that the interrupt is not active, 1 indicates that the interrupt is active. 0 31: 30 - reserved. 0 table 891. interrupt active bit register 0 (i abr0 - address 0xe000 e300) bit description ?continued bit symbol description reset value table 892. interrupt priority register 0 (ipr0 - address 0xe000 e400) bit description bit symbol description reset value 2:0 - reserved. these bits ignore writes, and read as 0. 0 7:3 ip_dac dac interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 10:8 - reserved.these bits ignore writes, and read as 0. 0 15:11 ip_er event router interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 18:16 - these bits ignore writes, and read as 0. 0 23:19 ip_dma dma interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 26:24 - reserved.these bits ignore writes, and read as 0. 0 31:27 - reserved. - table 893. interrupt priority register 1 (ipr1 - address 0xe000 e404) bit description bit symbol description reset value 2:0 - reserved.these bits ignore writes, and read as 0. 0 7:3 - reserved. 0 10:8 - reserved.these bits ignore writes, and read as 0. 0 15:11 ip_ether net ethernet interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 18:16 - reserved.these bits ignore writes, and read as 0. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 954 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.8.8 interrupt priority register 2 the ipr2 register controls the priority of t he third group of 4 peripheral interrupts. each interrupt can have one of 32 prioriti es, where 0 is the highest priority. 42.1.8.9 interrupt priority register 3 the ipr3 register controls the priority of t he fourth group of 4 peripheral interrupts. each interrupt can have one of 32 prioriti es, where 0 is the highest priority. 23:19 ip_sdio sdio interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 26:24 - reserved.these bits ignore writes, and read as 0. 0 31:27 ip_lcd lcd interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 table 893. interrupt priority register 1 (ipr1 - address 0xe000 e404) bit description ?continued bit symbol description reset value table 894. interrupt priority register 2 (ipr2 - address 0xe000 e408) bit description bit symbol description reset value 2:0 - reserved.these bits ignore writes, and read as 0. 0 7:3 ip_usb0 usb0 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 10:8 - reserved.these bits ignore writes, and read as 0. 0 15:11 ip_usb1 usb1 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 18:16 - reserved.these bits ignore writes, and read as 0. 0 23:19 ip_sct sct interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 26:24 - reserved.these bits ignore writes, and read as 0. 0 31:27 ip_rit rit interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 table 895. interrupt priority register 3 (ipr3 - address 0xe000 e40c) bit description bit symbol description reset value 2:0 - reserved.these bits ignore writes, and read as 0. 0 7:3 ip_timer0 timer0 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 10:8 - reserved.these bits ignore writes, and read as 0. 0 15:11 ip_timer1 timer1 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 18:16 - reserved.these bits ignore writes, and read as 0. 0 23:19 ip_timer2 timer2 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 26:24 - reserved.these bits ignore writes, and read as 0. 0 31:27 ip_timer3 timer3 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 955 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.8.10 interrupt priority register 4 the ipr4 register controls the priority of t he fifth group of 4 peripheral interrupts. each interrupt can have one of 32 prioriti es, where 0 is the highest priority. 42.1.8.11 interrupt priority register 5 the ipr5 register controls the priority of t he sixth group of 4 peripheral interrupts. each interrupt can have one of 32 prioriti es, where 0 is the highest priority. 42.1.8.12 interrupt priority register 6 the ipr6 register controls the priority of the seventh group of 4 peripheral interrupts. each interrupt can have one of 32 prioriti es, where 0 is the highest priority. table 896. interrupt priority register 4 (ipr4 - address 0xe000 e410) bit description bit symbol description reset value 2:0 - reserved.these bits ignore writes, and read as 0. 0 7:3 ip_moto conpwm motoconpwm interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 10:8 - reserved.these bits ignore writes, and read as 0. 0 15:11 ip_adc0 adc0 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 18:16 - reserved.these bits ignore writes, and read as 0. 0 23:19 ip_i2c0 i2c0 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 26:24 - reserved.these bits ignore writes, and read as 0. 0 31:27 ip_i2c1 i2c1 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 table 897. interrupt priority register 5 (ipr5 - address 0xe000 e414) bit description bit symbol description reset value 2:0 - reserved.these bits ignore writes, and read as 0. 0 7:3 - reserved. 0 10:8 - reserved.these bits ignore writes, and read as 0. 0 15:11 ip_adc1 adc1 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 18:16 - reserved.these bits ignore writes, and read as 0. 0 23:19 ip_ssp0 ssp0 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 26:24 - reserved.these bits ignore writes, and read as 0. 0 31:27 ip_ssp1 ssp1 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 table 898. interrupt priority register 6 (ipr6 - address 0xe000 e418) bit description bit symbol description reset value 2:0 - reserved.these bits ignore writes, and read as 0. 0 7:3 ip_usart0 usart0 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 10:8 - reserved.these bits ignore writes, and read as 0. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 956 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.1.8.13 interrupt priority register 7 the ipr7 register controls the priority of the eighth group of 4 peripheral interrupts. each interrupt can have one of 32 prioriti es, where 0 is the highest priority. 42.1.8.14 software trigger interrupt register (stir - 0xe000 ef00) the stir register provides an alternate way for software to generate an interrupt, in addition to using the ispr registers. th is mechanism can only be used to generate peripheral interrupts, not system exceptions. by default, only privileged software can writ e to the stir register. unprivileged software can be given this ab ility if privileged software sets the usersetmpend bit in the ccr register. 15:11 ip_uart1 uart1 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 18:16 - reserved.these bits ignore writes, and read as 0. 0 23:19 ip_usart2 usart2 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 26:24 - reserved.these bits ignore writes, and read as 0. 0 31:27 ip_usart3 usart3 interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 table 898. interrupt priority register 6 (ipr6 - address 0xe000 e418) bit description bit symbol description reset value table 899. interrupt priority register 7 (ipr7 - address 0xe000 e41c) bit description bit symbol description reset value 2:0 - reserved.these bits ignore writes, and read as 0. 0 7:3 ip_i2s i2s interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 10:8 - reserved.these bits ignore writes, and read as 0. 0 15:11 ip_aes aes interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 18:16 - reserved.these bits ignore writes, and read as 0. 0 23:19 ip_spifi spifi interrupt priority. 0 = highest priority. 31 (0x1f) = lowest priority. 0 31:24 - reserved.these bits ignore writes, and read as 0. 0 table 900. software trigger interrupt register (stir - address 0xe000 ef00) bit description bit symbol description reset value 8:0 intid writing a value to this field generates an interrupt for the specified interrupt id (see table 885 ). 31:9 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 957 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.2 lpc1850/30/20/10 rev ?-? event router 42.2.1 how to read this chapter remark: the event router controls various event inputs to the nvic and the wake-up process. the available event router sources vary for different parts. ? ethernet: available on lpc1850/30. ? usb0: available on lpc1850/30/20. ? usb1: available on lpc1850/30. 42.2.2 basic configuration 42.2.3 general description the event router is used to process wake -up events such as certain interrupts and external or internal inputs for wake-up from any of the low power modes (sleep, deep-sleep, power-down, and deep power-down modes). the event router has multiple event inputs from various peripherals. when th e proper edge detection is set in the edge configuration register, the event router can wake up the part or can raise an interrupt in the nvic. each event input to the event router can be co nfigured to trigger an output signal on rising or falling edges or on high or low levels. the ev ent router combines all events to an output signal which is used as follows: ? create an interrupt if the event rout er interrupt is en abled in the nvic. ? send a wake-up signal to the power manage ment unit to wake up from deep-sleep, power-down, and deep power-down modes. ? send a wake-up signal to ccu1 and ccu2 for waking up from sleep mode (see section 14.5.3 ). remark: the atimer, rtc, bod, wdt, can and qei events are routed through the event router and have no direct connection to the nvic. when proper edge detection in the event router is set for the peripheral events , the event router can generate an interrupt in the nvic. table 901. event router clocking and power control base clock branch clock maximum frequency clock to event router base_ m3_clk clk_m3_bus 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 958 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.2.4 event router inputs 42.2.5 pin description 42.2.6 register description table 902. event router inputs event # source notes 0 wakeup0 wakeup0 pin 1 wakeup1 wakeup1 pin 2 wakeup2 wakeup2 pin 3 wakeup3 wakeup3 pin 4 alarm timer alarm timer interrupt 5 rtc rtc interrupt 6 bod bod interrupt 7 wwdt wwdt interrupt 8 ethernet wake-up packet indicator 9 usb0 wake-up request 10 usb1 ahb_needclk signal 11 - reserved 12 c_can c_can interrupt 13 combined timer output 2 output 2 of the combined timer (ored output of sct output 2 and the match channel 2 of timer 0). see figure 178 . 14 combined timer output 6 output 6 of the combined timer (ored output of sct output 6 and the match channel 2 of timer 1). see figure 178 . 15 qei qei interrupt 16 combined timer output 14 output 14 of the combined timer (ored output of sct output 14 and the match channel 2 of timer 3). see figure 178 . 17 - reserved 18 - reserved 19 reset table 903. event router pin description pin direction description wakeup0/1/2/3 i external wake-up input ; can raise an interrupt and can cause wake-up from any of the low power modes. table 904. register overview: event router (base address 0x4004 4000) name access address offset description reset value hilo r/w 0x000 level configuration register 0x000 edge r/w 0x004 edge configuration 0x000 - - 0x008 - 0xfd4 reserved - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 959 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.2.6.1 level configuration register this register works in combination with the edge configuration register edge (see table 907 ) to configure the level and edge detection for each input to the event router. clr_en w 0xfd8 event clear enable register 0x0 set_en w 0xfdc event set enable register 0x0 status r 0xfe0 status register 0x0 enable r 0xfe4 enable register 0x0 clr_stat w 0xfe8 clear register 0x0 set_stat w 0xfec set register 0x0 table 904. register overview: event router (base address 0x4004 4000) name access address offset description reset value table 905. level configuration register (hilo - address 0x4004 4000) bit description bit symbol value description reset value 0 wakeup0_l level detect mode for wakeup0 event. 0 0 detect low level if bit 0 in th e edge register is 0. detect falling edge if bit 0 in the edge register is 1. 1 detect high level if bit 0 in the edge register is 0. detect rising edge if bit 0 in the edge register is 1. 1 wakeup1_l level detect mode for wakeup1 event. the corresponding bit in the edge register must be 0. 0 0 detect low level if bit 1 in the edge register is 0. 1 detect high level if bit 1 in the edge register is 0. detect rising edge if bit 1 in the edge register is 1. 2 wakeup2_l level detect mode for wakeup2 event. 0 0 detect low level if bit 2 in th e edge register is 0. detect falling edge if bit 2 in the edge register is 1. 1 detect high level if bit 2 in the edge register is 0. detect rising edge if bit 2 in the edge register is 1. 3 wakeup3_l level detect mode for wakeup3 event. 0 0 detect low level if bit 3 in th e edge register is 0. detect falling edge if bit 3 in the edge register is 1. 1 detect high level if bit 3 in the edge register is 0. detect rising edge if bit 3 in the edge register is 1. 4 atimer_l level detect mode for alarm timer event. 0 0 detect low level if bit 4 in th e edge register is 0. detect falling edge if bit 4 in the edge register is 1. 1 detect high level if bit 4 in the edge register is 0. detect rising edge if bit 4 in the edge register is 1. 5 rtc_l level detect mode for rtc event. 0 0 detect low level if bit 5 in th e edge register is 0. detect falling edge if bit 5 in the edge register is 1. 1 detect high level if bit 5 in the edge register is 0. detect rising edge if bit 5 in the edge register is 1. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 960 of 1164 nxp semiconductors UM10430 chapter 42: appendix 6 bod_l level detect mode for bod event. 0 0 detect low level if bit 6 in th e edge register is 0. detect falling edge if bit 6 in the edge register is 1. 1 detect high level if bit 6 in the edge register is 0. detect rising edge if bit 6 in the edge register is 1. 7 wwdt_l level detect mode for wwdtd event. 0 0 detect low level if bit 7 in th e edge register is 0. detect falling edge if bit 7 in the edge register is 1. 1 detect high level if bit 7 in the edge register is 0. detect rising edge if bit 7 in the edge register is 1. 8 eth_l level detect mode for ethernet event. 0 0 detect low level if bit 8 in th e edge register is 0. detect falling edge if bit 8 in the edge register is 1. 1 detect high level if bit 8 in the edge register is 0. detect rising edge if bit 8 in the edge register is 1. 9 usb0_l level detect mode for usb0 event. 0 0 detect low level if bit 9 in th e edge register is 0. detect falling edge if bit 9 in the edge register is 1. 1 detect high level if bit 9 in the edge register is 0. detect rising edge if bit 9 in the edge register is 1. 10 usb1_l level detect mode for usb1 event. 0 0 detect low level if bit 10 in the edge register is 0. detect falling edge if bit 10 in the edge register is 1. 1 detect high level if bit 10 in the edge register is 0. detect rising edge if bit 10 in the edge register is 1. 11 - - reserved. 12 can_l level detect mode for c_can event. 0 0 detect low level if bit 12 in the edge register is 0. detect falling edge if bit 12 in the edge register is 1. 1 detect high level if bit 12 in the edge register is 0. detect rising edge if bit 12 in the edge register is 1. 13 tim2_l level detect mode for combined timer output 2 event. 0 0 detect low level if bit 13 in the edge register is 0. detect falling edge if bit 13 in the edge register is 1. 1 detect high level if bit 13 in the edge register is 0. detect rising edge if bit 13 in the edge register is 1. 14 tim6_l level detect mode for combined timer output 6 event. 0 0 detect low level if bit 14 in the edge register is 0. detect falling edge if bit 14 in the edge register is 1. 1 detect high level if bit 14 in the edge register is 0. detect rising edge if bit 14 in the edge register is 1. table 905. level configuration register (hilo - address 0x4004 4000) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 961 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.2.6.2 edge configuration register this register works in combination with the level configuration register hilo (see table 905 ) to configure the level or edge detecti on for each input to the event router. the edge configuration register determines wh ether the event router responds to a level change (edgen=1), or a constant level (edgen=0). the hilon bit determines a response to a rising edge (hil on=1) or a falling edge (hilon=0). when a high level detect is active, the event router status bits cannot be cleared until the signal is low. when a rising edge detect is active, the event router status bit can be cleared right after the event has occurred. 15 qei_l level detect mode for qei event. 0 0 detect low level if bit 15 in the edge register is 0. detect falling edge if bit 15 in the edge register is 1. 1 detect high level if bit 15 in the edge register is 0. detect rising edge if bit 15 in the edge register is 1. 16 tim14_l level detect mode for combined timer output 14 event. 0 0 detect low level if bit 16 in the edge register is 0. detect falling edge if bit 16 in the edge register is 1. 1 detect high level if bit 16 in the edge register is 0. detect rising edge if bit 16 in the edge register is 1. 18:17 - - reserved. 19 reset_l level detect mo de for reset event. 0 0 detect low level if bit 17 in the edge register is 0. detect falling edge if bit 17 in the edge register is 1. 1 detect high level if bit 17 in the edge register is 0. detect rising edge if bit 17 in the edge register is 1. 31:20 - - reserved. table 905. level configuration register (hilo - address 0x4004 4000) bit description bit symbol value description reset value table 906. edge and hilo combined register settings hilon edgen description 0 0 detect low level 0 1 detect falling edge 1 0 detect high level 1 1 detect rising edge table 907. edge configuration register (edge - address 0x4004 4004) bit description bit symbol value description reset value 0 wakeup0_e edge detect mode for wakeup0 event. 0 0 level detect. 1 edge detect. detect falling edge if bit 0 in the hilo register is 0. detect rising edge if bit 0 in the hilo register is 1. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 962 of 1164 nxp semiconductors UM10430 chapter 42: appendix 1 wakeup1_e edge/level detect m ode for wakeup1 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 1 in the hilo register is 0. detect rising edge if bit 1 in the hilo register is 1. 2 wakeup2_e edge/level detect m ode for wakeup2 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 2 in the hilo register is 0. detect rising edge if bit 2 in the hilo register is 1. 3 wakeup3_e edge/level detect m ode for wakeup3 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 30 in the hilo register is 0. detect rising edge if bit 3 in the hilo register is 1. 4 atimer_e edge/level detect mode for alarm timer event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 4 in the hilo register is 0. detect rising edge if bit 4 in the hilo register is 1. 5 rtc_e edge/level detect mode for rtc event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 5 in the hilo register is 0. detect rising edge if bit 5 in the hilo register is 1. 6 bod_e edge/level detect mode for bod event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 6 in the hilo register is 0. detect rising edge if bit 6 in the hilo register is 1. 7 wwdt_e edge/level detect mode for wwdtd event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 7 in the hilo register is 0. detect rising edge if bit 7 in the hilo register is 1. table 907. edge configuration register (edge - address 0x4004 4004) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 963 of 1164 nxp semiconductors UM10430 chapter 42: appendix 8 eth_e edge/level detect mode for ethernet event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 8 in the hilo register is 0. detect rising edge if bit 8 in the hilo register is 1. 9 usb0_e edge/level detect mode for usb0 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 9 in the hilo register is 0. detect rising edge if bit 9 in the hilo register is 1. 10 usb1_e edge/level detect mode for usb1 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 10 in the hilo register is 0. detect rising edge if bit 10 in the hilo register is 1. 11 - - reserved. 12 can_e edge/level detect mode for c_can event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 12 in the hilo register is 0. detect rising edge if bit 12 in the hilo register is 1. 13 tim2_e edge/level detect mode for combined timer output 2 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 13 in the hilo register is 0. detect rising edge if bit 13 in the hilo register is 1. 14 tim6_e edge/level detect mode for combined timer output 6 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 14 in the hilo register is 0. detect rising edge if bit 14 in the hilo register is 1. 15 qei_e edge/level detect mode for qei interrupt signal. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 15 in the hilo register is 0. detect rising edge if bit 15 in the hilo register is 1. table 907. edge configuration register (edge - address 0x4004 4004) bit description bit symbol value description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 964 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.2.6.3 interrupt clear enable register 16 tim14_e edge/level detect mode for combined timer output 14 event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 16 in the hilo register is 0. detect rising edge if bit 16 in the hilo register is 1. 18:17 - - reserved. 19 reset_e edge/level detect mode for reset event. the corresponding bit in the edge register must be 0. 0 0 level detect. 1 edge detect. detect falling edge if bit 19 in the hilo register is 0. detect rising edge if bit 19 in the hilo register is 1. 31:20 - - reserved. table 907. edge configuration register (edge - address 0x4004 4004) bit description bit symbol value description reset value table 908. interrupt clear enable register (clr_en - address 0x4004 4fd8) bit description bit symbol description reset value 0 wakeup0_clren writing a 1 to this bit clears the event enable bit 0 in the enable register. - 1 wakeup1_clren writing a 1 to this bit clears the event enable bit 1 in the enable register. - 2 wakeup2_clren writing a 1 to this bit clears the event enable bit 2 in the enable register. - 3 wakeup3_clren writing a 1 to this bit clears the event enable bit 3 in the enable register. - 4 atimer_clren writing a 1 to this bit clears the event enable bit 4 in the enable register. - 5 rtc_clren writing a 1 to this bit clears the event enable bit 5 in the enable register. - 6 bod_clren writing a 1 to this bit clears the event enable bit 6 in the enable register. - 7 wwdt_clren writing a 1 to this bit clears the event enable bit 7 in the enable register. - 8 eth_clren writing a 1 to this bit clears the event enable bit 8 in the enable register. - 9 usb0_clren writing a 1 to this bit clears the event enable bit 9 in the enable register. - 10 usb1_clren writing a 1 to this bit clears the event enable bit 10 in the enable register. - 11 - reserved. - 12 can_clren writing a 1 to this bit clears the event enable bit 12 in the enable register. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 965 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.2.6.4 event set enable register 13 tim2_clren writing a 1 to this bit clears the event enable bit 13 in the enable register. - 14 tim6_clren writing a 1 to this bit clears the event enable bit 14 in the enable register. - 15 qei_clren writing a 1 to this bit clears the event enable bit 15 in the enable register. - 16 tim14_clren writing a 1 to this bit clears the event enable bit 16 in the enable register. - 18:17 - reserved. - 19 reset_clren writing a 1 to this bit cl ears the event enable bit 19 in the enable register. - 31:20 - reserved. - table 908. interrupt clear enable register (clr_en - address 0x4004 4fd8) bit description bit symbol description reset value table 909. event set enable register (set_en - address 0x4004 4fdc) bit description bit symbol description reset value 0 wakeup0_seten writing a 1 to this bit sets the event enable bit 0 in the enable register. - 1 wakeup1_seten writing a 1 to this bit sets the event enable bit 1 in the enable register. - 2 wakeup2_seten writing a 1 to this bit sets the event enable bit 2 in the enable register. - 3 wakeup3_seten writing a 1 to this bit sets the event enable bit 3 in the enable register. - 4 atimer_seten writing a 1 to this bit sets the event enable bit 4 in the enable register. - 5 rtc_seten writing a 1 to this bit sets the event enable bit 5 in the enable register. - 6 bod_seten writing a 1 to this bit sets the event enable bit 6 in the enable register. - 7 wwdt_seten writing a 1 to this bit sets the event enable bit 7 in the enable register. - 8 eth_seten writing a 1 to this bit sets the event enable bit 8 in the enable register. - 9 usb0_seten writing a 1 to this bit sets the event enable bit 9 in the enable register. - 10 usb1_seten writing a 1 to this bit sets the event enable bit 10 in the enable register. - 11 - reserved. - 12 can_seten writing a 1 to this bit sets the event enable bit 12 in the enable register. - 13 tim2_seten writing a 1 to this bit sets the event enable bit 13 in the enable register. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 966 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.2.6.5 event status register 14 tim6_seten writing a 1 to this bit sets the event enable bit 14 in the enable register. - 15 qei_seten writing a 1 to this bit sets the event enable bit 15 in the enable register. - 16 tim14_seten writing a 1 to this bit sets the event enable bit 16 in the enable register. - 18:17 - reserved. - 19 reset_seten writing a 1 to this bit sets the event enable bit 19 in the enable register. - 31:20 - reserved. - table 909. event set enable register (set_en - address 0x4004 4fdc) bit description bit symbol description reset value table 910. interrupt status register (status - address 0x4004 4fe0) bit description bit symbol description reset value 0 wakeup0_st a 1 in this bit shows that the wakeup0 event has been raised. - 1 wakeup1_st a 1 in this bit shows that the wakeup1 event has been raised. - 2 wakeup2_st a 1 in this bit shows that the wakeup2 event has been raised. - 3 wakeup3_st a 1 in this bit shows that the wakeup3 event has been raised. - 4 atimer_st a 1 in this bit shows that the atimer event has been raised. - 5 rtc_st a 1 in this bit shows that the rtc event has been raised. - 6 bod_st a 1 in this bit shows that the bod event has been raised. - 7 wwdt_st a 1 in this bit shows that the wwdt event has been raised. - 8 eth_st a 1 in this bit shows that the ethernet event has been raised. - 9 usb0_st a 1 in this bit shows that the usb0 event has been raised. - 10 usb1_st a 1 in this bit shows that the usb1 event has been raised. - 11 - reserved. - 12 can_st a 1 in this bit shows that the c_can event has been raised. - 13 tim2_st a 1 in this bit shows that the combined timer 2 output event has been raised. - 14 tim6_st a 1 in this bit shows that the combined timer 6 output event has been raised. - 15 qei_st a 1 in this bit shows that the qei event has been raised. - 16 tim14_st a 1 in this bit shows that the combined timer 14 output event has been raised. - 18:17 - reserved. - 19 reset_st a 1 in this bit shows that the event has been raised. - 31:20 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 967 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.2.6.6 event enable register table 911. event enable register (enable - address 0x4004 4fe4) bit description bit symbol description reset value 0 wakeup0_en a 1 in this bit shows that the wakeup0 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 1 wakeup1_en a 1 in this bit shows that the wakeup1 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 2 wakeup2_en a 1 in this bit shows that the wakeup2 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 3 wakeup3_en a 1 in this bit shows that the wakeup3 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 4 atimer_en a 1 in this bit shows that the atimer event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 5 rtc_en a 1 in this bit shows that the rtc event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 6 bod_en a 1 in this bit shows that the bod event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 7 wwdt_en a 1 in this bit shows that the wwdt event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 8 eth_en a 1 in this bit shows that the ethernet event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 9 usb0_en a 1 in this bit shows that the usb0 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 10 usb1_en a 1 in this bit shows that the usb1 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 11 - reserved. - 12 can_en a 1 in this bit shows that the can event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 13 tim2_en a 1 in this bit shows that the tim2 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 14 tim6_en a 1 in this bit shows that the tim6 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 15 qei_en a 1 in this bit shows that the qei event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 968 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.2.6.7 clear status register 16 tim14_en a 1 in this bit shows that the tim14 event has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 18:17 - - 19 reset_en a 1 in this bit shows th at the reset even t has been enabled. this event wakes up the chip and contributes to the event router interrupt when bit 0 = 1 in the status register. 0 31:20 - reserved. - table 911. event enable register (enable - address 0x4004 4fe4) bit description bit symbol description reset value table 912. interrupt clear status register (clr_stat - address 0x4004 4fe8) bit description bit symbol description reset value 0 wakeup0_clrst writing a 1 to this bit clears the status event bit 0 in the status register. 1 wakeup1_clrst writing a 1 to this bit clears the status event bit 1 in the status register. 2 wakeup2_clrst writing a 1 to this bit clears the status event bit 2 in the status register. 3 wakeup3_clrst writing a 1 to this bit clears the status event bit 3 in the status register. 4 atimer_clrst writing a 1 to this bit clears the status event bit 4 in the status register. 5 rtc_clrst writing a 1 to this bit clears the status event bit 5 in the status register. 6 bod_clrst writing a 1 to this bit clears the status event bit 6 in the status register. 7 wwdt_clrst writing a 1 to this bit clears the status event bit 7 in the status register. 8 eth_clrst writing a 1 to this bit clears the status event bit 8 in the status register. 9 usb0_clrst writing a 1 to this bit clears the status event bit 9 in the status register. 10 usb1_clrst writing a 1 to this bit clears the status event bit 10 in the status register. 11 - reserved. 12 can_clrst writing a 1 to this bit clears the status event bit 12 in the status register. 13 tim2_clrst writing a 1 to this bit clears the status event bit 13 in the status register. 14 tim6_clrst writing a 1 to this bit clears the status event bit 14 in the status register. 15 qei_clrst writing a 1 to this bit clears the status event bit 15 in the status register. 16 tim14_clrst writing a 1 to this bit clears the status event bit 16 in the status register. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 969 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.2.6.8 set status register 18:17 - 19 reset_clrst writing a 1 to this bit clears the status event bit 19 in the status register. 31:20 - reserved. - table 912. interrupt clear status register (clr_stat - address 0x4004 4fe8) bit description bit symbol description reset value table 913. interrupt set status register (set_stat - address 0x4004 4fec) bit description bit symbol description reset value 0 wakeup0_setst writing a 1 to this bit sets the status event bit 0 in the status register. 1 wakeup1_setst writing a 1 to this bit sets the status event bit 1 in the status register. 2 wakeup2_setst writing a 1 to this bit sets the status event bit 2 in the status register. 3 wakeup3_setst writing a 1 to this bit sets the status event bit 3 in the status register. 4 atimer_setst writing a 1 to this bit sets the status event bit 4 in the status register. 5 rtc_setst writing a 1 to this bit sets the status event bit 5 in the status register. 6 bod_setst writing a 1 to this bit sets the status event bit 6 in the status register. 7 wwdt_setst writing a 1 to this bit sets the status event bit 7 in the status register. 8 eth_setst writing a 1 to this bit sets the status event bit 8 in the status register. 9 usb0_setst writing a 1 to this bit sets the status event bit 9 in the status register. 10 usb1_setst writing a 1 to this bit sets the status event bit 10 in the status register. 11 - reserved. 12 can_setst writing a 1 to this bit sets the status event bit 12 in the status register. 13 tim2_setst writing a 1 to this bit sets the status event bit 13 in the status register. 14 tim6_setst writing a 1 to this bit sets the status event bit 14 in the status register. 15 qei_setst writing a 1 to this bit sets the status event bit 15 in the status register. 16 tim14_setst writing a 1 to this bit sets the status event bit 16 in the status register. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 970 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.3 lpc1850/30/20/10 rev ?-? creg 42.3.1 how to read this chapter remark: this chapter applies to lpc1850/30/20/10 rev ?-? only. the available peripherals vary for different parts. ? ethernet: available on lpc1850/30. ? usb0: available on lpc1850/30/20. ? usb1: available on lpc1850/30. if a peripheral is not available, the corresponding bits in the creg registers are reserved. 42.3.2 basic configuration the creg block is configured as follows: ? see ta b l e 9 2 5 for clocking and power control. ? the creg block can not be reset by software. 42.3.3 features the following settings are controlled in the configuration register block: ? bod trip settings ? oscillator output ? dma-to-peripheral muxing ? ethernet mode ? memory mapping ? timer/uart inputs ? usb0 atx in addition, the creg block contains the part id and the part configuration information. 18:17 - reserved. 19 reset_setst writing a 1 to this bit sets the status event bit 19 in the status register. 31:20 - reserved. - table 913. interrupt set status register (set_stat - address 0x4004 4fec) bit description bit symbol description reset value table 914. creg clocking and power control base clock branch clock maximum frequency creg base_m3_clk clk_m3_creg 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 971 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.3.4 register description 42.3.4.1 irc trim register table 915. register overview: configuration registers (base address 0x4004 3000) name access address offset description reset value irctrm ro 0x000 irc trim register 0x000f f2bc creg0 r/w 0x004 chip configuration register 32 khz oscillator output and bod control register. pmucon 0x008 power mode control register. 0x0000 0000 - - 0x008 - 0x0fc reserved - m3memmap r/w 0x100 arm cortex-m3 memory mapping - - 0x104 reserved - creg1 ro 0x108 chip configuration register 1 creg2 ro 0x10c chip configuration register 2 creg3 ro 0x110 chip configuration register 3 creg4 ro 0x114 chip configuration register 4 creg5 r/w 0x118 chip configuration register 5. controls jtag access. dmamux r/w 0x11c dma muxing control - - 0x120 - 0x124 reserved - etbcfg r/w 0x128 etb ram configuration 0x0000 0000 creg6 r/w 0x12c chip configuration register 6. - - 0x130 - 0x1fc reserved - chipid ro 0x200 part id - - 0x204 - 0x2fc reserved - - - 0x300 reserved - - 0x304 reserved - - 0x308 reserved - - 0x30c - 0xefc reserved - lockreg 0xf00 lock register; blo cks write access to creg registers table 916. irc trim register (irctrm, address 0x4004 3000) bit description bit symbol description reset value access 11:0 trm irc trim value 0x2bc r 19:12 - reserved 0xff r 31:20 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 972 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.3.4.2 creg0 control register 42.3.4.3 power mode control register for details on power mode selection, see section 8.2 . table 917. creg0 register (creg0, address 0x4004 3004) bit description bit symbol value description reset value access 0 en1khz enable 1 khz output 0 r/w 0 1 khz output disabled 1 1 khz output enabled 1 en32khz enable 32 khz output 0 r/w 0 32 khz output disabled 1 32 khz output enabled 2 reset32khz 32 khz oscillator reset 1 r/w 0 1 3 32khzpd 32 khz power control 1 r/w 0 32 khz oscillator powered 1 32 khz oscillator powered-down 7:4 - reserved - - 9:8 bodlvl1 bod trip level to generate an interrupt: 11 r/w 0x0 2.75 v 0x1 2.85 v 0x2 2.95 v 0x3 3.05 v 11:10 bodlvl2 bod trip level to generate a reset: 11 r/w 0x0 1.70 v 0x1 1.80 v 0x2 1.90 v 0x3 2.00 v 31:12 - reserved - - table 918. power mode control register (pmucon, address 0x4004 3008) bit description bit symbol value description reset value access 1:0 pmucon controls power mode: 0 r/w 0x0 normal 0x1 low-power 0x2 reserved 0x3 normal 31:2 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 973 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.3.4.4 arm cortex-m3 memory mapping register 42.3.4.5 creg5 control register 42.3.4.6 dma muxing register this register controls which set of peripher als is connected to the dma controller (see table 195 ). table 919. memory mapping register (m3memmap, address 0x4004 3100) bit description bit symbol description reset value access 11:0 reserved 0x000 - 31:12 m3map this is the 32 kb rom address - this is the shadow address when accessing memory at address 0x0000 0000 0x1040 0000 r/w table 920. creg5 control register (creg5, address 0x4004 3118) bit description bit symbol description reset value access 4:0 - reserved. - - 5 - reserved. 0 - 6 m3tapsel selects tap access to m3 0 r/w 7 - reserved. this bit must always be set to 0. 0 - 8 otpjtag jtag access to otp 0 r/w 31:9 - reserved. - - table 921. dma muxing register (dmamux, address 0x4004 311c) bit description bit symbol value description reset value access 1:0 dmamuxch0 selects dma to peripheral connection for dma peripheral 0: 0r/w 0x0 spifi 0x1 reserved 0x2 reserved 0x3 reserved 3:2 dmamuxch1 selects dma to peripheral connection for dma peripheral 1: 0r/w 0x0 timer 0, match channel 0 0x1 usart0 transmit 0x2 reserved 0x3 reserved 5:4 dmamuxch2 selects dma to peripheral connection for dma peripheral 2: 0r/w 0x0 timer 0, match channel 1 0x1 usart0 receive 0x2 reserved 0x3 reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 974 of 1164 nxp semiconductors UM10430 chapter 42: appendix 7:6 dmamuxch3 selects dma to peripheral connection for dma peripheral 3: 0r/w 0x0 timer 1, match channel 0 0x1 uart1 transmit 0x2 reserved 0x3 reserved 9:8 dmamuxch4 selects dma to peripheral connection for dma peripheral 4: 0r/w 0x0 timer 1, match channel 1 0x1 uart1 receive 0x2 reserved 0x3 reserved 11:10 dmamuxch5 selects dma to peripheral connection for dma peripheral 5: 0r/w 0x0 timer 2, match channel 0 0x1 usart2 transmit 0x2 reserved 0x3 reserved 13:12 dmamuxch6 selects dma to peripheral connection for dma peripheral 6: 0r/w 0x0 timer 2, match channel 1 0x1 usart2 receive 0x2 reserved 0x3 reserved 15:14 dmamuxch7 selects dma to peripheral connection for dma peripheral 7: 0r/w 0x0 timer 3, match channel 0 0x1 usart3 transmit 0x2 sct output 0 0x3 reserved 17:16 dmamuxch8 selects dma to peripheral connection for dma peripheral 8: 0r/w 0x0 timer 3, match channel 1 0x1 usart3 receive 0x2 sct output 1 0x3 reserved table 921. dma muxing register (dmamux, address 0x4004 311c) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 975 of 1164 nxp semiconductors UM10430 chapter 42: appendix 19:18 dmamuxch9 selects dma to peripheral connection for dma peripheral 9: 0r/w 0x0 ssp0 receive 0x1 i2s0 channel 0 0x2 reserved 0x3 reserved 21:20 dmamuxch10 selects dma to peripheral connection for dma peripheral 10: 0r/w 0x0 ssp0 transmit 0x1 i2s0 channel 1 0x2 reserved 0x3 reserved 23:22 dmamuxch11 selects dma to peripheral connection for dma peripheral 11: 0r/w 0x0 ssp1 receive 0x1 reserved 0x2 reserved 0x3 reserved 25:24 dmamuxch12 selects dma to peripheral connection for dma peripheral 12: 0r/w 0x0 ssp1 transmit 0x1 i2s1 channel 0 0x2 reserved 0x3 reserved 27:26 dmamuxch13 selects dma to peripheral connection for dma peripheral 13: 0r/w 0x0 adc0 0x1 aes input 0x2 reserved 0x3 reserved 29:28 dmamuxch14 selects dma to peripheral connection for dma peripheral 14: 0r/w 0x0 adc1 0x1 aes output 0x2 reserved 0x3 reserved table 921. dma muxing register (dmamux, address 0x4004 311c) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 976 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.3.4.7 etb sram configuration register this register selects the interface that is used to the 16 kb block of ram located at address 0x2000 c000. this ram memory block can be accessed either by the etb or be used as normal sram on the ahb bus. note that by default, th is memory area will be accessed by the etb. 42.3.4.8 creg6 control register this register controls vari ous aspects of the lpc18xx: ? bits 2:0 control the ethernet phy interface. the ethernet block reads this register during set-up, and therefore the ethernet must be reset after changing the phy interface. ? bits 5:4 control the input channel 7 of the combined timer inputs (see figure 178 ). input channel 7 is connected to input 7 of the sct and the cap2 channel of timer 3. ? bits 8:6 control the input mux to the timer capture channels cap1 and cap2 and the sct (see figure 178 ). these particular capture inpu ts can be either routed to the timer input pins or are connected to the us art receive/transmit wait signal in smart card mode. 31:30 dmamuxch15 selects dma to peripheral connection for dma peripheral 15: 0r/w 0x0 dac 0x1 i2s1 channel 1 0x2 reserved 0x3 reserved table 921. dma muxing register (dmamux, address 0x4004 311c) bit description ?continued bit symbol value description reset value access table 922. etb sram configuration register (etbcfg, address 0x4004 3128) bit description bit symbol value description reset value access 0 etb select sram interface 0 r/w 0 etb accesses sram at address 0x2000 c000. 1 ahb accesses sram at address 0x2000 c000. 31:1 - reserved. - - table 923. creg6 control register (creg6, address 0x4004 312c) bit description bit symbol value description reset value access 2:0 ethmode selects the ethernet mode. reset the ethernet after changing the phy interface. all other settings are reserved. r/w 0x0 mii 0x4 rmii 3 - usb0 atx override. selects usb0 rpu usage. reserved. r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 977 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.3.4.9 part id register 42.4 lpc1850/30/20/10 rev ?-? cgu 42.4.1 how to read this chapter remark: this chapter refers to the lpc1850/30/20/10 rev ?-? parts only. see chapter 9 for a description of the cgu for parts lpc1850/30/20/10 rev ?a? and all lpc18xx parts with on-chip flash. ethernet, usb0, usb1, and lcd related clo cks are not available on all packages. the sdio interface is not available. the corres ponding clock control registers are reserved. 5:4 timin7ctrl controls the input to timer 3 (cap2) and the sct (input 7): r/w 0x0 i2s0 receive mws signal 0x1 i2s0 transmit mws signal 0x2 usb0 sof signal 0x3 usb1 sof signal 6 tim1inctrl controls the muxing of the timer1 cap inputs cap1 and cap2. r/w 0 timer1 cap1 connected to pin ctin_3; timer 1 cap2 connected to ctin_4. 1 timer1 cap1 connected to usart0 transmit wait; timer 1 cap2 connected to usart0 receive wait. 7 tim2inctrl controls the muxing of the timer 2 cap inputs cap1 and cap2. r/w 0 timer2 cap1 connected to pin ctin_1; timer 2 cap2 connected to ctin_4. 1 timer2 cap1 connected to usart2 transmit wait; timer 2 cap2 connected to usart2 receive wait. 8 tim3inctrl controls the muxing of the timer 3 cap inputs cap1 and cap2. r/w 0 timer3 cap1 connected to pin ctin_6; timer 3 cap2 connected to combined timer input 7 (see bits 5:4). 1 timer2 cap1 connected to usart3 transmit wait; timer 2 cap2 connected to usart3 receive wait. 31: 9 - reserved. - - table 923. creg6 control register (creg6, address 0x4004 312c) bit description ?continued bit symbol value description reset value access table 924. part id register (chipid, address 0x4004 3200) bit description bit symbol description reset value access 31:0 id www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 978 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.2 basic configuration the cgu is configured as follows: ? see ta b l e 9 2 5 for clocking and power control. ? do not reset the cgu during normal operation. 42.4.3 features ? pll0/1 control ? oscillator control ? clock generation and clock source multiplexing ? five integer dividers 42.4.4 general description the cgu generates multiple independent clocks for the core and the peripheral blocks of the lpc18xx. each independent clock is called a base clock and itself is one of the inputs to the two clock control units (ccus) which control the branch clocks to the individual peripherals (see chapter 14 ). the cgu selects the inputs to the clock generat ors from multiple clock sources, controls the clock generation, and routes the outputs of the clock generators through the clock source bus to the output stages. each output stage provides an independent clock source and corresponds to one of the base clocks for the lpc18xx. see ta b l e 9 2 6 for a description of each base clock and table 928 for the possible clock sources for each base clock. table 925. cgu clocking and power control base clock branch clock maximum frequency cgu base_m3_clk clk_m3_bus 150 mhz fig 151. cgu and ccu0/1 block diagram 32 khz osc pll0 (audio) pll0 (usb0) idiva /4 idivb /16 idive /256 outclk1, 3 - 6, 9 - 10 (base_xxx_clk) outclk12 - 19 (base_xxx_clk) crystal osc pll1 idivc /16 idivc /16 base_safe_clk outclk20 outclk7 outclk8 outclk11 12 mhz irc enet_rx_clk enet_rx_clk enet_tx_clk lcd_clk enet_tx_clk gp_clk 7 8 cgu xtal1 rtcx1 rtcx2 xtal2 ccu1 ccu2 branch clocks to core and peripherals branch clocks to peripherals clkout wwdt www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 979 of 1164 nxp semiconductors UM10430 chapter 42: appendix the cgu contains four types of clock generators: 1. external clock inputs and internal clocks: the external clock inputs are the ethernet phy clocks and the general purpose input clock gp_clkin. the clocks from the internal oscillators are the irc and the 32 khz oscillator output clocks. these clock generators have no selectable inputs from the clock source bus and provide one clock output each to the clock source bus. 2. crystal oscillator: the crys tal oscillator is co ntrolled by the cgu. the input to the crystal oscillator are the xtal pins. the crystal oscillator creates one ou tput to the clock source bus. 3. plls: pll0 and pll1 are controlled by the cgu. each pll can select one input from the clock source bus and provides one output to the clock source bus. the input to the pll can be selected from all external and internal cloc ks and oscillators, from the other pll, and from the outputs of any of the integer dividers (see table 927 ). 4. integer dividers: each of the five integer dividers can select one input from the clock source bus and creates one divided output cl ock to the clock source bus. the input to all integer dividers can be selected from all external and internal clocks and oscillators, and from both plls . in addition, the output of the first intege r divider can be selected as an input to a ll other integer dividers (see table 927 ). the integer dividers have different programmable division ratios: ? integer divider a: maximum division factor = 4 (see table 939 ). ? integer dividers b, c, d: maximum division factor = 16 (see table 940 ). ? integer divider e: maximum division factor = 256 (see table 941 ). the output stages select a clock source from the clock source bus for each base clock (see table 928 ). except for the base clocks to the wwdt (base_safe_clk) and usb0 (base_usb0_clk), the clock source for each output stage can be any of the external and internal clocks and oscillators directly or one of the pll output s or any of the outputs of the integer dividers. table 926. cgu0 base clocks number name frequency [1] description 0 base_safe_clk 12 mhz base safe clock (always on) for wdt 1 base_usb0_clk 480 mhz base clock for usb0 2 - - reserved. 3 base_usb1_clk 150 mhz base clock for usb1 4 base_m3_clk 150 mhz system base clock for arm cortex-m3 core and apb peripheral blocks #0 and #2 5 base_spifi_clk 150 mhz base clock for spifi 6 - - reserved. 7 base_phy_rx_clk 75 mhz base clock for ethernet phy rx 8 base_phy_tx_clk 75 mhz base clock for ethernet phy tx 9 base_apb1_clk 150 mhz base clock for apb peripheral block # 1 10 base_apb3_clk 150 mhz base clock for apb peripheral block # 3 11 base_lcd_clk 150 mhz base clock for lcd 12 - - reserved www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 980 of 1164 nxp semiconductors UM10430 chapter 42: appendix [1] maximum frequency that guarantees stable operation of the lpc18xx. table 927 shows all available input clock sources for each clock generator. 13 base_sdio_clk 150 mhz base cl ock for sdio card reader 14 base_ssp0_clk 150 mhz base clock for ssp0 15 base_ssp1_clk 150 mhz base clock for ssp1 16 base_uart0_clk 150 mhz base clock for uart0 17 base_uart1_clk 150 mhz base clock for uart1 18 base_uart2_clk 150 mhz base clock for uart2 19 base_uart3_clk 150 mhz base clock for uart3 20 base_out_clk 150 mhz base clock for clkout pin table 927. clock sources for clock generators with selectable inputs clock generators clock sources pll0 (usb0) pll1 idiva /4 idivb /16 idivc /16 idivd /16 idive /256 32 khz oscillator yes yes yes yes yes yes yes irc 12 mhz yes yes yes yes yes yes yes enet_rx_clk yes yes yes yes yes yes yes enet_tx_clk yes yes yes yes yes yes yes gp_clkin yes yes yes yes yes yes yes crystal oscillator yes yes yes yes yes yes yes pll0 (usb0) no yes yes no no no no pll1 yes no yes yes yes yes yes idiva yes yes no yes yes yes yes idivb yes yes no no no no no idivc yes yes no no no no no idivd yes yes no no no no no idive yes yes no no no no no table 926. cgu0 base clocks ?continued number name frequency [1] description table 928. clock sources for output stages output stages (d = default clock source) clock sources base_safe_clk base_usb0_clk reserved base_usb1_clk base_m3_clk base_spifi_clk reserved base_phy_rx_clk base_phy_tx_clk base_apb1_clk base_apb3_clk base_lcd_clk reserved base_sdio_clk base_ssp0_clk base_ssp1_clk base_uart0_clk base_uart1_clk base_uart2_clk base_uart3_clk base_out_clk 32 khz oscillator no no - yes yes yes - yes y es yes yes yes - yes yes yes yes yes yes yes yes irc 12 mhz dno- ddd- ddddd- dddddddd enet_rx_clk no no - yes yes yes - yes yes yes yes yes - yes yes yes yes yes yes yes yes www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 981 of 1164 nxp semiconductors UM10430 chapter 42: appendix enet_tx_clk no no - yes yes yes - yes yes yes yes yes - yes yes yes yes yes yes yes yes gp_clkin no no - yes yes yes - yes yes yes yes yes - yes yes yes yes yes yes yes yes crystal oscillator no no - yes yes yes - yes yes yes yes yes - yes yes yes yes yes yes yes yes pll0 (usb0) nod - nonono- nonononono- nononononononoyes pll1 no no - yes yes yes - yes yes yes yes yes - yes yes yes yes yes yes yes yes idiva no no - yes yes yes - yes yes yes yes yes - yes yes yes yes yes yes yes yes idivb no no - yes yes yes - yes yes yes yes yes - yes yes yes yes yes yes yes yes idivc no no - yes yes yes - yes yes yes yes yes - yes yes yes yes yes yes yes yes idivd no no - yes yes yes - yes yes yes yes yes - yes yes yes yes yes yes yes yes idive no no - yes yes yes - yes yes yes yes yes - yes yes yes yes yes yes yes yes table 928. clock sources for output stages output stages (d = default clock source) clock sources base_safe_clk base_usb0_clk reserved base_usb1_clk base_m3_clk base_spifi_clk reserved base_phy_rx_clk base_phy_tx_clk base_apb1_clk base_apb3_clk base_lcd_clk reserved base_sdio_clk base_ssp0_clk base_ssp1_clk base_uart0_clk base_uart1_clk base_uart2_clk base_uart3_clk base_out_clk fig 152. cgu block diagram 32 khz osc pll0 idiva /4 idivb /16 idive /256 outclk_2 - 19 (base_xxx_clk) crystal osc pll1 idivc /16 idivd /16 base_usb0_clk outclk_20 base_safe_clk 12 mhz irc enet_rx_clk enet_tx_clk gp_clkin 18 5 output generators integer dividers plls oscillators, clock inputs cgu xtal1 rtcx1 rtcx2 xtal2 clkout www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 982 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.5 pin description 42.4.6 register description the register addresses of the cgu are shown in table 930 . remark: the cgu is configured by the boot loader at reset and when waking up from deep power-down to produce a 72 mhz clock us ing pll1. note that this configuration is not reflected in the reset values given in table 930 . table 929. cgu pin description pin name/ function name direction description xtal1 i crystal oscillator input xtal2 o crystal oscillator output rtcx1 i rtc 32 khz oscillator input rtcx2 o rtc 32 khz oscillator output gp_clkin i general purpose input clock enet_tx_clk i ethernet phy transmit clock enet_rx_clk i ethernet phy receive clock clkout o clock output pin table 930. register overview: cgu (base address 0x4005 0000) name access address offset description reset value - r 0x000 reserved 0x0110 0106 - r 0x004 reserved 0x0000 0500 - r 0x008 reserved 0x1a00 0000 - r 0x00c reserved 0x0000 0000 - - 0x010 reserved - freq_mon r/w 0x014 frequency monitor register 0x0000 0000 xtal_osc_ctrl r/w 0x018 crystal oscill ator control register 0x0000 0005 pll0_stat r 0x01c pll0 status register 0x0000 0000 pll0_ctrl r/w 0x020 pll0 control register 0x0100 0003 pll0_mdiv r/w 0x024 pll0 m-divider register 0x05f8 5b6a pll0_np_div r/w 0x028 pll0 n/p-divider register 0x000b 1002 pll1_stat r 0x02c pll1 status register 0x0000 0001 pll1_ctrl r/w 0x030 pll1 control register 0x0100 0003 idiva_ctrl r/w 0x034 integer divider a control register 0x0100 0000 idivb_ctrl r/w 0x038 integer divider b control register 0x0100 0000 idivc_ctrl r/w 0x03c integer divider c control register 0x0100 0000 idivd_ctrl r/w 0x040 integer divider d control register 0x0100 0000 idive_ctrl r/w 0x044 integer divider e control register 0x0100 0000 outclk_0_ctrl r/w 0x048 output stage 0 control register for base clock base_safe_clk 0x0100 0800 outclk_1_ctrl r/w 0x04c output stage 1 control register for base clock base_usb0_clk 0x0700 0000 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 983 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.6.1 frequency monitor register the cgu can report the relative frequency of any operating clock. the clock to be measured must be selected by software, while the fixed-frequency irc clock fref is used as the reference frequency. a 14-bit counter then counts the number of cycles of the measured clock that occur dur ing a user-defined number of reference-clock cycles. when the meas bit is set, the measured-clock counter is reset to 0 and counts up, while the 9-bit reference-clock counter is loaded with the value in rcnt an d then counts down - - 0x050 reserved - outclk_3_ctrl r/w 0x054 output stage 3 control register for base clock base_usb1_clk 0x0100 0000 outclk_4_ctrl r/w 0x058 output stage 4 control register for base clock base_m3_clk 0x0800 0800 outclk_5_ctrl r/w 0x05c output stage 5 control register for base clock base_spifi_clk 0x0100 0000 - - 0x060 reserved - outclk_7_ctrl r/w 0x064 output stage 7 control register for base clock base_phy_rx_clk 0x0100 0000 outclk_8_ctrl r/w 0x068 output stage 8 control register for base clock base_phy_tx_clk 0x0100 0000 outclk_9_ctrl r/w 0x06c output stage 9 control register for base clock base_apb1_clk 0x0100 0000 outclk_10_ctrl r/w 0x070 output stage 10 control register for base clock base_apb3_clk 0x0100 0000 outclk_11_ctrl r/w 0x074 output stage 11 control register for base clock base_lcd_clk 0x0100 0000 - - 0x078 reserved - outclk_13_ctrl r/w 0x07c output stage 13 control register for base clock base_sdio_clk 0x0100 0000 outclk_14_ctrl r/w 0x080 output stage 14 control register for base clock base_ssp0_clk 0x0100 0000 outclk_15_ctrl r/w 0x084 output stage 15 control register for base clock base_ssp1_clk 0x0100 0000 outclk_16_ctrl r/w 0x088 output stage 16 control register for base clock base_uart0_clk 0x0100 0000 outclk_17_ctrl r/w 0x08c output stage 17 control register for base clock base_uart1_clk 0x0100 0000 outclk_18_ctrl r/w 0x090 output stage 18 control register for base clock base_uart2_clk 0x0100 0000 outclk_19_ctrl r/w 0x094 output stage 19 control register for base clock base_uart3_clk 0x0100 0000 outclk_20_ctrl r/w 0x098 output stage 20 control register for base clock base_out_clk 0x0100 0000 outclk_21_ctrl to outclk_25_ctrl r/w 0x09c to 0x0ac reserved output stages - table 930. register overview: cgu (base address 0x4005 0000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 984 of 1164 nxp semiconductors UM10430 chapter 42: appendix towards 0. when either counter reaches its te rminal value both counters are disabled and the meas bit is reset to 0. the current values of the counters can then be read out and the selected frequency obtained by the following equation: if rcnt is programmed to a value equal to the core clock frequency in khz and reaches 0 before the fcnt counter saturates, the va lue stored in fcnt would then show the measured clock?s frequency in khz without the need for any further calculation. note that the accuracy of this measurem ent can be affected by several factors: 1. quantization error is noticeable if the ratio between the two clocks is large (e.g. 100 khz vs. 1 khz), because one counter sa turates while the other still has only a small count value. 2. due to synchronization, the counters are not started and stopped at exactly the same time. 3. the measured frequency can only be to the same level of precision as the reference frequency. table 931. freq_mon register (freq_mon, address 0x4005 0014) bit description bit symbol value description reset value access 8:0 rcnt 9-bit reference clock-counter value 0 r/w 22:9 fcnt 14-bit selected clock-counter value 0 r 23 meas measure frequency 0 r/w 0 rcnt and fcnt disabled 1 frequency counters started fselected qselected qref initial ?? qref final ?? ? ?? ------------------------------------------------------------------------- - fref ? = www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 985 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.6.2 crystal oscillator control register the register xtal_osc_control contains the control bits for the crystal oscillator. 27:24 clk_sel clock-source sele ction for the clock to be measured. 0r/w 0x00 32 khz oscillator (default) 0x01 irc 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 pll0 0x08 pll1 0x09 reserved 0x0a reserved 0x0b idiva 0x0c idivb 0x0d idivc 0x0e idivd 0x0f idive 31:28 - reserved - - table 931. freq_mon register (freq_mon, address 0x4005 0014) bit description ?continued bit symbol value description reset value access table 932. xtal_osc_ctrl register (xtal_osc_ctrl, address 0x4005 0018) bit description bit symbol value description reset value access 0 enable oscillator pad enable [1] 1r/w 0 enable 1 power-down (default) 1 bypass configure crystal operation or external-clock input pin xtal1 [1] . 0r/w 0 operation with crystal connected (default). 1 bypass mode. use this mode when an external clock source is used instead of a crystal. 2 hf select frequency range. between 15 mhz to 20 mhz, the value of this bit is don?t care. 1r/w 0 oscillator low-frequency mode (crystal or external clock source 1 to 20 mhz) 1 oscillator high-frequency mode; crystal or external clock source 15 to 25 mhz (default) 31:3 - reserved - r www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 986 of 1164 nxp semiconductors UM10430 chapter 42: appendix [1] do not change the bypass and enable bits in one wr ite-action: this will re sult in unstable device operation! 42.4.6.3 pll0 (for usb0) registers the pll0 provides a dedicated clock to the high-speed usb0 interface. see section 42.4.7.4.5 for instructions on how to set up the pll0. 42.4.6.3.1 pll0 status register 42.4.6.3.2 pll0 control register table 933. pll0_stat register (pll0_stat, address 0x4005 001c) bit description bit symbol description reset value access 0 lock pll0 lock indicator 0 r 1 fr pll0 free running indicator 0 r 31:2 - reserved - table 934. pll0_ctrl register (pll0_ctrl, address 0x4005 0020) bit description bit symbol value description reset value access 0 pd pll0 power down 1 r/w 0 pll0 enabled 1 pll0 powered down 1 bypass input clock bypass control 1 r/w 0 cco clock sent to post-dividers. use this in normal operation. 1 pll0 input clock sent to post-dividers (default). 2 directi pll0 direct input 0 r/w 3 directo pll0 direct output 0 r/w 4 clken pll0 clock enable 0 r/w 5- reserved - - 6 frm free running mode 0 r/w 7- reserved 0r/w 8 - reserved. reads as zero. do not write one to this register. 0r/w 9 - reserved. reads as zero. do not write one to this register. 0r/w 10 - reserved. reads as zero. do not write one to this register. 0r/w 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 987 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.6.3.3 pll0 m-divider register 42.4.6.3.4 pll0 np-divider register 27:24 clk_sel clock-source selection 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 reserved 0x08 pll1 0x09 reserved 0x0a reserved 0x0b idiva 0x0c idivb 0x0d idivc 0x0e idivd 0x0f idive 31:28 - reserved - - table 934. pll0_ctrl register (pll0_ctrl, address 0x4005 0020) bit description ?continued bit symbol value description reset value access table 935. pll0_mdiv register (pll0_mdiv, address 0x4005 0024) bit description bit symbol description reset value access 16:0 mdec decoded m-divider coefficient value. select values for the m-divider between 1 and 131071. 0x5b6a r/w 21:17 selp bandwidth select p value 11100 r/w 27:22 seli bandwidth select i value 010111 r/w 31:28 selr bandwidth select r value 0000 r/w table 936. pll0_npdiv register (pll0_np_div, address 0x4005 0028) bit description bit symbol description reset value access 6:0 pdec decoded p-divider coefficient value 000 0010 r/w 11:7 - reserved - - 21:12 ndec decoded n-divider coefficient value 1011 0001 r/w 31:22 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 988 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.6.4 pll1 registers the pll1 is used for the co re and all peripheral blocks. 42.4.6.4.1 pll1 status register 42.4.6.4.2 pll1 control register table 937. pll1_stat register (pll1_stat, address 0x4005 002c) bit description bit symbol description reset value access 0 lock pll1 lock indicator 1 r 31:1 - reserved - - table 938. pll1_ctrl register (pll1_ctrl, address 0x4005 0030) bit description bit symbol value description reset value access 0 pd pll1 power down 1 r/w 0 pll1 enabled 1 pll1 powered down 1 bypass input clock bypass control 1 r/w 0 cco clock sent to post-dividers. use for normal operation. 1 pll1 input clock sent to post-dividers (default). 2 - reserved. do not write one to this bit. 0 r/w 5:3 - reserved. do not write one to these bits. - - 6 fbsel pll feedback select (see figure 155 ? pll1 block diagram ? ). 0r/w 0 cco output is used as feedback divider input clock. 1 pll output clock (clkout) is used as feedback divider input clock. use for normal operation. 7 direct pll direct cco output 0 r/w 0 disabled 1 enabled 9:8 psel[1:0] post-divider divisi on ratio. the value applied is 2xp. 01 r/w 0x0 1 0x1 2 (default) 0x2 4 0x3 8 10 - reserved - - 11 autoblock block clock auto matically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 989 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.6.5 integer divider register a 13:12 nsel[1:0] pre-divider division ratio 10 r/w 0x0 1 0x1 2 0x2 3 (default) 0x3 4 15:14 - reserved - - 23:16 msel[7:0] feedback-divider division ratio (m) 00000000 = 1 00000001 = 2 ... 11111111 = 256 11000 r/w 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 pll0 0x08 reserved 0x09 reserved 0x0a reserved 0x0b idiva 0x0c idivb 0x0d idivc 0x0e idivd 0x0f idive 31:28 - reserved - - table 938. pll1_ctrl register (pll1_ctrl, address 0x4005 0030) bit description ?continued bit symbol value description reset value access table 939. idiva control register (idiva_ctrl, address 0x4005 0034) bit description bit symbol value description reset value access 0 pd integer divider a power down 0 r/w 0 idiva enabled (default) 1 power-down 1- reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 990 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.6.6 integer divider register b, c, d 3:2 idiv[1:0] integer divider a divider values (1/(idiv + 1)) 00 r/w 0x0 1 (default) 0x1 2 0x2 3 0x3 4 10:4 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 pll0 0x08 pll1 31:28 - reserved - - table 939. idiva control register (idiva_ctrl, address 0x4005 0034) bit description ?continued bit symbol value description reset value access table 940. idivb/c/d control registers (idivb_ctrl, address 0x4005 0038; idivc_ctrl, address 0x4005 003c; idivc_ctrl, address 0x4005 0040) bit description bit symbol value description reset value access 0 pd integer divider power down 0 r/w 0 idiv enabled (default) 1 power-down 1- reserved -- 5:2 idiv[3:0] integer divider b, c, d divider values (1/(idiv + 1)) 0000 = 1 (default) 0001 = 2 ... 1111 = 16 0000 r/w 10:6 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 991 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.6.7 integer divider register e 11 autoblock block clock automa tically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 reserved 0x08 pll1 0x09 reserved 0x0a reserved 0x0b idiva 31:28 - reserved - - table 940. idivb/c/d control registers (idivb_ctrl, address 0x4005 0038; idivc_ctrl, address 0x4005 003c; idivc_ctrl, address 0x4005 0040) bit description bit symbol value description reset value access table 941. idive control register (idive_ctrl, address 0x4005 0044) bit description bit symbol value description reset value access 0 pd integer divider power down 0 r/w 0 idiv enabled (default) 1 power-down 1- reserved - - 9:2 idiv[7:0] integer divider e divider values (1/(idiv + 1)) 00000000 = 1 (default) 00000001 = 2 ... 111111111 = 256 000000 00 r/w 10 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 992 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.6.8 output stage 0 control register this register controls the base_safe_clk to the watchdog oscillat or. the only possible clock source for this base clock is the irc. 42.4.6.9 output stage 1 control register this register controls the base_usb0_clk to the high-spee d usb0. the only possible clock source for this base clock is the pll0 output. 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 reserved 0x08 pll1 0x09 reserved 0x0a reserved 0x0b idiva 31:28 - reserved - - table 941. idive control register (idive_ctrl, address 0x4005 0044) bit description bit symbol value description reset value access table 942. output stage 0 control register (outclk_0_ctrl, address 0x4005 0048) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 reserved 0x01 irc (default) 31:28 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 993 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.6.10 output stage 3 to 19 control registers these registers control base clocks 2 to 19. table 943. output stage 1 control register (outclk_1_ctrl, address 0x4005 004c) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock auto matically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - 27:24 clk_sel clock-source selection. 0x07 r/w 0x00 reserved 0x07 pll0 (default) 31:28 - reserved - - table 944. output stage 3 to 19 control registers (outclk_2_ctrl to outclk_19_ctrl, address 0x4005 0050 to 0x4005 0094) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 994 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.6.11 output stage 20 register this register controls the clock output to the clkout pin. all clock generator outputs can be monitored through this pin. 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 reserved 0x08 pll1 0x09 reserved 0x0a reserved 0x0b idiva 0x0c idivb 0x0d idivc 0x0e idivd 0x0f idive 31:28 - reserved - - table 944. output stage 3 to 19 control registers (outclk_2_ctrl to outclk_19_ctrl, address 0x4005 0050 to 0x4005 0094) bit description ?continued bit symbol value description reset value access table 945. output stage 20 control register (outclk_20_ctrl, addresses 0x4005 0098) bit description bit symbol value description reset value access 0 pd output stage power down 0 r/w 0 output stage enabled (default) 1 power-down 10:1 - reserved - - 11 autoblock block clock automatically during frequency change 0r/w 0 autoblocking disabled 1 autoblocking enabled 23:12 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 995 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.7 functional description 42.4.7.1 32 khz oscillator the 32 khz oscillator output is controlled by the creg block (see ta b l e 3 1 ). the rtc and the alarm timer are connected directly to the 32 khz oscillator. 42.4.7.2 irc the irc is a trimmed 12 mhz in ternal oscillator. al though it's part of the cgu, the cgu has no control over this clock source. the irc is put into power down depending on the power saving mode. 42.4.7.3 crystal oscillator the crystal oscillator is co ntrolled by the xtal_osc_ctrl register in the cgu (see table 932 ). the crystal oscillator op erates at frequencies of 1 mhz to 25 mhz. this frequency can be boosted to a higher frequency, up to the ma ximum cpu operating frequency, by the pll. the oscillator can operate in one of two modes: slave mode and oscillation mode. ? in slave mode the input clock signal should be coupled by means of a capacitor of 100 pf (c c in figure 153 , drawing a), with an amplitude of at least 200 mvrms. the xtal2 pin in this configuration can be left unconnected. 27:24 clk_sel clock-source selection. 0x01 r/w 0x00 32 khz oscillator 0x01 irc (default) 0x02 enet_rx_clk 0x03 enet_tx_clk 0x04 gp_clkin 0x05 reserved 0x06 crystal oscillator 0x07 pll0 0x08 pll1 0x09 reserved 0x0a reserved 0x0b idiva 0x0c idivb 0x0d idivc 0x0e idivd 0x0f idive 31:28 - reserved - - table 945. output stage 20 control register (outclk_20_ctrl, addresses 0x4005 0098) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 996 of 1164 nxp semiconductors UM10430 chapter 42: appendix ? external components and models used in oscillation mode are shown in figure 153 , drawings b and c, and in table 946 and ta b l e 9 4 7 . since the feedback resistance is integrated on chip, only a crystal and the capacitances cx1 and cx2 need to be connected externally in ca se of fundamental mode os cillation (the fundamental frequency is represented by l, cl and rs). capacitance c p in figure 153 , drawing c, represents the parallel package capacitance and should not be larger than 7 pf. parameters fc, cl, rs and cp are supplied by the crystal manufacturer. fig 153. oscillator modes and models: a) slave mode of op eration, b) oscillation mode of operation, c) external crystal model used for c x1 / x2 evaluation lpc18xx lpc18xx clock c c c x1 c x2 c l c p l r s < = > a) b) c) xtal xtal1 xtal2 xtal1 xtal2 table 946. recommended values for c x1/x2 in oscillation mode (crystal and external components parameters) low frequency mode fundamental oscillation frequency f osc maximum crystal series resistance r s external load capacitors c x1 , c x2 2 mhz < 200 ? 33 pf, 33 pf < 200 ? 39 pf, 39 pf < 200 ? 56 pf, 56 pf 4 mhz < 200 ? 18 pf, 18 pf < 200 ? 39 pf, 39 pf < 200 ? 56 pf, 56 pf 8 mhz < 200 ? 18 pf, 18 pf < 200 ? 39 pf, 39 pf 12 mhz < 160 ? 18 pf, 18 pf < 160 ? 39 pf, 39 pf 16 mhz < 120 ? 18 pf, 18 pf < 80 ? 33 pf, 33 pf 20 mhz <100 ? 18 pf, 18 pf < 80 ? 33 pf, 33 pf www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 997 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.7.4 pll0 (for usb0) 42.4.7.4.1 features ? input frequency: 14 khz to 150 mhz. the inpu t from an external crystal is limited to 25 mhz. ? cco frequency: 275 mhz to 550 mhz. ? output clock range: 4.3 mhz to 550 mhz. ? programmable dividers: ? pre-divider n (n, 1 to 2 8 ) ? feedback-divider 2 x m (m, 1 to 2 15 ) ? post-divider p x 2 (p, 1 to 2 5 ). ? programmable bandwidth (integrating acti on, proportional action, high frequency pole). ? on-the-fly adjustment of the clock possible (dividers with handshake control). ? positive edge clocking. ? frequency limiter to avoid hang-up of the pll. ? lock detector. ? power-down mode. ? free running mode 42.4.7.4.2 pll0 description the block diagram of the pll is shown in figure 154 . the clock input has to be fed to pin clkin. pin clkout is the pll clock output. the analog part of the pll consists of a phase frequency detector (pfd ), filter and a curr ent controlled oscillato r (cco). the pfd has two inputs, a reference input from the (divided) external clock and one input from the divided cco output clock. the pfd compares the phase/frequency of these input signals and generates a control signal if they don?t ma tch. this control signal is fed to a filter which drives the cco. table 947. recommended values for c x1/x2 in oscillation mode (crystal and external components parameters) high frequency mode fundamental oscillation frequency f osc maximum crystal series resistance r s external load capacitors c x1 , c x2 15 mhz < 80 ? 18 pf, 18 pf 20 mhz < 80 ? 39 pf, 39 pf < 100 ? 47 pf, 47 pf www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 998 of 1164 nxp semiconductors UM10430 chapter 42: appendix the pll contains three programmable dividers: pre-divider (n), feedback-divider (m) and post-divider (p). the pll contains a lock det ector which measures the phase difference between the rising edges of the input and feedback clocks. only when this difference is smaller than the so called ?lock criterion? for more than seven consecutive input clock periods, the lock output switches from low to high. a single too large phase difference immediately resets the counter and causes the lock signal to drop (if it was high). requiring seven phase measurements in a row to be below a certain figure ensures that the lock detector will not indicate lock until both the phas e and frequency of the input and feedback clocks are very well aligned. this ef fectively prevents false lock indications, and thus ensures a glitch free lock signal. to avoid frequency hang-up the pll contains a frequency limiter. this feature is built in to prevent the cco from running too fast, this ca n occur if e.g. a wrong feedback-divider (m) ratio is applied to the pll. 42.4.7.4.3 use of pll0 operating modes normal mode: mode 1 is the normal operating mode. the pre- and post-divider can be selected to give: ? mode 1a: normal operating mode without post-divider and without pre-divider ? mode 1b: normal operating mode with post-divider and without pre-divider ? mode 1c: normal operating mode without post-divider and with pre-divider ? mode 1d: normal operating mode with post-divider and with pre-divider fig 154. pll0 block diagram bypass pll0_ctrl [1] clkout clkin 32khz irc enet_rx_clk enet_tx_clk gp_clkin crystal pll1 idiva idivb idivc idivd idive pll0_ctrl[27:24] ?1? n-divider pll0 npdiv [ 21:12 ] direct input pll0_ctrl[2] pfd filter cco q d clken pll0_ctrl[4] /2 pll0_npdiv[6:0] p-divider /2 m-divider pll0_mdiv[16:0] direct output pll0_ctrl [3] bandwidth select p,i,r pll0_mdiv[31:17] 019aac415 table 948. pll operating modes pll0_mode bit settings: mode pd clken bypass directi directo frm 1: normal 0 1 0 1/0 1/0 0 3: power down 1 x x x x x www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 999 of 1164 nxp semiconductors UM10430 chapter 42: appendix to get at the output of the pll (clkout) the best phase-no ise and jitter performance, the highest possible reference clock (clkref) at the pfd has to be used. therefore mode 1a and 1b are recommended, when it is possible to make the right output frequency without pre-divider. by using the post-divider the clock at the out put of the pll (clkout) the divider ratio is always even because the divide-by-2 divider after the post-divider. mode 1a: normal operating mode without post-divider and without pre-divider: in normal operating mode 1a the post-divider and pre-divider are bypassed. the operating frequencies are: fout = fcco = 2 x m x fin ?? (275 mhz ? fcco ? 550 mhz, 4 khz ? fin ? 150 mhz) the feedback divider ratio is programmable: ? feedback-divider m (m, 1 to 2 15 ) mode 1b: normal operating mode with post-divider and without pre-divider: in normal operating mode 1b the pre-divider is bypassed. the operating frequencies are: fout = fcco /(2 x p) = (m / p) x fin ? (275 mhz ? fcco ? 550 mhz, 4 khz ? fin ? 150 mhz) the divider ratios are programmable: ? feedback-divider m (m, 1 to 2 15 ) ? post-divider p (p, 1 to 32) mode 1c: normal operating mode without post-divider and with pre-divider: in normal operating mode 1c the post-divider with divide-by-2 divider is bypassed. the operating frequencies are: fout = fcco = 2 x m x fin / n ? (275 mhz ? fcco ? 550 mhz, 4 khz ? fin/n ? 150 mhz) the divider ratios are programmable: ? pre-divider n (n, 1 to 256) ? feedback-divider m (m, 1 to 2 15 ) mode 1d: normal operating mode with post-divider and with pre-divider: in normal operating mode 1d none of the dividers ar e bypassed. the operating frequencies are: fout = fcco /(2 x p) = m x fin /(n x p) ? (275 mhz ? fcco ? 550 mhz, 4 khz ? fin/n ? 150 mhz) the divider ratios are programmable: ? pre-divider n (n, 1 to 256) table 949. directl and directo bit settings in hp0/1_mode register mode directi directo 1a 1 1 1b 1 0 1c 0 1 1d 0 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1000 of 1164 nxp semiconductors UM10430 chapter 42: appendix ? feedback-divider m (m, 1 to 2 15 ) ? post-divider p (p, 1 to 32) mode 3: power down mode (pd): in this mode (pd = '1'), the oscillator will be stopped, the lock output will be made low, and the internal cu rrent reference w ill be turned off. during pd it is also possible to load new divide r ratios at the input buses (msel, psel, nsel). power-down mode is ended by making pd low, causing the pll to start up. the lock signal will be made high once the pll has regained lock on the input clock. 42.4.7.4.4 settings for usb0 table 950 shows the divider settings used for c onfiguring a certain output frequency f out for usb0. 42.4.7.4.5 usage notes in order to set up the pll0, follow these steps: 1. power down the pll0 by setting bit 1 in the pll0_ctrl register to 1. this step is only needed if the pll0 is currently enabled. 2. configure the pll0 m, n, and p divider values in the pll0_m and pll0_np registers. 3. power up the pll0 by setting bit 1 in the pll0_ctrl register to 0. 4. wait for the pll0 to lock by monitoring the lock bit in the pll0_stat register. 5. enable the pll0 clock output in the pll0_ctrl register. 42.4.7.5 pll1 42.4.7.5.1 features ? 1 mhz to 50 mhz input frequency. the input from an external crystal is limited to 25 mhz. ? 9.75 mhz to 320 mhz selectable out put frequency with 50% duty cycle. ? 156 mhz to 320 mhz current cont rolled oscillator (cco) frequency. ? power-down mode. ? lock detector. table 950. system pll divider ratio settings for 12 mhz fout (mhz) fcco (mhz) ndec mdec pdec selr seli selp www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1001 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.4.7.5.2 pll1 description the block diagram of this pll is shown in figure 155 . the input frequency range is 10 mhz to 25 mhz. the input clock is fed dire ctly to the phase-fre quency detector (pfd). this block compares the phase and frequency of its inputs, and generates a control signal when phase and/ or frequency do not match. t he loop filter filters these control signals and drives the current controlled oscillator (cco), which generates t he main clock. the cco frequency range is 156 mhz to 320 mhz.these clocks are either divided by 2xp by the programmable post divider to create the ou tput clock(s), or are sent directly to the output(s). the main output clock is then divided by m by the programmable feedback divider to generate the feedback clock. the out put signal of the phas e-frequency detector is also monitored by the lock detector, to signal when the pll has locked on to the input clock. lock detector: the lock detector measures the phase difference between the rising edges of the input and feedback clocks. only when this difference is smaller than the so called ?lock criterion? for more than eight cons ecutive input clock periods, the lock output switches from low to high. a single too large phase difference immediately resets the counter and causes the lock signal to drop (if it was high). requiring eight phase measurements in a row to be below a certain figure ensures that the lock detector will not indicate lock until both the phase and frequency of the input and feedback clocks are very well aligned. this effectively pr events false lock indications, and thus ensures a glitch free lock signal. power-down control: to reduce the power consumpti on when the pll clock is not needed, a power-down mode has been incorpor ated. in this mode, the internal current reference will be turned off, the oscillator and the phas e-frequency detector will be stopped and the dividers will enter a reset st ate. while in power- down mode, the lock output will be low to indicate that the pll is not in lock. when th e power-down mode is terminated, the pll will resume its normal op eration and will make the lock signal high once it has regained lock on the input clock. fig 155. pll1 block diagram lock detect pfd fclkout pd analog section pd cd /m /2p /n cd psel<1:0> pd 2 msel<7:0> 8 nsel<1:0> 2 fclkin fclkin fcco lock 1 0 1 0 fbsel cco direct 1 0 bypass www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1002 of 1164 nxp semiconductors UM10430 chapter 42: appendix selectable feedback divider clock: to allow a trade-off to be made between functionality and power consumption, the feedba ck divider can be connected to either the cco clock by setting fbsel to 0 or to the ou tput clock by setting fbsel to 1. if the post-divider is used to divide down the cco clock the current consumption of the feedback divider can be reduced by making it run on the lower output clock instead of the cco clock, but doing so will limit the rela tion between output and phase detector clock frequencies to integer values. direct output mode: in normal operating mode (with direct set to 0) the cco clock is divided by 2, 4, 8 or 16 depending on th e value of psel[1:0], au tomatically giving an output clock with a 50% duty cycle. if a higher output frequency is needed, the cco clock can be sent directly to the output by settin g direct to 1. since the cco was designed to directly generate a clock with a 50% duty cycle, the output clock duty cycle will also be 50% in direct mode. divider ratio programming: pre-divider the pre-divider?s division ratio is controlled by the nsel[1:0] input. the division ratio between pll?s input clock and the phase detector clock is the decimal value on nsel[1:0] plus one. post-divider the division ratio of the post divider is contro lled by the psel bits. the division ratio is two times the value of p selected by psel bits. this guarantees an output clock with a 50% duty cycle. feedback divider the feedback divider?s division ratio is controlled by the msel bits. the division ratio between the pll?s output clock and the input cl ock is the decimal value on msel bits plus one. changing the divider values changing the divider ratio while the pll is running is not recommended. as there is no way to synchronize the change of the nsel, msel, and psel values with the dividers, the risk exists that the coun ter will read in an undefined value, which could lead to unwanted spikes or drops in the frequency of the output clock. the recommended way of changing between divider settings is to po wer down the pll, adjust the divider settings and then let the pll start up again. frequency selection: the pll frequency equations use the following parameters (also see figure 155 ): integer mode in this mode the post divider is enabled and the feedback divider is set to run on the pll output clock, giving the following frequency relations: (11) fclkout m fclkin n ---------------------- ? = www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1003 of 1164 nxp semiconductors UM10430 chapter 42: appendix (12) non-integer mode in this mode the post-divider is enabled and the feedback divider is set to run directly on the cco clock, which gives the following frequency dividers: (13) (14) direct mode in this mode, the post-divider is disabled and the cco clock is sent directly to the output, leading to the following frequency equation: (15) power-down mode in this mode, the internal current reference w ill be turned off, the oscillator and the phase-frequency detector will be sto pped and the dividers will ente r a reset state. while in power-down mode, the lock output will be low, to indica te that the pll is not in lock. when the power-down mode is terminated, the pll will resume its normal operation and will make the lock signal high once it has regained lock on the input clock. 42.4.8 example cgu configurations 42.4.8.1 programming the cgu for deep-sleep and power-down modes before the lpc18xx enters deep-sleep or power-down mode, the irc must be programmed as the clock source in the control registers for all output stages (outclk_0 to outclk_20). in addition, the plls must be in power-down mode. fcco 2 p fclkout ? ? 2pm fclkin n ---------------------- ? ? ? == fclkout fcco 2p ? ---------------- - m 2p ? ------------ fclkin n ---------------------- ? == fcco m fclkin n ---------------------- ? = fclkout fcco m fclkin n ---------------------- ? == www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1004 of 1164 nxp semiconductors UM10430 chapter 42: appendix when the lpc18xx wakes up from deep-sleep or power-down mode, the irc is used as the clock soures for all output stages. also see section 8.2.3 and section 8.2.4 . 42.4.8.2 programming the cgu for using i2s at peripheral clock rate of 30 mhz in this example the peripheral clock of the i2s interface is set to 30 mhz. the peripheral i2s clock is a branch of the base_apb1_clk. us ing a crystal of 12 mhz as clock source, a pll1 multiplier of 10, and an integer divider of 4 provide the desired clock rate. for this example, program the cgu as follows: 1. enable the crystal oscillator in the xtal_osc_ctrl register ( table 932 ). 2. wait for the crystal to stabilize. 3. select the crystal oscillato r as input to the pll1 a nd set up the divider in the pll1_ctrl register (see table 938 ): ? set bits clk_sel in the pl l1_ctrl register to 0x6. ? set msel = 9. ? set nsel = 0. ? set psel = 1. ? set fbsel = 1. ? set bypass = 0, direct = 0. 4. wait for the pll1 to lock. 5. select the pll1 as clock source of the in teger divider a (idiva) in the idiva register and set autoblock = 1 (see table 939 ). 6. select idiva as clock source of the base clock base_apb1_clk and set autoblock = 1 (see ta b l e 9 4 3 ). 7. ensure that the i2s branch clock cl k_apb1_i2s is enabled in the ccu (see table 152 ). 42.5 lpc1850/30/20/10 rev ?-? ccu 42.5.1 how to read this chapter remark: this chapter applies to parts lpc1850_30_20_10 rev ?-?. ethernet, usb0, usb1, and lcd related clo cks are not available on all packages. the sdio interface is not available. see . the corresponding clock control registers and register bits are reserved. 30mhz 120mhz 12mhz xtal_osc pll1 x 10 diva / 4 base_apb1_clk www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1005 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.5.2 basic configuration the ccu1/2 are configured as follows: ? see ta b l e 9 5 1 for clocking and power control. ? do not reset the ccus during normal operation. 42.5.3 features the ccus switch the clocks to individual peripherals on or off. ? auto mode activates the ahb disable protoc ol before switching off the branch clock. ? wake-up mode allows to select clocks to run automatically after a wake-up event. 42.5.4 general description each cgu base clock has several clock branches which can be turned on or off independently by the clock control units ccu1 or ccu2. the branch clocks are distributed between ccu1 and ccu2. table 951. ccu clocking and power control base clock branch clock maximum frequency ccu1 base_m3_clk clk_m3_bus 150 mhz ccu2 base_m3_clk clk_m3_bus 150 mhz table 952. ccu1 branch clocks base clock branch clock description base_apb3_clk clk_apb3_bus clk_apb3_i2c1 clock to the i2c1 register interface and i2c1 peripheral clock. clk_apb3_dac clock to the dac register interface. clk_apb3_adc0 clock to the adc0 register interface and adc0 peripheral clock. clk_apb3_adc1 clock to the adc1 register interface and adc1 peripheral clock. clk_apb3_can clock to the c_can register interface and c_can peripheral clock. base_apb1_clk clk_apb1_bus clk_apb1_motocon clock to the pwm motor control block and pwm motocon peripheral clock. clk_apb1_i2c0 clock to the i2c0 register interface and i2c0 peripheral clock. clk_apb1_i2s clock to the i2s register interface and i2s peripheral clock. base_spifi_clk clk_spifi clock for the spifi scki clock input. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1006 of 1164 nxp semiconductors UM10430 chapter 42: appendix base_m3_clk clk_m3_bus clk_m3_spifi clock to the spifi register interface. clk_m3_gpio clock to the gpio register interface clk_m3_lcd clock to the lcd register interface. clk_m3_ethernet clock to the ethernet register interface. clk_m3_usb0 clock to the u sb0 register interface. clk_m3_emc clock to the external memory controller register interface. clk_m3_sdio clock to the sdio register interface. clk_m3_dma clock to the dma register interface. clk_m3_m3core clock to the cortex-m3 core clk_m3_aes clock to the aes register interface. clk_m3_sct clock to the sct register interface. clk_m3_usb1 clock to the u sb1 register interface. clk_m3_wwdt clock to the wwdt register interface. clk_m3_uart0 clock to the usart0 register interface. clk_m3_uart1 clock to the uart1 register interface. clk_m3_ssp0 clock to the ssp0 register interface. clk_m3_timer0 clock to the timer0 register interface and timer0 peripheral clock. clk_m3_timer1 clock to the timer1 register interface and timer1 peripheral clock. clk_m3_scu clock to the syst em control unit register interface. clk_m3_creg clock to the creg register interface. clk_m3_ritimer clock to the ri timer register interface and ri timer peripheral clock. clk_m3_uart2 clock to the uart2 register interface. clk_m3_uart3 clock to the uart3 register interface. clk_m3_timer2 clock to the timer2 register interface and timer2 peripheral clock. clk_m3_timer3 clock to the timer3 register interface and timer3 peripheral clock. base_m3_clk clk_m3_ssp1 clk_m3_qei clock to the qei register interface and qei peripheral clock. base_usb0_clk clk_usb0 usb0 peripheral clock. base_usb1_clk clk_usb1 usb1 peripheral clock. -- reserved. table 952. ccu1 branch clocks base clock branch clock description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1007 of 1164 nxp semiconductors UM10430 chapter 42: appendix table 953. ccu2 branch clocks base clock branch clock description base_uart3_clk clk_apb2_uart3 usart3 peripheral clock. base_uart2_clk clk_apb2_uart2 usart2 peripheral clock. base_uart1_clk clk_apb0_uart1 uart1 peripheral clock. base_uart0_clk clk_apb0_uart0 usart0 peripheral clock. base_ssp1_clk clk_apb2_ssp1 ssp1 peripheral clock. base_ssp0_clk clk_apb0_ssp0 ssp0 peripheral clock. base_sdio_clk clk_sdio not used. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1008 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.5.5 register description table 954. register overview: ccu1 (base address 0x4005 1000) name access address offset description reset value pm r/w 0x000 ccu1 power mode register 0x0000 0000 base_stat r 0x004 ccu1 base clocks status register 0x0000 0fff - - 0x008 to 0x0fc reserved - clk_apb3_bus_cfg r/w 0x100 clk_apb3 _bus clock configuration register 0x0000 0001 clk_apb3_bus_stat r 0x104 clk_apb3_bus clock status register 0x0000 0001 clk_apb3_i2c1_cfg r/w 0x108 clk_apb3_i2c1 configuration register 0x0000 0001 clk_apb3_i2c1_stat r 0x10c clk_apb3_i2c1v status register 0x0000 0001 clk_apb3_dac_cfg r/w 0x110 clk_apb3_dac configuration register 0x0000 0001 clk_apb3_dac_stat r 0x114 clk_apb3_dac status register 0x0000 0001 clk_apb3_adc0_cfg r/w 0x118 clk_apb3_adc0 configuration register 0x0000 0001 clk_apb3_adc0_stat r 0x11c clk_apb3_adc0 status register 0x0000 0001 clk_apb3_adc1_cfg r/w 0x120 clk_apb3_adc1 configuration register 0x0000 0001 clk_apb3_adc1_stat r 0x124 clk_apb3_adc1 status register 0x0000 0001 clk_apb3_can_cfg r/w 0x128 clk_apb3_can configuration register 0x0000 0001 clk_apb3_can_stat r 0x12c clk_apb3_can status register 0x0000 0001 - - 0x130 to 0x1fc reserved - clk_apb1_bus_cfg r/w 0x200 clk_apb1_bus configuration register 0x0000 0001 clk_apb1_bus_stat r 0x204 clk_apb1_bus status register 0x0000 0001 clk_apb1_motoconpwm_cfg r/w 0x208 cl k_apb1_motocon configuration register 0x0000 0001 clk_apb1_motoconpwm_stat r 0x20c clk_apb1_motocon status register 0x0000 0001 clk_apb1_i2c0_cfg r/w 0x210 clk_apb1_i2c0 configuration register 0x0000 0001 clk_apb1_i2c0_stat r 0x214 clk_apb1_i2c0 status register 0x0000 0001 clk_apb1_i2s_cfg r/w 0x218 clk_apb1_i2s configuration register 0x0000 0001 clk_apb1_i2s_stat r 0x21c clk_apb1_i2s status register 0x0000 0001 - - 0x220 to 0x2fc reserved - clk_spifi_cfg r/w 0x300 clk_spifi configuration register 0x0000 0001 clk_spifi_stat r 0x304 clk_spifi status register 0x0000 0001 - - 0x308 to 0x3fc reserved - clk_m3_bus_cfg r/w 0x400 clk_m3_bus configuration register 0x0000 0001 clk_m3_bus_stat r 0x404 clk_m3_bus status register 0x0000 0001 clk_m3_spifi_cfg r/w 0x408 clk_m3_spifi configuration register 0x0000 0001 clk_m3_spifi_stat r 0x40c clk_m3_spifi status register 0x0000 0001 clk_m3_gpio_cfg r/w 0x410 clk_m3_gpio configuration register 0x0000 0001 clk_m3_gpio_stat r 0x414 clk_m3_gpio status register 0x0000 0001 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1009 of 1164 nxp semiconductors UM10430 chapter 42: appendix clk_m3_lcd_cfg r/w 0x418 clk_m3_lcd configuration register 0x0000 0001 clk_m3_lcd_stat r 0x41c clk_m3_lcd status register 0x0000 0001 clk_m3_ethernet_cfg r/w 0x420 clk_m3_ethernet configuration register 0x0000 0001 clk_m3_ethernet_stat r 0x424 clk_m3_ethernet status register 0x0000 0001 clk_m3_usb0_cfg r/w 0x428 clk_m3_usb0 configuration register 0x0000 0001 clk_m3_usb0_stat r 0x42c clk_m3_usb0 status register 0x0000 0001 clk_m3_emc_cfg r/w 0x430 clk_m3_emc configuration register 0x0000 0001 clk_m3_emc_stat r 0x434 clk_m3_emc status register 0x0000 0001 clk_m3_sdio_cfg r/w 0x438 clk_m3_sdio configuration register 0x0000 0001 clk_m3_sdio_stat r 0x43c clk_m3_sdio status register 0x0000 0001 clk_m3_dma_cfg r/w 0x440 clk_m3_dma configuration register 0x0000 0001 clk_m3_dma_stat r 0x444 clk_m3_dma status register 0x0000 0001 clk_m3_m3core_cfg r/w 0x448 clk_m3_m3core configuration register 0x0000 0001 clk_m3_m3core_stat r 0x44c clk_m3_m3core status register 0x0000 0001 - - 0x450 to 0x45c reserved - clk_m3_aes_cfg r/w 0x460 clk_m3_aes configuration register 0x0000 0001 clk_m3_aes_stat r 0x464 clk_m3_aes status register 0x0000 0001 clk_m3_sct_cfg r/w 0x468 clk_m3_sct configuration register 0x0000 0001 clk_m3_sct_stat r 0x46c clk_m3_sct status register 0x0000 0001 clk_m3_usb1_cfg r/w 0x470 clk_m3_usb1 configuration register 0x0000 0001 clk_m3_usb1_stat r 0x474 clk_m3_usb1 status register 0x0000 0001 clk_m3_emcdiv_cfg r/w 0x478 clk_m3_emcdiv configuration register 0x0000 0001 clk_m3_emcdiv_stat r 0x47c clk_m3_emcdiv status register 0x0000 0001 - - 0x480 to 0x4fc reserved - clk_m3_wwdt_cfg r/w 0x500 clk_m3_wwdt configuration register 0x0000 0001 clk_m3_wwdt_stat r 0x504 clk_m3_wwdt status register 0x0000 0001 clk_m3_usart0_cfg r/w 0x508 clk_m3_uart0 configuration register 0x0000 0001 clk_m3_usart0_stat r 0x50c clk_m3_uart0 status register 0x0000 0001 clk_m3_uart1_cfg r/w 0x510 clk_m3_uart1 configuration register 0x0000 0001 clk_m3_uart1_stat r 0x514 clk_m3_uart1 status register 0x0000 0001 clk_m3_ssp0_cfg r/w 0x518 clk_m3_ssp0 configuration register 0x0000 0001 clk_m3_ssp0_stat r 0x51c clk_m3_ssp0 status register 0x0000 0001 clk_m3_timer0_cfg r/w 0x520 clk_m3_timer0 configuration register 0x0000 0001 clk_m3_timer0_stat r 0x524 clk_m3_timer0 status register 0x0000 0001 clk_m3_timer1_cfg r/w 0x528 clk_m3_timer1 configuration register 0x0000 0001 clk_m3_timer1_stat r 0x52c clk_m3_timer1 status register 0x0000 0001 clk_m3_scu_cfg r/w 0x530 clk_m3_scu configuration register 0x0000 0001 clk_m3_scu_stat r 0x534 clk_m3_scu status register 0x0000 0001 clk_m3_creg_cfg r/w 0x538 clk_m3_creg configuration register 0x0000 0001 table 954. register overview: ccu1 (base address 0x4005 1000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1010 of 1164 nxp semiconductors UM10430 chapter 42: appendix clk_m3_creg_stat r 0x53c clk_m3_creg status register 0x0000 0001 - - 0x540 to 0x5fc reserved - clk_m3_ritimer_cfg r/w 0x600 clk_m3_ritimer configuration register 0x0000 0001 clk_m3_ritimer_stat r 0x604 clk_m3_ritimer status register 0x0000 0001 clk_m3_usart2_cfg r/w 0x608 clk_m3_uart2 configuration register 0x0000 0001 clk_m3_usart2_stat r 0x60c clk_m3_uart2 status register 0x0000 0001 clk_m3_usart3_cfg r/w 0x610 clk_m3_uart3 configuration register 0x0000 0001 clk_m3_usart3_stat r 0x614 clk_m3_uart3 status register 0x0000 0001 clk_m3_timer2_cfg r/w 0x618 clk_m3_timer2 configuration register 0x0000 0001 clk_m3_timer2_stat r 0x61c clk_m3_timer2 status register 0x0000 0001 clk_m3_timer3_cfg r/w 0x620 clk_m3_timer3 configuration register 0x0000 0001 clk_m3_timer3_stat r 0x624 clk_m3_timer3 status register 0x0000 0001 clk_m3_ssp1_cfg r/w 0x628 clk_m3_ssp1 configuration register 0x0000 0001 clk_m3_ssp1_stat r 0x62c clk_m3_ssp1 status register 0x0000 0001 clk_m3_qei_cfg r/w 0x630 clk_m3_qei configuration register 0x0000 0001 clk_m3_qei_stat r 0x634 clk_m3_qei status register 0x0000 0001 - r/w 0x638 to 0x6fc reserved - - r/w 0x700 to 0x7fc reserved - clk_usb0_cfg r/w 0x800 clk_usb0configuration register 0x0000 0001 clk_usb0_stat r 0x804 clk_usb0 status register 0x0000 0001 - - 0x808 to 0x8fc reserved - clk_usb1_cfg r/w 0x900 clk_usb1 configuration register 0x0000 0001 clk_usb1_stat r 0x904 clk_usb1 status register 0x0000 0001 - - 0x908 to 0x9fc reserved - - - 0xa00 reserved - - - 0xa04 reserved - table 954. register overview: ccu1 (base address 0x4005 1000) name access address offset description reset value table 955. register overview: ccu2 (base address 0x4005 2000) name access address offset description reset value pm r/w 0x000 ccu2 power mode register 0x0000 0000 base_stat r 0x004 ccu2 base clocks status register 0x0000 0fff - - 0x008 to 0x0fc reserved - - - 0x100 to 0x1fc reserved - clk_apb2_usart3_cfg r/w 0x200 clk_apb2_uart3 configuration register 0x0000 0001 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1011 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.5.5.1 power mode register this register contains a single bit, pd, that when set will disable all output clocks with wake-up enabled (i.e. w = 1 in the ccu branch clock configuration registers, section 42.5.5.3 ). clocks disabled by writing to th is register will be reactivated when a wake-up interrupt is detected or when a 0 is written into the pd bit. clk_apb2_usart3_stat r 0x204 clk_apb2_uart3 status register 0x0000 0001 - - 0x208 to 0x2fc reserved - clk_apb2_usart2_cfg r/w 0x300 clk_apb2_uart2 configuration register 0x0000 0001 clk_apb2_usart2_stat r 0x304 clk_apb2_uart2 status register 0x0000 0001 - - 0x308 to 0x3fc reserved - clk_apb0_uart1_cfg r/w 0x400 clk_apb0_uart1 configuration register 0x0000 0001 clk_apb0_uart1_stat r 0x404 clk_apb0_uart1 status register 0x0000 0001 - - 0x408 to 0x4fc reserved - clk_apb0_usart0_cfg r/w 0x500 clk_apb0_uart0 configuration register 0x0000 0001 clk_apb0_usart0_stat r 0x504 clk_apb0_uart0 status register 0x0000 0001 - - 0x508 to 0x5fc reserved - clk_apb2_ssp1_cfg r/w 0x600 clk_apb2_ssp1 configuration register 0x0000 0001 clk_apb2_ssp1_stat r 0x604 clk_apb2_ ssp1 status register 0x0000 0001 - - 0x608 to 0x6fc reserved - clk_apb0_ssp0_cfg r/w 0x700 clk_apb0_ssp0 configuration register 0x0000 0001 clk_apb0_ssp0_stat r 0x704 clk_apb0_ ssp0 status register 0x0000 0001 - - 0x708 to 0x7fc reserved - clk_sdio_cfg r/w 0x800 clk_sdio configuration register 0x0000 0001 clk_sdio_stat r 0x804 clk_sdio status register 0x0000 0001 table 955. register overview: ccu2 (base address 0x4005 2000) name access address offset description reset value table 956. ccu1/2 power mode register ( ccu1_pm, address 0x4005 1000 and ccu2_pm, address 0x4005 2000) bit description bit symbol value description reset value access 0 pd initiate power-down mode 0 r/w 0 normal operation. 1 clocks with wake-up mode enabled (w = 1) are disabled. 31:1 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1012 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.5.5.2 base clock status register each bit in this register indicates if the spec ified base clock can be safely switched off. a logic zero indicates that all branch clocks generated from this base clock are disabled. hence, the base clock can also be switched off. a logic one value indicates that there is still at least one branch clock running. remark: the base clock must be reactivated before writing to the configuration register of the branch clock. table 957. ccu1 base clock status register (ccu1_base_stat, address 0x4005 1004) bit description bit symbol description reset value access 0 base_apb3_ clk_ind base clock indicato r for base_apb3_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 1 base_apb1_ clk_ind base clock indicato r for base_apb1_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 2 base_spifi_ clk_ind base clock indicato r for base_spifi_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 3 base_m3_ clk_ind base clock indicator for base_m3_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 6:4 - reserved - - 7 base_usb0_ clk_ind base clock indicator for base_usb0_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 8 base_usb1_ clk_ind base clock indicator for base_usb1_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 31:9 - reserved - - table 958. ccu2 base clock status register (ccu2_base_stat, address 0x4005 2004) bit description bit symbol description reset value access 0 - reserved. - - 1 base_uart3_ clk base clock indicator for base_uart3_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 2 base_uart2_ clk base clock indicator for base_uart2_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1013 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.5.5.3 ccu1/2 branch clock configuration registers each generated output clock from the ccu has a configuration register. they all follow the format as described in table 959 and table 960 . on the lpc18xx, all branch clocks are in run mode after reset. auto and wake-up features are disabled. the clock can be configured to run in the following modes described by the bits run, auto, and wakeup in the clk_xxx_cfg registers: run ? the wakeup, pd, and auto control bits de termine the activation of the branch clock. if register bit auto is set the ahb di sable protocol must complete before the clock is switched off. the pd bit is set in table 956 . auto ? enable auto (ahb disable mechanism). the pmu initiates the ahb disable protocol before switching the clock off. this protocol ensures that all ahb transactions have been completed before turning the clock off. wakeup ? the branch clock is wake-up enabled when the pd bit in the power mode register (see ta b l e 9 5 6 ) is set and clocks which are wake-up enabled are switched off. these clocks will be switched on if a wake-up event is detected or if the pd bit is cleared. if register bit auto is set, the ahb disable protocol must complete before the clock is switched off. remark: in order to safely disable any of the br anch clocks, use two separate writes to the clk_xxx_cfg register: first set the auto bi t, and then on the next write, disable the clock by setting the run bit to zero. 3 base_uart1_ clk base clock indicator for base_uart1_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 4 base_uart0_ clk base clock indicator for base_uart0_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 5 base_ssp1_ clk base clock indicator for base_ssp1_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 6 base_ssp0_ clk base clock indicator for base_ssp0_clk 0 = all branch clocks switched off. 1 = at least one branch clock running. 1r 7 - reserved. - - 31:8 - reserved. - - table 958. ccu2 base clock status register (ccu2_base_stat, address 0x4005 2004) bit description ?continued bit symbol description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1014 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.5.5.4 ccu1/2 branch clock status registers like the configuration register, each genera ted output clock from the ccu has a status register. when the configuration register of an output clock is written into, the value of the actual hardware signals may not be updated immediately because of the auto or wake-up mechanism. the status register shows the curr ent value of these signals. all output clock status registers follow the format as described in table 961 and ta b l e 9 6 2 . table 959. ccu1 branch clock configuration register (c lk_xxx_cfg, addresses 0x4005 1100, 0x4005 1104,..., 0x4005 1a00) bit description bit symbol value description reset value access 0 run run enable 1 r/w 0 clock is disabled. 1 clock is enabled. 1 auto auto (ahb disable mechanism) enable 0 r/w 0 auto is disabled. 1 auto is enabled. 2 wakeup wake-up mechanism enable 0 r/w 0 wake-up is disabled. 1 wake-up is enabled. 31:3 - reserved - - table 960. ccu2 branch clock configuration register (c lk_xxx_cfg, addresses 0x4005 2100, 0x4005 2200,..., 0x4005 2800) bit description bit symbol value description reset value access 0 run run enable 1 r/w 0 clock is disabled. 1 clock is enabled. 1 auto auto (ahb disable mechanism) enable 0 r/w 0 auto is disabled. 1 auto is enabled. 2 wakeup wake-up mechanism enable 0 r/w 0 wake-up is disabled. 1 wake-up is enabled. 31:3 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1015 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.6 lpc1850/30/20/10 rev ?-? pin configuration 42.6.1 pin description on the lpc18xx, digital pins are grouped into 16 ports, named p0 to p9 and pa to pf, with up to 20 pins used per port. each digital pin may support up to four different digital functions, including general purpose i/o (gpi o), selectable throug h the scu registers. note that the pin name is not indicative of the gpio port assigned to it. table 961. ccu1 branch clock status register (clk_xxx_stat, addresses 0x4005 1104, 0x4005 110c,..., 0x4005 1a04) bit description bit symbol description reset value access 0 run run enable status 0 = clock is disabled. 1 = clock is enabled. 1r 1 auto auto (ahb disable mechanism) enable status 0 = auto is disabled. 1 = auto is enabled. 0r 2 wakeup wake-up mechanism enable status 0 = wake-up is disabled. 1 = wake-up is enabled. 0r 31:3 - reserved - - table 962. ccu2 branch clock status register (clk_xxx_stat, addresses 0x4005 2104, 0x4005 2204,..., 0x4005 2804) bit description bit symbol description reset value access 0 run run enable status 0 = clock is disabled 1 = clock is enabled 1r 1 auto auto (ahb disable mechanism) enable status 0 = auto is disabled 1 = auto is enabled 0r 2 wakeup wake-up mechanism enable status 0 = wake-up is disabled 1 = wake-up is enabled 0r 31:3 - reserved - - table 963. pin description symbol lbga256 reset state [1] type description multiplexed digital pins www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1016 of 1164 nxp semiconductors UM10430 chapter 42: appendix p0_0 [2] l3 i; pu i/o gpio0[0] ? general purpose digital input/output pin. i/o ssp1_miso ? master in slave out for ssp1. i enet_rxd1 ? ethernet receive data 1 (rmii/mii interface). -n.c. p0_1 [2] m2 i; pu i/o gpio0[1] ? general purpose digital input/output pin. i/o ssp1_mosi ? master out slave in for ssp1. i enet_col ? ethernet collision detect (mii interface). -n.c. p1_0 [2] p2 i; pu i/o gpio0[4] ? general purpose digital input/output pin. i ctin_3 ? sct input 3. capture input 1 of timer 1. i/o extbus_a5 ? external memory address line 5. -n.c. p1_1 [2] r2 i; pu i/o gpio0[8] ? general purpose digital input/output pin. o ctout_7 ? sct output 7. match output 3 of timer 1. i/o extbus_a6 ? external memory address line 6. boot control pin 0 (see ta b l e 8 ). -n.c. p1_2 [2] r3 i; pu i/o gpio0[9] ? general purpose digital input/output pin. o ctout_6 ? sct output 6. match output 2 of timer 1. i/o extbus_a7 ? external memory address line 7. boot control pin 1 (see ta b l e 8 ). -n.c. p1_3 [2] p5 i; pu i/o gpio0[10] ? general purpose digital input/output pin. o ctout_8 ? sct output 8. match output 0 of timer 2. -n.c. o extbus_oe ? low active output enable signal. p1_4 [2] t3 i; pu i/o gpio0[11] ? general purpose digital input/output pin. o ctout_9 ? sct output 9. match output 1 of timer 2. -n.c. o extbus_bls0 ? low active byte lane select signal 0. p1_5 [2] r5 i; pu i/o gpio1[8] ? general purpose digital input/output pin. o ctout_10 ? sct output 10. match output 2 of timer 2. -n.c. o extbus_cs0 ? low active chip select 0 signal. p1_6 [2] t4 i; pu i/o gpio1[9] ? general purpose digital input/output pin. i ctin_5 ? sct input 5. capture input 2 of timer 2. -n.c. o extbus_we ? low active write enable signal. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1017 of 1164 nxp semiconductors UM10430 chapter 42: appendix p1_7 [2] t5 i; pu i/o gpio1[0] ? general purpose digital input/output pin. i u1_dsr ? data set ready input for uart1. o ctout_13 ? sct output 13. match output 1 of timer 3. i/o extbus_d0 ? external memory data line 0. p1_8 [2] r7 i; pu i/o gpio1[1] ? general purpose digital input/output pin. o u1_dtr ? data terminal ready output for uart1. o ctout_12 ? sct output 12. match output 0 of timer 3. i/o extbus_d1 ? external memory data line 1. p1_9 [2] t7 i; pu i/o gpio1[2] ? general purpose digital input/output pin. o u1_rts ? request to send output for uart1. o ctout_11 ? sct output 11. match output 3 of timer 2. i/o extbus_d2 ? external memory data line 2. p1_10 [2] r8 i; pu i/o gpio1[3] ? general purpose digital input/output pin. i u1_ri ? ring indicator input for uart1. o ctout_14 ? sct output 14. match output 2 of timer 3. i/o extbus_d3 ? external memory data line 3. p1_11 [2] t9 i; pu i/o gpio1[4] ? general purpose digital input/output pin. i u1_cts ? clear to send input for uart1. o ctout_15 ? sct output 15. match output 3 of timer 3. i/o extbus_d4 ? external memory data line 4. p1_12 [2] r9 i; pu i/o gpio1[5] ? general purpose digital input/output pin. i u1_dcd ? data carrier detect input for uart1. -n.c. i/o extbus_d5 ? external memory data line 5. p1_13 [2] r10 i; pu i/o gpio1[6] ? general purpose digital input/output pin. o u1_txd ? transmitter output for uart1. -n.c. i/o extbus_d6 ? external memory data line 6. p1_14 [2] r11 i; pu i/o gpio1[7] ? general purpose digital input/output pin. i u1_rxd ? receiver input for uart1. -n.c. i/o extbus_d7 ? external memory data line 7. p1_15 [2] t12 i; pu i/o gpio0[2] ? general purpose digital input/output pin. o u2_txd ? transmitter output for uart2. -n.c. i enet_rxd0 ? ethernet receive data 0 (rmii/mii interface). table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1018 of 1164 nxp semiconductors UM10430 chapter 42: appendix p1_16 [2] m7 i; pu i/o gpio0[3] ? general purpose digital input/output pin. i u2_rxd ? receiver input for uart2. -n.c. i enet_crs (enet_crs_dv) ? ethernet carrier sense (mii interface) or ethernet carrier sense/data valid (rmii interface). p1_17 [2] m8 i; pu i/o gpio0[12] ? general purpose digital input/output pin. i/o u2_uclk ? serial clock input/output for uart2 in synchronous mode. -n.c. i/o enet_mdio ? ethernet miim data input and output. p1_18 [2] n12 i; pu i/o gpio0[13] ? general purpose digital input/output pin. i/o u2_dir ? rs-485/eia-485 output enable/direction control for uart2. -n.c. o enet_txd0 ? ethernet transmit data 0 (rmii/mii interface). p1_19 [2] m11 i; pu i enet_tx_clk (enet_ref_clk) ? ethernet transmit clock (mii interface) or ethernet reference clock (rmii interface). i/o ssp1_sck ? serial clock for ssp1. -n.c. -n.c. p1_20 [2] m10 i; pu i/o gpio0[15] ? general purpose digital input/output pin. i/o ssp1_ssel ? slave select for ssp1. -n.c. o enet_txd1 ? ethernet transmit data 1 (rmii/mii interface). p2_0 [2] t16 i; pu - n.c. o u0_txd ? transmitter output for usart0. i/o extbus_a13 ? external memory address line 13. o usb0_pwr_en ? vbus drive signal (towards external charge pump or power management unit); indicates that vbus must be driven (active high). p2_1 [2] n15 i; pu - n.c. i u0_rxd ? receiver input for usart0. i/o extbus_a12 ? external memory address line 12. o usb0_pwr_fault ? port power fault signal indicating overcurrent condition; this signal monitors over-current on the usb bus (external circuitry required to detect over-current condition). p2_2 [2] m15 i; pu - n.c. i/o u0_uclk ? serial clock input/output for usart0 in synchronous mode. i/o extbus_a11 ? external memory address line 11. o usb0_ind1 ? usb0 port indicator led control output 1. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1019 of 1164 nxp semiconductors UM10430 chapter 42: appendix p2_3 [2] j12 i; pu - n.c. i/o i2c1_sda ? i 2 c1 data input/output (this pin does not use a specialized i2c pad). o u3_txd ? transmitter output for usart3. i ctin_1 ? sct input 1. capture input 1 of timer 0. capture input 1 of timer 2. p2_4 [2] k11 i; pu - n.c. i/o i2c1_scl ? i 2 c1 clock input/output (this pin does not use a specialized i2c pad). i u3_rxd ? receiver input for usart3. i ctin_0 ? sct input 0. capture input 0 of timer 0, 1, 2, 3. p2_5 [3] k14 i; pu - n.c. i ctin_2 ? sct input 2. capture input 2 of timer 0. i usb1_vbus ? monitors the presence of usb1 bus power. note: this signal must be high for usb reset to occur. i adctrig1 ? adc trigger input 1. p2_6 [2] k16 i; pu - n.c. i/o u0_dir ? rs-485/eia-485 output enable/direction control for usart0. i/o extbus_a10 ? external memory address line 10. o usb0_ind0 ? usb0 port indicator led control output 0. p2_7 [2] h14 i; pu i/o gpio0[7] ? general purpose digital input/output pin. o ctout_1 ? sct output 1. match output 1 of timer 0. i/o u3_uclk ? serial clock input/output for usart3 in synchronous mode. i/o extbus_a9 ? external memory address line 9. boot control pin 3 (see ta b l e 8 ). this pin must be high on reset. p2_8 [2] j16 i; pu - n.c. o ctout_0 ? sct output 0. match output 0 of timer 0. i/o u3_dir ? rs-485/eia-485 output enable/direction control for usart3. i/o extbus_a8 ? external memory address line 8. boot control pin 2 (see ta b l e 8 ). p2_9 [2] h16 i; pu i/o gpio1[10] ? general purpose digital input/output pin. o ctout_3 ? sct output 3. match output 3 of timer 0. i/o u3_baud3 ? for usart3. i/o extbus_a0 ? external memory address line 0. p2_10 [2] g16 i; pu i/o gpio0[14] ? general purpose digital input/output pin. o ctout_2 ? sct output 2. match output 2 of timer 0. o u2_txd ? transmitter output for usart2. i/o extbus_a1 ? external memory address line 1. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1020 of 1164 nxp semiconductors UM10430 chapter 42: appendix p2_11 [2] f16 i; pu i/o gpio1[11] ? general purpose digital input/output pin. o ctout_5 ? sct output 5. match output 1 of timer 1. i u2_rxd ? receiver input for usart2. i/o extbus_a2 ? external memory address line 2. p2_12 [2] e15 i; pu i/o gpio1[12] ? general purpose digital input/output pin. o ctout_4 ? sct output 4. match output 0 of timer 1. -n.c. i/o extbus_a3 ? external memory address line 3. p2_13 [2] c16 i; pu i/o gpio1[13] ? general purpose digital input/output pin. i ctin_4 ? sct input 4. capture input 2 of timer 1. -n.c. i/o extbus_a4 ? external memory address line 4. p3_0 [2] f13 i; pu i/o i2s_rx_sck ? receive clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification. o i2s_rx_mclk ? i2s receive master clock. i/o i2s_tx_sck ? i 2 s transmit clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification . o i2s_tx_mclk ? i2s transmit master clock. p3_1 [2] g11 i; pu i/o i2s_tx_ws ? transmit word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . i/o i2s_rx_ws ? receive word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . i can1_rd ? can1 receiver input. o usb1_ind1 ? usb1 port indicator led control output 1. p3_2 [2] f11 i; pu i/o i2s_tx_sda ? i 2 s transmit data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . i/o i2s_rx_sda ? i 2 s receive data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . o can1_td ? can1 transmitter output. o usb1_ind0 ? usb1 port indicator led control output 0. p3_3 [2] b14 i; pu - n.c. -n.c. i/o ssp0_sck ? serial clock for ssp0. o spifi_sck ? serial clock for spifi. p3_4 [2] a15 i; pu i/o gpio1[14] ? general purpose digital input/output pin. -n.c. -n.c. i/o spifi_sio3 ? i/o lane 3 for spifi. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1021 of 1164 nxp semiconductors UM10430 chapter 42: appendix p3_5 [2] c12 i; pu i/o gpio1[15] ? general purpose digital input/output pin. -n.c. -n.c. i/o spifi_sio2 ? i/o lane 2 for spifi. p3_6 [2] b13 i; pu i/o gpio0[6] ? general purpose digital input/output pin. -n.c. i/o ssp0_ssel ? slave select for ssp0. i/o spifi_miso ? input i1 in spifi quad mode; spifi output io1. p3_7 [2] c11 i; pu - n.c. -n.c. i/o ssp0_miso ? master in slave out for ssp0. i/o spifi_mosi ? input i0 in spifi quad mode; spifi output io0. p3_8 [2] c10 i; pu - n.c. -n.c. i/o ssp0_mosi ? master out slave in for ssp0. i/o spifi_cs ? spifi serial flash chip select. p4_0 [2] d5 i; pu i/o gpio2[0] ? general purpose digital input/output pin. o mcoa0 ? motor control pwm channel 0, output a. i nmi ? external interrupt input to nmi. -n.c. p4_1 [2] a1 i; pu i/o gpio2[1] ? general purpose digital input/output pin. o ctout_1 ? sct output 1. match output 1 of timer 0. o lcdvd0 ? lcd data. -n.c. p4_2 [2] d3 i; pu i/o gpio2[2] ? general purpose digital input/output pin. o ctout_0 ? sct output 0. match output 0 of timer 0. o lcdvd3 ? lcd data. -n.c. p4_3 [2] c2 i; pu i/o gpio2[3] ? general purpose digital input/output pin. o ctout_3 ? sct output 0. match output 3 of timer 0. o lcdvd2 ? lcd data. -n.c. p4_4 [2] b1 i; pu i/o gpio2[4] ? general purpose digital input/output pin. o ctout_2 ? sct output 2. match output 2 of timer 0. o lcdvd1 ? lcd data. -n.c. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1022 of 1164 nxp semiconductors UM10430 chapter 42: appendix p4_5 [2] d2 i; pu i/o gpio2[5] ? general purpose digital input/output pin. o ctout_5 ? sct output 5. match output 1 of timer 1. o lcdfp ? frame pulse (stn). vertical synchronization pulse (tft). -n.c. p4_6 [2] c1 i; pu i/o gpio2[6] ? general purpose digital input/output pin. o ctout_4 ? sct output 4. match output 0 of timer 1. o lcdenab/lcdm ? stn ac bias drive or tft data enable input. -n.c. p4_7 [2] h4 o;pu o lcddclk ? lcd panel clock. i gp_clkin ? general purpose clock input to the cgu. -n.c. -n.c. p4_8 [2] e2 i; pu - n.c. i ctin_5 ? sct input 5. capture input 2 of timer 2. o lcdvd9 ? lcd data. -n.c. p4_9 [2] l2 i; pu - n.c. i ctin_6 ? sct input 6. capture input 1 of timer 3. o lcdvd11 ? lcd data. -n.c. p4_10 [2] m3 i; pu - n.c. i ctin_2 ? sct input 2. capture input 2 of timer 0. o lcdvd10 ? lcd data. -n.c. p5_0 [2] n3 i; pu i/o gpio2[9] ? general purpose digital input/output pin. o mcob2 ? motor control pwm channel 2, output b. i/o extbus_d12 ? external memory data line 12. -n.c. p5_1 [2] p3 i; pu i/o gpio2[10] ? general purpose digital input/output pin. i mci2 ? motor control pwm channel 2, input. i/o extbus_d13 ? external memory data line 13. -n.c. p5_2 [2] r4 i; pu i/o gpio2[11] ? general purpose digital input/output pin. i mci1 ? motor control pwm channel 1, input. i/o extbus_d14 ? external memory data line 14. -n.c. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1023 of 1164 nxp semiconductors UM10430 chapter 42: appendix p5_3 [2] t8 i; pu i/o gpio2[12] ? general purpose digital input/output pin. i mci0 ? motor control pwm channel 0, input. i/o extbus_d15 ? external memory data line 15. -n.c. p5_4 [2] p9 i; pu i/o gpio2[13] ? general purpose digital input/output pin. o mcob0 ? motor control pwm channel 0, output b. i/o extbus_d8 ? external memory data line 8. -n.c. p5_5 [2] p10 i; pu i/o gpio2[14] ? general purpose digital input/output pin. o mcoa1 ? motor control pwm channel 1, output a. i/o extbus_d9 ? external memory data line 9. -n.c. p5_6 [2] t13 i; pu i/o gpio2[15] ? general purpose digital input/output pin. o mcob1 ? motor control pwm channel 1, output b. i/o extbus_d10 ? external memory data line 10. -n.c. p5_7 [2] r12 i; pu i/o gpio2[7] ? general purpose digital input/output pin. o mcoa2 ? motor control pwm channel 2, output a. i/o extbus_d11 ? external memory data line 11. -n.c. p6_0 m12 i; pu i/o i2s_rx_sck ? receive clock. it is driven by the master and received by the slave. corresponds to the signal sck in the i 2 s-bus specification . o i2s_rx_mclk ? i2s receive master clock. -n.c. -n.c. p6_1 [2] r15 i; pu i/o gpio3[0] ? general purpose digital input/output pin. o extbus_dycs1 ? sdram chip select 1. i/o u0_uclk ? serial clock input/output for usart0 in synchronous mode. i/o i2s_rx_ws ? receive word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . p6_2 [2] l13 i; pu i/o gpio3[1] ? general purpose digital input/output pin. o extbus_ckeout1 ? sdram clock enable 1. i/o u0_dir ? rs-485/eia-485 output enable/direction control for usart0. i/o i2s_rx_sda ? i 2 s receive data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . p6_3 [2] p15 i; pu i/o gpio3[2] ? general purpose digital input/output pin. o usb0_pwr_en ? vbus drive signal (towards external charge pump or power management unit); indicates that vbus must be driven (active high). -n.c. o extbus_cs1 ? low active chip select 1 signal. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1024 of 1164 nxp semiconductors UM10430 chapter 42: appendix p6_4 [2] r16 i; pu i/o gpio3[3] ? general purpose digital input/output pin. i ctin_6 ? sct input 6. capture input 1 of timer 3. o u0_txd ? transmitter output for usart0. o extbus_cas ? low active sdram column address strobe. p6_5 [2] p16 i; pu i/o gpio3[4] ? general purpose digital input/output pin. o ctout_6 ? sct output 6. match output 2 of timer 1. i u0_rxd ? receiver input for usart0. o extbus_ras ? low active sdram row address strobe. p6_6 [2] l14 i; pu i/o gpio0[5] ? general purpose digital input/output pin. o extbus_bls1 ? low active byte lane select signal 1. -n.c. o usb0_pwr_fault ? port power fault signal indicating overcurrent condition; this signal monitors over-current on the usb bus (external circuitry required to detect over-current condition). p6_7 [2] j13 i; pu - n.c. i/o extbus_a15 ? external memory address line 15. -n.c. o usb0_ind1 ? usb0 port indicator led control output 1. p6_8 [2] h13 i; pu - n.c. i/o extbus_a14 ? external memory address line 14. -n.c. o usb0_ind0 ? usb0 port indicator led control output 0. p6_9 [2] j15 i; pu i/o gpio3[5] ? general purpose digital input/output pin. -n.c. -n.c. o extbus_dycs0 ? sdram chip select 0. p6_10 [2] h15 i; pu i/o gpio3[6] ? general purpose digital input/output pin. o mcabort ? motor control pwm, low-active fast abort. -n.c. o extbus_dqmout1 ? data mask 1 used with sdram and static devices. p6_11 [2] h12 i; pu i/o gpio3[7] ? general purpose digital input/output pin. -n.c. -n.c. o extbus_ckeout0 ? sdram clock enable 0. p6_12 [2] g15 i; pu i/o gpio2[8] ? general purpose digital input/output pin. o ctout_7 ? sct output 7. match output 3 of timer 1. -n.c. o extbus_dqmout0 ? data mask 0 used with sdram and static devices. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1025 of 1164 nxp semiconductors UM10430 chapter 42: appendix p7_0 [2] b16 i; pu i/o gpio3[8] ? general purpose digital input/output pin. o ctout_14 ? sct output 14. match output 2 of timer 3. -n.c. o lcdle ? line end signal. p7_1 [2] c14 i; pu i/o gpio3[9] ? general purpose digital input/output pin. o ctout_15 ? sct output 15. match output 3 of timer 3. i/o i2s_tx_ws ? transmit word select. it is driven by the master and received by the slave. corresponds to the signal ws in the i 2 s-bus specification . o lcdvd19 ? lcd data. p7_2 [2] a16 i; pu i/o gpio3[10] ? general purpose digital input/output pin. i ctin_4 ? sct input 4. capture input 2 of timer 1. i/o i2s_tx_sda ? i 2 s transmit data. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i 2 s-bus specification . o lcdvd18 ? lcd data. p7_3 [2] c13 i; pu i/o gpio3[11] ? general purpose digital input/output pin. i ctin_3 ? sct input 3. capture input 1 of timer 1. -n.c. o lcdvd17 ? lcd data. p7_4 [2] c8 i; pu i/o gpio3[12] ? general purpose digital input/output pin. o ctout_13 ? sct output 13. match output 1 of timer 3. -n.c. o lcdvd16 ? lcd data. p7_5 [2] a7 i; pu i/o gpio3[13] ? general purpose digital input/output pin. o ctout_12 ? sct output 12. match output 0 of timer 3. -n.c. o lcdvd8 ? lcd data. p7_6 [2] c7 i; pu i/o gpio3[14] ? general purpose digital input/output pin. o ctout_11 ? sct output 1. match output 3 of timer 2. -n.c. o lcdlp ? line synchronization pulse (stn). horizontal synchronization pulse (tft). p7_7 [2] b6 i; pu i/o gpio3[15] ? general purpose digital input/output pin. o ctout_8 ? sct output 8. match output 0 of timer 2. -n.c. o lcdpwr ? lcd panel power enable. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1026 of 1164 nxp semiconductors UM10430 chapter 42: appendix p8_0 [2] e5 i; pu i/o gpio4[0] ? general purpose digital input/output pin. o usb0_pwr_fault ? port power fault signal indicating overcurrent condition; this signal monitors over-current on the usb bus (external circuitry required to detect over-current condition). -n.c. i mci2 ? motor control pwm channel 2, input. p8_1 [2] h5 i; pu i/o gpio4[1] ? general purpose digital input/output pin. o usb0_ind1 ? usb0 port indicator led control output 1. -n.c. i mci1 ? motor control pwm channel 1, input. p8_2 [2] k4 i; pu i/o gpio4[2] ? general purpose digital input/output pin. o usb0_ind0 ? usb0 port indicator led control output 0. -n.c. i mci0 ? motor control pwm channel 0, input. p8_3 [2] j3 i; pu i/o gpio4[3] ? general purpose digital input/output pin. i/o usb1_ulpi_d2 ? ulpi link bidirectional data line 2. -n.c. o lcdvd12 ? lcd data. p8_4 [2] j2 i; pu i/o gpio4[4] ? general purpose digital input/output pin. i/o usb1_ulpi_d1 ? ulpi link bidirectional data line 1. -n.c. o lcdvd7 ? lcd data. p8_5 [2] j1 i; pu i/o gpio4[5] ? general purpose digital input/output pin. i/o usb1_ulpi_d0 ? ulpi link bidirectional data line 0. -n.c. o lcdvd6 ? lcd data. p8_6 [2] k3 i; pu i/o gpio4[6] ? general purpose digital input/output pin. i usb1_ulpi_nxt ? ulpi link nxt signal. data flow control signal from the phy. -n.c. o lcdvd5 ? lcd data. p8_7 [2] k1 i; pu i/o gpio4[7] ? general purpose digital input/output pin. o usb1_ulpi_stp ? ulpi link stp signal. asserted to end or interrupt transfers to the phy. -n.c. o lcdvd4 ? lcd data. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1027 of 1164 nxp semiconductors UM10430 chapter 42: appendix p8_8 [2] l1 i; pu - n.c. i usb1_ulpi_clk ? ulpi link clk signal. 60 mhz clock generated by the phy. -n.c. -n.c. p9_0 [2] t1 i; pu i/o gpio4[12] ? general purpose digital input/output pin. o mcabort ? motor control pwm, low-active fast abort. -n.c. -n.c. p9_1 [2] n6 i; pu i/o gpio4[13] ? general purpose digital input/output pin. o mcoa2 ? motor control pwm channel 2, output a. -n.c. -n.c. p9_2 [2] n8 i; pu i/o gpio4[14] ? general purpose digital input/output pin. o mcob2 ? motor control pwm channel 2, output b. -n.c. -n.c. p9_3 [2] m6 i; pu i/o gpio4[15] ? general purpose digital input/output pin. o mcoa0 ? motor control pwm channel 0, output a. o usb1_ind1 ? usb1 port indicator led control output 1. -n.c. p9_4 [2] n10 i; pu - n.c. o mcob0 ? motor control pwm channel 0, output b. o usb1_ind0 ? usb1 port indicator led control output 0. -n.c. p9_5 [2] m9 i; pu - n.c. o mcoa1 ? motor control pwm channel 1, output a. o usb1_vbus_en ? usb1 vbus power enable. -n.c. p9_6 [2] l11 i; pu i/o gpio4[11] ? general purpose digital input/output pin. o mcob1 ? motor control pwm channel 1, output b. o usb1_pwr_fault ? usb1 port power fault signal indicating over-current condition; this signal monitors over-current on the usb1 bus (external circuitry required to detect over-current condition). -n.c. pa_0 [2] l12 i; pu - n.c. -n.c. -n.c. -n.c. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1028 of 1164 nxp semiconductors UM10430 chapter 42: appendix pa_1 [2] j14 i; pu i/o gpio4[8] ? general purpose digital input/output pin. i qei_idx ? quadrature encoder interface index input. -n.c. -n.c. pa_2 [2] k15 i; pu i/o gpio4[9] ? general purpose digital input/output pin. i qei_phb ? quadrature encoder interface phb input. -n.c. -n.c. pa_3 [2] h11 i; pu i/o gpio4[10] ? general purpose digital input/output pin. i qei_pha ? quadrature encoder interface pha input. -n.c. -n.c. pa_4 [2] g13 i; pu - n.c. o ctout_9 ? sct output 9. match output 1 of timer 2. -n.c. i/o extbus_a23 ? external memory address line 23. pb_0 [2] b15 i; pu - n.c. o ctout_10 ? sct output 10. match output 2 of timer 2. o lcdvd23 ? lcd data. -n.c. pb_1 [2] a14 i; pu - n.c. i usb1_ulpi_dir ? ulpi link dir signal. controls the ulp data line direction. o lcdvd22 ? lcd data. -n.c. pb_2 [2] b12 i; pu - n.c. i/o usb1_ulpi_d7 ? ulpi link bidirectional data line 7. o lcdvd21 ? lcd data. -n.c. pb_3 [2] a13 i; pu - n.c. i/o usb1_ulpi_d6 ? ulpi link bidirectional data line 6. o lcdvd20 ? lcd data. -n.c. pb_4 [2] b11 i; pu - n.c. i/o usb1_ulpi_d5 ? ulpi link bidirectional data line 5. o lcdvd15 ? lcd data. -n.c. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1029 of 1164 nxp semiconductors UM10430 chapter 42: appendix pb_5 [2] a12 i; pu - n.c. i/o usb1_ulpi_d4 ? ulpi link bidirectional data line 4. o lcdvd14 ? lcd data. -n.c. pb_6 [2] a6 i; pu - n.c. i/o usb1_ulpi_d3 ? ulpi link bidirectional data line 3. o lcdvd13 ? lcd data. -n.c. pc_0 [2] d4 i; pu i/o sdio_clk ? sd/mmc card clock. i usb1_ulpi_clk ? ulpi link clk signal. 60 mhz clock generated by the phy. i/o sdio_clk ? sd/mmc card clock. i/o enet_rx_clk ? ethernet receive clock (mii interface). pc_1 [2] e4 i; pu i/o usb1_ulpi_d7 ? ulpi link bidirectional data line 7. o sdio_volt0 ? sd/mmc bus voltage select output 0. i u1_ri ? ring indicator input for uart 1. o enet_mdc ? ethernet miim clock. pc_2 [2] f6 i; pu i/o usb1_ulpi_d6 ? ulpi link bidirectional data line 6. o sdio_rst ? sd/mmc reset signal for mmc4.4 card. i u1_cts ? clear to send input for uart 1. o enet_txd2 ? ethernet transmit data 2 (mii interface). pc_3 [2] f5 i; pu i/o usb1_ulpi_d5 ? ulpi link bidirectional data line 5. o sdio_volt1 ? sd/mmc bus voltage select output 1. o u1_rts ? request to send output for uart 1. can also be configured to be an rs-485/eia-485 output enable signal for uart 1. o enet_txd3 ? ethernet transmit data 3 (mii interface). pc_4 [2] f4 i; pu i/o sdio_d0 ? sd/mmc data bus line 0. i/o usb1_ulpi_d4 ? ulpi link bidirectional data line 4. -n.c. o enet_tx_en ? ethernet transmit data enable (rmii/mii interface). pc_5 [2] g4 i; pu i/o sdio_d1 ? sd/mmc data bus line 1. i/o usb1_ulpi_d3 ? ulpi link bidirectional data line 3. -n.c. o enet_tx_er ? ethernet transmit error (mii interface). pc_6 [2] h6 i; pu i/o sdio_d2 ? sd/mmc data bus line 2. i/o usb1_ulpi_d2 ? ulpi link bidirectional data line 2. -n.c. i enet_rxd2 ? ethernet receive data 2 (mii interface). table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1030 of 1164 nxp semiconductors UM10430 chapter 42: appendix pc_7 [2] g5 i; pu i/o sdio_d3 ? sd/mmc data bus line 3. i/o usb1_ulpi_d1 ? ulpi link bidirectional data line 1. -n.c. i enet_rxd3 ? ethernet receive data 3 (mii interface). pc_8 [2] n4 i; pu i sdio_cd ? sd/mmc card detect input. i/o usb1_ulpi_d0 ? ulpi link bidirectional data line 0. -n.c. i enet_rx_dv ? ethernet receive data valid (mii interface). pc_9 [2] k2 i; pu o sdio_pow ? . i usb1_ulpi_nxt ? ulpi link nxt signal. data flow control signal from the phy. -n.c. i enet_rx_er ? ethernet receive error (mii interface). pc_10 [2] m5 i; pu i/o sdio_cmd ? sd/mmc command signal. o usb1_ulpi_stp ? ulpi link stp signal. asserted to end or interrupt transfers to the phy. i u1_dsr ? data set ready input for uart 1. -n.c. pc_11 [2] l5 i; pu i/o sdio_d4 ? sd/mmc data bus line 4. i usb1_ulpi_dir ? ulpi link dir signal. controls the ulp data line direction. i u1_dcd ? data carrier detect input for uart 1. -n.c. pc_12 [2] l6 i; pu i/o sdio_d5 ? sd/mmc data bus line 5. -n.c. o u1_dtr ? data terminal ready output for uart 1. can also be configured to be an rs-485/eia-485 output enable signal for uart 1. -n.c. pc_13 [2] m1 i; pu i/o sdio_d6 ? sd/mmc data bus line 6. -n.c. o u1_txd ? transmitter output for uart 1. -n.c. pc_14 [2] n1 i; pu i/o sdio_d7 ? sd/mmc data bus line 7. -n.c. i u1_rxd ? receiver input for uart 1. -n.c. pd_0 [2] n2 i; pu - n.c. o ctout_15 ? sct output 15. match output 3 of timer 3. o extbus_dqmout2 ? data mask 2 used with sdram and static devices. -n.c. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1031 of 1164 nxp semiconductors UM10430 chapter 42: appendix pd_1 [2] p1 i; pu - n.c. -n.c. o extbus_ckeout2 ? sdram clock enable 2. -n.c. pd_2 [2] r1 i; pu - n.c. o ctout_7 ? sct output 7. match output 3 of timer 1. i/o extbus_d16 ? external memory data line 16. -n.c. pd_3 [2] p4 i; pu - n.c. o ctout_6 ? sct output 7. match output 2 of timer 1. i/o extbus_d17 ? external memory data line 17. -n.c. pd_4 [2] t2 i; pu - n.c. o ctout_8 ? sct output 8. match output 0 of timer 2. i/o extbus_d18 ? external memory data line 18. -n.c. pd_5 [2] p6 i; pu - n.c. o ctout_9 ? sct output 9. match output 1 of timer 2. i/o extbus_d19 ? external memory data line 19. -n.c. pd_6 [2] r6 i; pu - n.c. o ctout_10 ? sct output 10. match output 2 of timer 2. i/o extbus_d20 ? external memory data line 20. -n.c. pd_7 [2] t6 i; pu - n.c. i ctin_5 ? sct input 5. capture input 2 of timer 2. i/o extbus_d21 ? external memory data line 21. -n.c. pd_8 [2] p8 i; pu - n.c. i ctin_6 ? sct input 6. capture input 1 of timer 3. i/o extbus_d22 ? external memory data line 22. -n.c. pd_9 [2] t11 i; pu - n.c. o ctout_13 ? sct output 13. match output 1 of timer 3. i/o extbus_d23 ? external memory data line 23. -n.c. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1032 of 1164 nxp semiconductors UM10430 chapter 42: appendix pd_10 [2] p11 i; pu - n.c. i ctin_1 ? sct input 1. capture input 1 of timer 0. capture input 1 of timer 2. o extbus_bls3 ? low active byte lane select signal 3. -n.c. pd_11 [2] n9 i; pu - n.c. -n.c. o extbus_cs3 ? low active chip select 3 signal. -n.c. pd_12 [2] n11 i; pu - n.c. -n.c. o extbus_cs2 ? low active chip select 2 signal. -n.c. pd_13 [2] t14 i; pu - n.c. i ctin_0 ? sct input 0. capture input 0 of timer 0, 1, 2, 3. o extbus_bls2 ? low active byte lane select signal 2. -n.c. pd_14 [2] r13 i; pu - n.c. -n.c. o extbus_dycs2 ? sdram chip select 2. -n.c. pd_15 [2] t15 i; pu - n.c. -n.c. i/o extbus_a17 ? external memory address line 17. -n.c. pd_16 [2] r14 i; pu - n.c. -n.c. i/o extbus_a16 ? external memory address line 16. -n.c. pe_0 [2] p14 i; pu - n.c. -n.c. -n.c. i/o extbus_a18 ? external memory address line 18. pe_1 [2] n14 i; pu - n.c. -n.c. -n.c. i/o extbus_a19 ? external memory address line 19. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1033 of 1164 nxp semiconductors UM10430 chapter 42: appendix pe_2 [2] m14 i; pu i adctrig0 ? adc trigger input 0. i can1_rd ? can1 receiver input. -n.c. i/o extbus_a20 ? external memory address line 20. pe_3 [2] k12 i; pu - n.c. o can1_td ? can1 transmitter output. i adctrig1 ? adc trigger input 1. i/o extbus_a21 ? external memory address line 21. pe_4 [2] k13 i; pu - n.c. i nmi ? external interrupt input to nmi. -n.c. i/o extbus_a22 ? external memory address line 22. pe_5 [2] n16 i; pu - n.c. o ctout_3 ? sct output 3. match output 3 of timer 0. o u1_rts ? request to send output for uart 1. can also be configured to be an rs-485/eia-485 output enable signal for uart 1. i/o extbus_d24 ? external memory data line 24. pe_6 [2] m16 i; pu - n.c. o ctout_2 ? sct output 2. match output 2 of timer 0. i u1_ri ? ring indicator input for uart 1. i/o extbus_d25 ? external memory data line 25. pe_7 [2] f15 i; pu - n.c. o ctout_5 ? sct output 5. match output 1 of timer 1. i u1_cts ? clear to send input for uart1. i/o extbus_d26 ? external memory data line 26. pe_8 [2] f14 i; pu - n.c. o ctout_4 ? sct output 4. match output 0 of timer 0. i u1_dsr ? data set ready input for uart 1. i/o extbus_d27 ? external memory data line 27. pe_9 [2] e16 i; pu - n.c. i ctin_4 ? sct input 4. capture input 2 of timer 1. i u1_dcd ? data carrier detect input for uart 1. i/o extbus_d28 ? external memory data line 28. pe_10 [2] e14 i; pu - n.c. i ctin_3 ? sct input 3. capture input 1 of timer 1. o u1_dtr ? data terminal ready output for uart 1. can also be configured to be an rs-485/eia-485 output enable signal for uart 1. i/o extbus_d29 ? external memory data line 29. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1034 of 1164 nxp semiconductors UM10430 chapter 42: appendix pe_11 [2] d16 i; pu - n.c. o ctout_12 ? sct output 12. match output 0 of timer 3. o u1_txd ? transmitter output for uart 1. i/o extbus_d30 ? external memory data line 30. pe_12 [2] d15 i; pu - n.c. o ctout_11 ? sct output 11. match output 3 of timer 2. i u1_rxd ? receiver input for uart 1. i/o extbus_d31 ? external memory data line 31. pe_13 [2] g14 i; pu - n.c. o ctout_14 ? sct output 14. match output 2 of timer 3. i/o i2c1_sda ? i 2 c1 data input/output (this pin does not use a specialized i2c pad). o extbus_dqmout3 ? data mask 3 used with sdram and static devices. pe_14 [2] c15 i; pu - n.c. -n.c. -n.c. o extbus_dycs3 ? sdram chip select 3. pe_15 [2] e13 i; pu - n.c. o ctout_0 ? sct output 0. match output 0 of timer 0. i/o i2c1_scl ? i 2 c1 clock input/output (this pin does not use a specialized i2c pad). o extbus_ckeout3 ? sdram clock enable 3. pf_0 [2] d12 i;ia i/o ssp0_sck ? serial clock for ssp0. -n.c. -n.c. -n.c. pf_1 [2] e11 i; pu - n.c. -n.c. i/o ssp0_ssel ? slave select for ssp0. -n.c. pf_2 [2] d11 i; pu - n.c. o u3_txd ? transmitter output for usart3. i/o ssp0_miso ? master in slave out for ssp0. -n.c. pf_3 [2] e10 i; pu - n.c. i u3_rxd ? receiver input for usart3. i/o ssp0_mosi ? master out slave in for ssp0. -n.c. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1035 of 1164 nxp semiconductors UM10430 chapter 42: appendix pf_4 [2] d10 i;ia i/o ssp1_sck ? serial clock for ssp1. i gp_clkin ? general purpose clock input to the cgu. o traceclk ? trace clock. -n.c. pf_5 [2] e9 i; pu - n.c. i/o u3_uclk ? serial clock input/output for usart3 in synchronous mode. i/o ssp1_ssel ? slave select for ssp1. o tracedata[0] ? trace data, bit 0. pf_6 [2] e7 i; pu - n.c. i/o u3_dir ? rs-485/eia-485 output enable/direction control for usart3. i/o ssp1_miso ? master in slave out for ssp1. o tracedata[1] ? trace data, bit 1. pf_7 [2] b7 i; pu - n.c. i/o u3_baud ? for usart3. i/o ssp1_mosi ? master out slave in for ssp1. o tracedata[2] ? trace data, bit 2. pf_8 [2] e6 i; pu - n.c. i/o u0_uclk ? serial clock input/output for usart0 in synchronous mode. i ctin_2 ? sct input 2. capture input 2 of timer 0. o tracedata[3] ? trace data, bit 3. pf_9 [2] d6 i; pu - n.c. i/o u0_dir ? rs-485/eia-485 output enable/direction control for usart0. o ctout_1 ? sct output 1. match output 1 of timer 0. -n.c. pf_10 [2] a3 i; pu - n.c. o u0_txd ? transmitter output for usart0. i sdio_wp ? sd/mmc card write protect input. -n.c. pf_11 [2] a2 i; pu - n.c. i u0_rxd ? receiver input for usart0. o sdio_volt2 ? sd/mmc bus voltage select output 2. -n.c. clock pins clk0 [4] n5 o; pu o extbus_clk0 ? sdram clock 0. o clkout ? clock output pin. -n.c. -n.c. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1036 of 1164 nxp semiconductors UM10430 chapter 42: appendix clk1 [2] t10 o; pu o extbus_clk1 ? sdram clock 1. o clkout ? clock output pin. -n.c. -n.c. clk2 [2] d14 o; pu o extbus_clk3 ? sdram clock 3. o clkout ? clock output pin. -n.c. -n.c. clk3 [2] p12 o; pu o extbus_clk2 ? sdram clock 2. o clkout ? clock output pin. -n.c. -n.c. debug pins - dbgen [2] l4 i; pd i jtag interface control signal. also used for boundary scan. tck/swdclk [2] j5 i; f i test clock for jtag interface (default) or serial wire (sw) clock. trst [2] m4 i; pu i test reset for jtag interface. tms/swdio [2] k6 i; pu i test mode select for jtag interface (default) or sw debug data input/output. tdo/swo [2] k5 o; pu o test data out for jtag interface (default) or sw trace output. tdi [2] j4 i; pu i test data in for jtag interface. i 2 c-bus pins i2c0_scl [8] l15 i; f i/o i 2 c clock input/output. open-drain output (for i 2 c-bus compliance). i2c0_sda [8] l16 i; f i/o i 2 c data input/output. open-drain output (for i 2 c-bus compliance). usb0 pins usb0_dp [5] f2 - i/o usb0 bidirectional d+ line. usb0_dm [5] g2 - i/o usb0 bidirectional d ? line. usb0_vbus [5] f1 - i/o vbus pin (power on usb cable). usb0_id [6] h2 - i indicates to the transceiver whether connected a a-device (id low) or b-device (id high). usb0_rref [6] h1 - - usb connection for external reference resistor (12.0 k ? ? 1 %) to analog ground supply. usb1 pins usb1_dp [7] f12 - i/o usb1 bidirectional d+ line. usb1_dm [7] g12 - i/o usb1 bidirectional d ? line. reset and wake-up pins reset [9] d9 i; ia i external reset input: a low on this pin resets the device, causing i/o ports and peripherals to take on their default states, and processor execution to begin at address 0. wakeup0 a9 i; ia i external wake-up input; can rais e an interrupt and can cause wake-up from any of the low power modes. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1037 of 1164 nxp semiconductors UM10430 chapter 42: appendix wakeup1 a10 i; ia i external wake-up input; can rais e an interrupt and can cause wake-up from any of the low power modes. wakeup2 c9 i; ia i external wake-up input; can rais e an interrupt and can cause wake-up from any of the low power modes. wakeup3 d8 i; ia i external wake-up input; can rais e an interrupt and can cause wake-up from any of the low power modes. adc pins adc0 [6] e3 i; ia - adc0/1 input channel 0. shared between adc0, adc1, and dac. adc1 [6] c3 i; ia - adc0/1 input channel 1. adc2 [6] a4 i; ia - adc0/1 input channel 2. adc3 [6] b5 i; ia - adc0/1 input channel 3. adc4 [6] c6 i; ia - adc0/1 input channel 4. adc5 [6] b3 i; ia - adc0/1 input channel 5. adc6 [6] a5 i; ia - adc0/1 input channel 6. adc7 [6] c5 i; ia - adc0/1 input channel 7. rtc rtc_alarm a11 - - rtc controlled output. rtcx1 a8 - - input to the rtc 32 khz ultra-low power oscillator circuit. rtcx2 b8 - - output from the rtc 32 khz ultra-low power oscillator circuit. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1038 of 1164 nxp semiconductors UM10430 chapter 42: appendix crystal oscillator pins xtal1 [6] d1 - i input to the oscillator circuit and internal clock generator circuits. xtal2 [6] e1 - o output from the oscillator amplifier. power and ground pins usb0_vdda3v3_ driver f3 - - separate analog 3.3 v power supply for driver. usb0_vdda3v3 g3 - - usb 3.3 v separate power supply voltage usb0_vssa_term h3 - - dedicated analog ground for clean reference for te rmination resistors. usb0_vssa_ref g1 - - dedicated clean analog ground for generation of reference currents and voltages. vdda b4 - - analog power supply. vbat b10 - - rtc power supply: 3.3 v on this pin supplies power to the rtc. vddreg f10; f9; l8; l7; - - main regulator power supply vpp e8 - - otp programming voltage vddio f7; j7; n7; l10; e12; n13; l9; h10; g10; d7; j6; f8; k7 - - i/o power supply vssa b2 - - ground vss h7; k8; g9; j11; j10 - - ground table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1039 of 1164 nxp semiconductors UM10430 chapter 42: appendix [1] i = input; o = output; ia = inactive; pu = pull-up enabled; pd = pull-down enabled; f = floating. [2] digital i/o pin. not 5 v tolerant. [3] digital i/o pin. 5 v tolerant. [4] digital high-speed i/o pin. [5] 5 v tolerant analog i/o pin. [6] 3.3 v tolerant analog i/o pin. [7] 5 v tolerant usb i/o pin. [8] i 2 c-bus 5 v tolerant open-drain pin. [9] reset input pin; . 42.7 lpc1850/30/20/10 rev ?-? scu 42.7.1 how to read this chapter the following peripherals are not available on all parts: ? ethernet: available on lpc1850/30. ? usb0: available on lpc1850/30/20. ? usb1: available on lpc1850/30. for peripherals not available, the corresponding functions are reserved in the sfsp registers. 42.7.2 basic configuration the scu is configured as follows: ? see ta b l e 9 0 1 for clocking and power control. ? the scu is reset by the scu_rst (reset # 9). vssio g6; j8; j9; k9; k10; p7; m13; p13; d13; g8; h8; g7; c4; h9 - - ground pins not connected - b9 - - n.c. table 963. pin description ?continued symbol lbga256 reset state [1] type description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1040 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.7.3 general description the system control unit determines the function and electrical mode of the digital pins. by default function 0 is selected for all pins with pull-up enabled. remark: analog i/os for the adcs and the dac as well as several usb functions reside on separate pins and are not controlled through the scu. 42.7.3.1 digital pin function the func bits in the sfsx_y registers control the function of each pi n. if the function is gpio, the gpiondir registers determine whet her the pin is configured as an input or output (see ta b l e 2 8 0 ). for any peripheral function, the pin direction is controlled automatically depending on the pin?s functionality. the gpiondir registers have no effect for peripheral functions. 42.7.3.2 digital pin mode the mode bits in the sfsx_y registers allow the selection of on-chip pull-up or pull-down resistors for each pin or select the repeater mode. the possible on-chip resistor configurations are pull-up enabled, pull-down enabled, or no pull-up/pull-down. the default value is pull-up enabled. the repeater mode enables the pull-up resistor if the pin is at a logic high and enables the pull-down resistor if the pin is at a logic low. this causes the pin to retain its last known state if it is configured as an input a nd is not driven externally. repeater mode may typically be used to prevent a pin from floating (and potentially using significant power if it floats to an indeterminate state) if it is temporarily not driven. 42.7.3.3 i 2 c0-bus pins the ehs bits of the sfsi2c0 register ( ta b l e 9 6 8 ) configure different i 2 c-modes: ? standard mode/fast-mode i 2 c (this includes an open-drain output according to the i 2 c-bus specification). ? fast-mode plus and high-speed mode with input glitch filter (this includes an open-drain output according to the i 2 c-bus specification). 42.7.3.4 usb1 dp1/dm1 pins 42.7.3.5 emc signal delay control the scu contains a programmable delay control for all emc input and output data, address, and control signals. for detail on use of the emc delay modes, see ta b l e 2 7 1 . table 964. scu clocking and power control base clock branch clock maximum frequency clock to scu register interf ace base_m3_clk clk_m3_scu 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1041 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.7.4 register description table 965. register overview: system control unit (scu) (base address 0x4008 6000) name access address offset description reset value pins p0_n sfsp0_0 r/w 0x000 pin configuration register for pin p0_0 0x00 sfsp0_1 r/w 0x004 pin configuration register for pin p0_1 0x00 - - 0x008 - 0x07c reserved - pins p1_n sfsp1_0 r/w 0x080 pin configuration register for pin p1_0 0x00 sfsp1_1 r/w 0x084 pin configuration register for pin p1_1 0x00 sfsp1_2 r/w 0x088 pin configuration register for pin p1_2 0x00 sfsp1_3 r/w 0x08c pin configuration register for pin p1_3 0x00 sfsp1_4 r/w 0x090 pin configuration register for pin p1_4 0x00 sfsp1_5 r/w 0x094 pin configuration register for pin p1_5 0x00 sfsp1_6 r/w 0x098 pin configuration register for pin p1_6 0x00 sfsp1_7 r/w 0x09c pin configuration register for pin p1_7 0x00 sfsp1_8 r/w 0x0a0 pin configuration register for pin p1_8 0x00 sfsp1_9 r/w 0x0a4 pin configuration register for pin p1_9 0x00 sfsp1_10 r/w 0x0a8 pin configuration register for pin p1_10 0x00 sfsp1_11 r/w 0x0ac pin configuration register for pin p1_11 0x00 sfsp1_12 r/w 0x0b0 pin configuration register for pin p1_12 0x00 sfsp1_13 r/w 0x0b4 pin configuration register for pin p1_13 0x00 sfsp1_14 r/w 0x0b8 pin configuration register for pin p1_14 0x00 sfsp1_15 r/w 0x0bc pin configuration register for pin p1_15 0x00 sfsp1_16 r/w 0x0c0 pin configuration register for pin p1_16 0x00 sfsp1_17 r/w 0x0c4 pin configuration register for pin p1_17 0x00 sfsp1_18 r/w 0x0c8 pin configuration register for pin p1_18 0x00 sfsp1_19 r/w 0x0cc pin configuration register for pin p1_19 0x00 sfsp1_20 r/w 0x0d0 pin configuration register for pin p1_20 0x00 - - 0x0d4 - 0x0fc reserved - pins p2_n sfsp2_0 r/w 0x100 pin configuration register for pin p2_0 0x00 sfsp2_1 r/w 0x104 pin configuration register for pin p2_1 0x00 sfsp2_2 r/w 0x108 pin configuration register for pin p2_2 0x00 sfsp2_3 r/w 0x10c pin configuration register for pin p2_3 0x00 sfsp2_4 r/w 0x110 pin configuration register for pin p2_4 0x00 sfsp2_5 r/w 0x114 pin configuration register for pin p2_5 0x00 sfsp2_6 r/w 0x118 pin configuration register for pin p2_6 0x00 sfsp2_7 r/w 0x11c pin configuration register for pin p2_7 0x00 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1042 of 1164 nxp semiconductors UM10430 chapter 42: appendix sfsp2_8 r/w 0x120 pin configuration register for pin p2_8 0x00 sfsp2_9 r/w 0x124 pin configuration register for pin p2_9 0x00 sfsp2_10 r/w 0x128 pin configuration register for pin p2_10 0x00 sfsp2_11 r/w 0x12c pin configuration register for pin p2_11 0x00 sfsp2_12 r/w 0x130 pin configuration register for pin p2_12 0x00 sfsp2_13 r/w 0x134 pin configuration register for pin p2_13 0x00 - - 0x138 - 0x17c reserved - pins p3_n sfsp3_0 r/w 0x180 pin configuration register for pin p3_0 0x00 sfsp3_1 r/w 0x184 pin configuration register for pin p3_1 0x00 sfsp3_2 r/w 0x188 pin configuration register for pin p3_2 0x00 sfsp3_3 r/w 0x18c pin configuration register for pin p3_3 0x00 sfsp3_4 r/w 0x190 pin configuration register for pin p3_4 0x00 sfsp3_5 r/w 0x194 pin configuration register for pin p3_5 0x00 sfsp3_6 r/w 0x198 pin configuration register for pin p3_6 0x00 sfsp3_7 r/w 0x19c pin configuration register for pin p3_7 0x00 sfsp3_8 r/w 0x1a0 pin configuration register for pin p3_8 0x00 - - 0x1a4 - 0x1fc reserved - pins p4_n sfsp4_0 r/w 0x200 pin configuration register for pin p4_0 0x00 sfsp4_1 r/w 0x204 pin configuration register for pin p4_1 0x00 sfsp4_2 r/w 0x208 pin configuration register for pin p4_2 0x00 sfsp4_3 r/w 0x20c pin configuration register for pin p4_3 0x00 sfsp4_4 r/w 0x210 pin configuration register for pin p4_4 0x00 sfsp4_5 r/w 0x214 pin configuration register for pin p4_5 0x00 sfsp4_6 r/w 0x218 pin configuration register for pin p4_6 0x00 sfsp4_7 r/w 0x21c pin configuration register for pin p4_7 0x00 sfsp4_8 r/w 0x220 pin configuration register for pin p4_8 0x00 sfsp4_9 r/w 0x224 pin configuration register for pin p4_9 0x00 sfsp4_10 r/w 0x228 pin configuration register for pin p4_10 0x00 - - 0x22c - 0x27c reserved - pins p5_n sfsp5_0 r/w 0x280 pin configuration register for pin p5_0 0x00 sfsp5_1 r/w 0x284 pin configuration register for pin p5_1 0x00 sfsp5_2 r/w 0x288 pin configuration register for pin p5_2 0x00 sfsp5_3 r/w 0x28c pin configuration register for pin p5_3 0x00 sfsp5_4 r/w 0x290 pin configuration register for pin p5_4 0x00 table 965. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1043 of 1164 nxp semiconductors UM10430 chapter 42: appendix sfsp5_5 r/w 0x294 pin configuration register for pin p5_5 0x00 sfsp5_6 r/w 0x298 pin configuration register for pin p5_6 0x00 sfsp5_7 r/w 0x29c pin configuration register for pin p5_7 0x00 - - 0x2a0 - 0x2fc reserved - pins p6_n sfsp6_0 r/w 0x300 pin configuration register for pin p6_0 0x00 sfsp6_1 r/w 0x304 pin configuration register for pin p6_1 0x00 sfsp6_2 r/w 0x308 pin configuration register for pin p6_2 0x00 sfsp6_3 r/w 0x30c pin configuration register for pin p6_3 0x00 sfsp6_4 r/w 0x310 pin configuration register for pin p6_4 0x00 sfsp6_5 r/w 0x314 pin configuration register for pin p6_5 0x00 sfsp6_6 r/w 0x318 pin configuration register for pin p6_6 0x00 sfsp6_7 r/w 0x31c pin configuration register for pin p6_7 0x00 sfsp6_8 r/w 0x320 pin configuration register for pin p6_8 0x00 sfsp6_9 r/w 0x324 pin configuration register for pin p6_9 0x00 sfsp6_10 r/w 0x328 pin configuration register for pin p6_10 0x00 sfsp6_11 r/w 0x32c pin configuration register for pin p6_11 0x00 sfsp6_12 r/w 0x330 pin configuration register for pin p6_12 0x00 - - 0x334 - 0x37c reserved - pins p7_n sfsp7_0 r/w 0x380 pin configuration register for pin p7_0 0x00 sfsp7_1 r/w 0x384 pin configuration register for pin p7_1 0x00 sfsp7_2 r/w 0x388 pin configuration register for pin p7_2 0x00 sfsp7_3 r/w 0x38c pin configuration register for pin p7_3 0x00 sfsp7_4 r/w 0x390 pin configuration register for pin p7_4 0x00 sfsp7_5 r/w 0x394 pin configuration register for pin p7_5 0x00 sfsp7_6 r/w 0x398 pin configuration register for pin p7_6 0x00 sfsp7_7 r/w 0x39c pin configuration register for pin p7_7 0x00 - - 0x3a0 - 0x3fc reserved - pins p8_n sfsp8_0 r/w 0x400 pin configuration register for pin p8_0 0x00 sfsp8_1 r/w 0x404 pin configuration register for pin p8_1 0x00 sfsp8_2 r/w 0x408 pin configuration register for pin p8_2 0x00 sfsp8_3 r/w 0x40c pin configuration register for pin p8_3 0x00 sfsp8_4 r/w 0x410 pin configuration register for pin p8_4 0x00 sfsp8_5 r/w 0x414 pin configuration register for pin p8_5 0x00 sfsp8_6 r/w 0x418 pin configuration register for pin p8_6 0x00 table 965. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1044 of 1164 nxp semiconductors UM10430 chapter 42: appendix sfsp8_7 r/w 0x41c pin configuration register for pin p8_7 0x00 sfsp8_8 r/w 0x420 pin configuration register for pin p8_8 0x00 - - 0x424 - 0x47c reserved - pins p9_n sfsp9_0 r/w 0x480 pin configuration register for pin p9_0 0x00 sfsp9_1 r/w 0x484 pin configuration register for pin p9_1 0x00 sfsp9_2 r/w 0x488 pin configuration register for pin p9_2 0x00 sfsp9_3 r/w 0x49c pin configuration register for pin p9_3 0x00 sfsp9_4 r/w 0x490 pin configuration register for pin p9_4 0x00 sfsp9_5 r/w 0x494 pin configuration register for pin p9_5 0x00 sfsp9_6 r/w 0x498 pin configuration register for pin p9_6 0x00 - - 0x49c - 0x4fc reserved - pins pa_n - r/w 0x500 reserved - sfspa_1 r/w 0x504 pin configuration register for pin pa_1 0x00 sfspa_2 r/w 0x508 pin configuration register for pin pa_2 0x00 sfspa_3 r/w 0x50c pin configuration register for pin pa_3 0x00 sfspa_4 r/w 0x510 pin configuration register for pin pa_4 0x00 - - 0x514 - 0x57c reserved - pins pb_n sfspb_0 r/w 0x580 pin configuration register for pin pb_0 0x00 sfspb_1 r/w 0x584 pin configuration register for pin pb_1 0x00 sfspb_2 r/w 0x588 pin configuration register for pin pb_2 0x00 sfspb_3 r/w 0x58c pin configuration register for pin pb_3 0x00 sfspb_4 r/w 0x590 pin configuration register for pin pb_4 0x00 sfspb_5 r/w 0x594 pin configuration register for pin pb_5 0x00 sfspb_6 r/w 0x598 pin configuration register for pin pb_6 0x00 - - 0x59c - 0x5fc reserved - pins pc_n sfspc_0 r/w 0x600 pin configuration register for pin pc_0 0x00 sfspc_1 r/w 0x604 pin configuration register for pin pc_1 0x00 sfspc_2 r/w 0x608 pin configuration register for pin pc_2 0x00 sfspc_3 r/w 0x60c pin configuration register for pin pc_3 0x00 sfspc_4 r/w 0x610 pin configuration register for pin pc_4 0x00 sfspc_5 r/w 0x614 pin configuration register for pin pc_5 0x00 sfspc_6 r/w 0x618 pin configuration register for pin pc_6 0x00 table 965. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1045 of 1164 nxp semiconductors UM10430 chapter 42: appendix sfspc_7 r/w 0x61c pin configuration register for pin pc_7 0x00 sfspc_8 r/w 0x620 pin configuration register for pin pc_8 0x00 sfspc_9 r/w 0x624 pin configuration register for pin pc_9 0x00 sfspc_10 r/w 0x628 pin configuration register for pin pc_10 0x00 sfspc_11 r/w 0x62c pin configuration register for pin pc_11 0x00 sfspc_12 r/w 0x630 pin configuration register for pin pc_12 0x00 sfspc_13 r/w 0x634 pin configuration register for pin pc_13 0x00 sfspc_14 r/w 0x638 pin configuration register for pin pc_14 0x00 - - 0x63c - 0x67c reserved - pins pd_n sfspd_0 r/w 0x680 pin configuration register for pin pd_0 0x00 sfspd_1 r/w 0x684 pin configuration register for pin pd_1 0x00 sfspd_2 r/w 0x688 pin configuration register for pin pd_2 0x00 sfspd_3 r/w 0x68c pin configuration register for pin pd_3 0x00 sfspd_4 r/w 0x690 pin configuration register for pin pd_4 0x00 sfspd_5 r/w 0x694 pin configuration register for pin pd_5 0x00 sfspd_6 r/w 0x698 pin configuration register for pin pd_6 0x00 sfspd_7 r/w 0x69c pin configuration register for pin pd_7 0x00 sfspd_8 r/w 0x6a0 pin configuration register for pin pd_8 0x00 sfspd_9 r/w 0x6a4 pin configuration register for pin pd_9 0x00 sfspd_10 r/w 0x6a8 pin configuration register for pin pd_10 0x00 sfspd_11 r/w 0x6ac pin configuration register for pin pd_11 0x00 sfspd_12 r/w 0x6b0 pin configuration register for pin pd_12 0x00 sfspd_13 r/w 0x6b4 pin configuration register for pin pd_13 0x00 sfspd_14 r/w 0x6b8 pin configuration register for pin pd_14 0x00 sfspd_15 r/w 0x6bc pin configuration register for pin pd_15 0x00 sfspd_16 r/w 0x6c0 pin configuration register for pin pd_16 0x00 - - 0x6c4 - 0x6fc reserved - pins pe_n sfspe_0 r/w 0x700 pin configuration register for pin pe_0 0x00 sfspe_1 r/w 0x704 pin configuration register for pin pe_1 0x00 sfspe_2 r/w 0x708 pin configuration register for pin pe_2 0x00 sfspe_3 r/w 0x70c pin configuration register for pin pe_3 0x00 sfspe_4 r/w 0x710 pin configuration register for pin pe_4 0x00 sfspe_5 r/w 0x714 pin configuration register for pin pe_5 0x00 sfspe_6 r/w 0x718 pin configuration register for pin pe_6 0x00 sfspe_7 r/w 0x71c pin configuration register for pin pe_7 0x00 sfspe_8 r/w 0x720 pin configuration register for pin pe_8 0x00 table 965. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1046 of 1164 nxp semiconductors UM10430 chapter 42: appendix sfspe_9 r/w 0x724 pin configuration register for pin pe_9 0x00 sfspe_10 r/w 0x728 pin configuration register for pin pe_10 0x00 sfspe_11 r/w 0x72c pin configuration register for pin pe_11 0x00 sfspe_12 r/w 0x730 pin configuration register for pin pe_12 0x00 sfspe_13 r/w 0x734 pin configuration register for pin pe_13 0x00 sfspe_14 r/w 0x738 pin configuration register for pin pe_14 0x00 sfspe_15 r/w 0x73c pin configuration register for pin pe_15 0x00 - - 0x740 - 0x77c reserved - pins pf_n sfspf_0 r/w 0x780 pin configuration register for pin pf_0 0x00 sfspf_1 r/w 0x784 pin configuration register for pin pf_1 0x00 sfspf_2 r/w 0x788 pin configuration register for pin pf_2 0x00 sfspf_3 r/w 0x78c pin configuration register for pin pf_3 0x00 sfspf_4 r/w 0x790 pin configuration register for pin pf_4 0x00 sfspf_5 r/w 0x794 pin configuration register for pin pf_5 0x00 sfspf_6 r/w 0x798 pin configuration register for pin pf_6 0x00 sfspf_7 r/w 0x79c pin configuration register for pin pf_7 0x00 sfspf_8 r/w 0x7a0 pin configuration register for pin pf_8 0x00 sfspf_9 r/w 0x7a4 pin configuration register for pin pf_9 0x00 sfspf_10 r/w 0x7a8 pin configuration register for pin pf_10 0x00 sfspf_11 r/w 0x7ac pin configuration register for pin pf_11 0x00 - - 0x7b0 - 0xbfc reserved - clkn pins sfsclk0 r/w 0xc00 pin configuration register for pin clk0 0x00 sfsclk1 r/w 0xc04 pin configuration register for pin clk1 0x00 sfsclk2 r/w 0xc08 pin configuration register for pin clk2 0x00 sfsclk3 r/w 0xc0c pin configuration register for pin clk3 0x00 --0xc10 - 0xc7c reserved - usb dp1/dpm pins and i 2 c-bus open-drain pins sfsusb r/w 0xc80 pin configuration register for 0x00 sfsi2c0 r/w 0xc84 pin configuration register for i 2 c0-bus pins 0x00 emc delay registers emcclkdelay r/w 0xd00 emc clock delay register emcctrldelay r/w 0xd04 emc control delay register emccsldelay r/w 0xd08 emc chip select delay register emcdoutdelay r/w 0xd0c emc data out delay register table 965. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1047 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.7.4.1 pin configuration registers for pins p0_n to pf_n and clk0 to clk3 each digital pin and each clock pin on the lpc18xx have an associated pin configuration register which determines the pin?s function and input mode. the allowed functions for each pin are listed in table 963 . 42.7.4.2 pin configuration register for usb1 pins dp1/dm1 remark: the usb_esea bit must be set to 1 if usb1 is used. emcfbclkdelay r/w 0xd10 emc fbclk delay register emcaddrdelay0 r/w 0xd14 emc address line delay register 0 emcaddrdelay1 r/w 0xd18 emc address line delay register 1 emcaddrdelay2 r/w 0xd1c emc address line delay register 2 - - 0xd20 reserved emcdindelay r/w 0xd24 emc data delay register table 965. register overview: system control unit (scu) (base address 0x4008 6000) ?continued name access address offset description reset value table 966. pin configuration for pins p0_n to pf_n and clk0 to clk3 registers (sfspy_x, address 0x4008 6000 to 0x4008 6c0c) bit description bit symbol value description reset value access 1:0 sfsp_func select pin function 00 r/w 0x0 function 0 (default) 0x1 function 1 0x2 function 2 0x3 function 3 3:2 sfsp_mode input mode 00 r/w 0x0 pull-up enabled 0x1 repeater mode 0x2 plain input (pull-up/pull-down disabled) 0x3 pull-down enabled 31:4 - reserved - - table 967. pin configuration for pins dp1/dm1 register (sfsusb, address 0x4008 6c80) bit description bit symbol value description reset value access 0 usb_aim differential data input aip/aim 0 = going low with full speed edge rate 1 = going high with full speed edge rate 0r/w 0 going low with full speed edge rate 1 going high with full speed edge rate www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1048 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.7.4.3 pin configuration register for open-drain i 2 c-bus pins 42.7.4.4 emc clock delay register this register provides a programmable delay for the emc clock outputs. the delay for each clock output is approximately 0.5 ns ? clkn_delay or 0.5 ns ? cken_delay. (clkn_delay/cken_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 1 usb_esea control signal for differential input or single input 0 r/w 0 reserved. do not use. 1 single input aip. enables usb1. 31:2 - reserved - - table 967. pin configuration for pins dp1/dm1 register (sfsusb, address 0x4008 6c80) bit description ?continued bit symbol value description reset value access table 968. pin configuration for open-drain i 2 c-bus pins register (sfsi2c0, address 0x4008 6c84) bit description bit symbol value description reset value access 0 sda_ehs configures i 2 c0-bus speed for sda0 pin 0 r/w 0 standard/fast mode (400 kbit/s) 1 high-speed mode (3.4 mbit/s) 1 scl_ehs configures i 2 c0-bus speed for scl0 pin 0 r/w 0 standard/fast mode (400 kbit/s) 1 high-speed mode (3.4 mbit/s) 2 scl_ecs direction (only applies if scl_ehs = 1) 0 r/w 0 receive 1 transmit 31:3 - reserved - - table 969. emc clock delay register (emcclkdelay, address 0x4008 6d00) bit description bit symbol description reset value access 2:0 clk0_delay delay of the extbus_clk0 clock output. 0 r/w 3- reserved. - - 6:4 clk1_delay delay of the extbus_clk0 clock output. 0 r/w 7- reserved. - - 10:8 clk2_delay delay of the extbus_clk2 clock output. 0 r/w 11 - reserved. - - 14:12 clk3_delay delay of the extbus_clk3 clock output. 0 r/w 15 - reserved. - - 18:16 cke0_delay delay of the extbus_ckeout0 clock enable output. 0 r/w 19 - reserved. - - 22:20 cke1_delay delay of the extbus_ckeout1 clock enable output. 0 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1049 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.7.4.5 emc control delay register this register provides a programmable delay for the emc control outputs. the delay for each control output is approximately 0.5 ns ? xxx_delay. (xxx_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 42.7.4.6 emc chip select delay register this register provides a programmable delay for the emc chip select outputs. the delay for each control output is approximately 0.5 ns ? xxx_delay. (xxx_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 23 - reserved. - - 26:24 cke2_delay delay of the extbus_ckeout2 clock enable output. 0 r/w 27 - reserved. - - 30:28 cke3_delay delay of the extbus_ckeout3 clock enable output. 0 r/w 31 - reserved. - - table 969. emc clock delay register (emcclkdelay, address 0x4008 6d00) bit description bit symbol description reset value access table 970. emc control delay register (emcctrldelay, address 0x4008 6d04) bit description bit symbol description reset value access 2:0 ras_delay delay of the extbus_ras output. 0 r/w 3- reserved. - - 6:4 cas_delay delay of the extbus_cas output. 0 r/w 7- reserved. - - 10:8 oe_delay delay of the extbus_oe output. 0 r/w 11 - reserved. - - 14:12 we_delay delay of the extbus_we output. 0 r/w 15 - reserved. - - 18:16 bls0_delay delay of the extbus_bls0 output. 0 r/w 19 - reserved. - - 22:20 bls1_delay delay of the extbus_bls1 output. 0 r/w 23 - reserved. - - 26:24 bls2_delay delay of the extbus_bls2 clock enable output. 0 r/w 27 - reserved. - - 30:28 bls3_delay delay of the extbus_bls3 clock enable output. 0 r/w 31 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1050 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.7.4.7 emc data out delay register this register provides a programmable delay for the emc dqm and emc data outputs (8 data lanes per delay control). the delay for each control output is approximately 0.5 ns ? xxx_delay. (xxx_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) table 971. emc chip select delay register (emccsdelay, address 0x4008 6d08) bit description bit symbol description reset value access 2:0 dycs0_delay delay of the extbus_dycs0 output. 0 r/w 3 - reserved. - - 6:4 dycs1_delay delay of the extbus_dycs1 output. 0 r/w 7 - reserved. - - 10:8 dycs2_delay delay of the extbus_dycs2 output. 0 r/w 11 - reserved. - - 14:12 dycs3_delay delay of the extbus_dycs3 output. 0 r/w 15 - reserved. - - 18:16 cs0_delay delay of the extbus_cs0 output. 0 r/w 19 - reserved. - - 22:20 cs1_delay delay of the extbus_cs1 output. 0 r/w 23 - reserved. - - 26:24 cs2_delay delay of the extbus_cs2 clock enable output. 0 r/w 27 - reserved. - - 30:28 cs3_delay delay of the extbus_cs3 clock enable output. 0 r/w 31 - reserved. - - table 972. emc data out delay register (emcdoutdelay, address 0x4008 6d0c) bit description bit symbol description reset value access 2:0 dqm0_delay delay of the extbus_dqm0 output. 0 r/w 3- reserved. - - 6:4 dqm1_delay delay of the extbus_dqm1 output. 0 r/w 7- reserved. - - 10:8 dqm2_delay delay of the extbus_dqm2 output. 0 r/w 11 - reserved. - - 14:12 dqm3_delay delay of the extbus_dqm3 output. 0 r/w 15 - reserved. - - 18:16 d0_delay delay of the extbus_d0 to extbus_d7 outputs. 0 r/w 19 - reserved. - - 22:20 d1_delay delay of the extbus_d8 to extbus_d15 outputs. 0 r/w 23 - reserved. - - 26:24 d2_delay delay of the extbus_d16 to extbus_d23 outputs. 0 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1051 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.7.4.8 emc feedback clock delay register this register provides a programmable delay for the emc feedback clocks (8 data lanes per feedback clock). the delay for each control output is approximately 0.5 ns ? xxx_delay. (xxx_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 42.7.4.9 emc address delay register 0 this register provides a programmable delay for the emc address outputs. the delay for each control output is approximately 0.5 ns ? addrn_delay. (addrn_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 27 - reserved. - - 30:28 d3_delay delay of the extbus_d24 to extbus_d31 outputs. 0 r/w 31 - reserved. - - table 972. emc data out delay register (emcdoutdelay, address 0x4008 6d0c) bit description ?continued bit symbol description reset value access table 973. emc dqm delay register (emcfbclkdelay, address 0x4008 6d10) bit description bit symbol description reset value access 2:0 fbclk0_delay delay of the emc feedback clock 0 (for byte lane 0). 0 r/w 3- reserved. -- 6:4 fbclk1_delay delay of the emc feedback clock 1 (for byte lane 1). 0 r/w 7- reserved. -- 10:8 fbclk2_delay delay of the emc feedback clock 2 (for byte lane 2). 0 r/w 11 - reserved. - - 14:12 fbclk3_delay delay of the emc feedback clock 3 (for byte lane 3). 0 r/w 15 - reserved. - - 18:16 cclk_delay delay of the emc cclkdelay clock. 0 r/w 31: 19 - reserved. - - table 974. emc address delay register 0 (emcaddrdelay0, address 0x4008 6d14) bit description bit symbol description reset value access 2:0 addr0_delay delay of the extbus_a0 output. 0 r/w 3- reserved. - - 6:4 addr1_delay delay of the extbus_a1 output. 0 r/w 7- reserved. - - 10:8 addr2_delay delay of the extbus_a2 output. 0 r/w 11 - reserved. - - 14:12 addr3_delay delay of the extbus_a3 output. 0 r/w 15 - reserved. - - 18:16 addr4_delay delay of the extbus_a4 output. 0 r/w www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1052 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.7.4.10 emc address delay register 1 this register provides a programmable delay for the emc address outputs. the delay for each control output is approximately 0.5 ns ? addrn_delay. (addrn_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 42.7.4.11 emc address delay register 2 this register provides a programmable delay for the emc address outputs. the delay for each control output is approximately 0.5 ns ? addrn_delay. (addrn_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) 19 - reserved. - - 22:20 addr5_delay delay of the extbus_a5 output. 0 r/w 23 - reserved. - - 26:24 addr6_delay delay of the extbus_a6 output. 0 r/w 27 - reserved. - - 30:28 addr7_delay delay of the extbus_a7 output. 0 r/w 31 - reserved. - - table 974. emc address delay register 0 (emcaddrdelay0, address 0x4008 6d14) bit description ?continued bit symbol description reset value access table 975. emc address delay register 1 (emcaddrdelay1, address 0x4008 6d18) bit description bit symbol description reset value access 2:0 addr8_delay delay of the extbus_a8 output. 0 r/w 3- reserved. - - 6:4 addr9_delay delay of the extbus_a9 output. 0 r/w 7- reserved. - - 10:8 addr10_delay delay of the extbus_a10 output. 0 r/w 11 - reserved. - - 14:12 addr11_delay delay of the extbus_a11 output. 0 r/w 15 - reserved. - - 18:16 addr12_delay delay of the extbus_a12 output. 0 r/w 19 - reserved. - - 22:20 addr13_delay delay of the extbus_a13 output. 0 r/w 23 - reserved. - - 26:24 addr14_delay delay of the extbus_a14 output. 0 r/w 27 - reserved. - - 30:28 addr15_delay delay of the extbus_a15 output. 0 r/w 31 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1053 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.7.4.12 emc data in delay register this register provides a programmable delay for the emc data inputs (8 data lanes per delay control). the delay for each control output is approximately 0.5 ns ? addrn_delay. (addrn_delay = 0x0: delay ? 0 ns, 0x1: delay ? 0.5 ns, ..., 0x7: delay ? 3.5 ns.) table 976. emc address delay register 2 (emcaddrdelay2, address 0x4008 6d1c) bit description bit symbol description reset value access 2:0 addr16_delay delay of the extbus_a16 output. 0 r/w 3- reserved. - - 6:4 addr17_delay delay of the extbus_a17 output. 0 r/w 7- reserved. - - 10:8 addr18_delay delay of the extbus_a18 output. 0 r/w 11 - reserved. - - 14:12 addr19_delay delay of the extbus_a19 output. 0 r/w 15 - reserved. - - 18:16 addr20_delay delay of the extbus_a20 output. 0 r/w 19 - reserved. - - 22:20 addr21_delay delay of the extbus_a21 output. 0 r/w 23 - reserved. - - 26:24 addr22_delay delay of the extbus_a22 output. 0 r/w 27 - reserved. - - 30:28 addr23_delay delay of the extbus_a23 output. 0 r/w 31 - reserved. - - table 977. emc data in delay register 3 (emcdindelay, address 0x4008 6d24) bit description bit symbol description reset value access 2:0 din0_delay delay of the extbus_ d0 to extbus_d7 inputs. 0 r/w 3- reserved. - - 6:4 din1_delay delay of the extbus_ d8 to extbus_d15 inputs. 0 r/w 7- reserved. - - 10:8 din2_delay delay of the extbu s_d23 to extbus_d16 inputs. 0 r/w 11 - reserved. - - 14:12 din3_delay delay of the extbu s_d31 to extbus_d24 inputs. 0 r/w 15 - reserved. - - 18:16 den0_delay delay of the data enable lines 0 to 7. 0 r/w 19 - reserved. - - 22:20 den1_delay delay of the data enable lines 8 to 15. 0 r/w 23 - reserved. - - 26:24 den2_delay delay of the data enable lines 16 to 23. 0 r/w 31:27 - reserved. - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1054 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.8 lpc1850/30/20/10 rev ?-? gpio 42.8.1 basic configuration the gpio is configured as follows: ? see ta b l e 9 7 8 for clocking and power control. ? the gpio is reset by a gpio_rst (reset #28). ? all gpio pins are set to input by default. 42.8.2 features ? accelerated gpio functions: ? gpio registers are located on the ahb so that the fastest possible i/o timing can be achieved. ? mask registers allow treating sets of port bits as a group, leaving other bits unchanged. ? all gpio registers are byte and half-word addressable. ? entire port value can be written in one instruction. ? bit-level set and clear registers allow a single instruction set or clear of any number of bits in one port. ? direction control of individual bits. 42.8.3 pin description remark: the gpio pins are typically shared with functions of other peripherals. 42.8.4 register description the lpc18xx has up to four 32-bit general purpose i/o ports. for each gpio port, the first 16 pins are available with the except ion of port 4 which does not use gpio4_11. the registers are located on the ahb for the fastest possible read and write timing. they can also be accessed as byte or half-word long data. a mask register allows access to a group of bits in a single gpio port ind ependently from other bits in the same port. table 978. gpio clocking and power control base clock branch clock maximum frequency gpio base_m3_clk clk_m3_gpio 150 mhz table 979. gpio pin description pin name type description gpio0_[15:0] i/o gpio port 0, i/os 15 to 0. gpio1_[15:0] i/o gpio port 1, i/os 15 to 0. gpio2_[15:0] i/o gpio port 2, i/os 15 to 0. gpio3_[15:0] i/o gpio port 3, i/os 15 to 0. gpio4_[15:0] i/o gpio port 4, i/os 15 to 0. gpio4_11 is not used out. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1055 of 1164 nxp semiconductors UM10430 chapter 42: appendix table 980. register overview: gpio (register base address: 0x400f 0000) name access address offset description reset value [1] dir0 r/w 0x000 gpio port 0 direction control register. 0x0 - - 0x004 to 0x00c reserved. - mask0 r/w 0x010 gpio port 0 mask register for port access. 0x0 pin0 r/w 0x014 gpio port 0 pin value register using mask0. 0x0 set0 r/w 0x018 gpio port 0 outpu t set register using mask0. this register controls the state of output pins. only bits enabled by 0 in mask0 can be altered. 0x0 clr0 w 0x01c gpio port 0 output clear register using mask0. this register controls the state of output pins. only bits enabled by 0 in mask0 can be altered. 0x0 dir1 r/w 0x020 gpio port 1 direction control register. 0x0 - - 0x024 to 0x02c reserved. - mask1 r/w 0x030 gpio port 1 mask register for port access. 0x0 pin1 r/w 0x034 gpio port 1 pin value register using mask1. 0x0 set1 r/w 0x038 gpio port 1 outpu t set register using mask1. this register controls the state of output pins. only bits enabled by 0 in mask1 can be altered. 0x0 clr1 w 0x03c gpio port 1 output clear register using mask1. this register controls the state of output pins. only bits enabled by 0 in mask1 can be altered. 0x0 dir2 r/w 0x040 gpio port 2 direction control register. 0x0 - - 0x044 to 0x04c reserved. - mask2 r/w 0x050 gpio port 2 mask register for port access. 0x0 pin2 r/w 0x054 gpio port 2 pin value register using mask2. 0x0 set2 r/w 0x058 gpio port 2 outpu t set register using mask2. this register controls the state of output pins. only bits enabled by 0 in mask2 can be altered. 0x0 clr2 w 0x05c gpio port 2 output clear register using mask2. this register controls the state of output pins. only bits enabled by 0 in mask2 can be altered. 0x0 dir3 r/w 0x060 gpio port 3 direction control register. 0x0 - - 0x064 to 0x06c reserved. - mask3 r/w 0x070 gpio port 3 mask register for port access. 0x0 pin3 r/w 0x074 gpio port 3 pin value register using mask3. 0x0 set3 r/w 0x078 gpio port 3 outpu t set register using mask3. this register controls the state of output pins. only bits enabled by 0 in mask3 can be altered. 0x0 clr3 w 0x07c gpio port 3 output clear register using fio3mask. this register controls the state of output pins. only bits enabled by 0 in mask3 can be altered. 0x0 dir4 r/w 0x080 gpio port 4 direction control register. 0x0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1056 of 1164 nxp semiconductors UM10430 chapter 42: appendix [1] reset value reflects the data stored in used bi ts only. it does not include reserved bits content. 42.8.4.1 gpio port direction register (dir) this word accessible register is used to c ontrol the direction of the pins when they are configured as gpio port pins. the direction bit for any pin must be set according to the pin functionality. reading returns the status of the dir register. aside from the 32-bit long and word only ac cessible dir register, every gpio port can also be controlled via two byte and one half-word accessible register listed in table 982 . next to providing the same functions as the dir register, these additional registers allow easier and faster access to the physical port pins. - - 0x084 to 0x08c reserved. - mask4 r/w 0x090 gpio port 4 mask register for port access. 0x0 pin4 r/w 0x094 gpio port 4 pin value register using mask. 0x0 set4 r/w 0x098 gpio port 4 outpu t set register using mask4. this register controls the state of output pins. only bits enabled by 0 in mask4 can be altered. 0x0 clr4 w 0x09c gpio port 4 output clear register using mask4. this register controls the state of output pins. only bits enabled by 0 in mask4 can be altered. 0x0 table 980. register overview: gpio (register base address: 0x400f 0000) ?continued name access address offset description reset value [1] table 981. gpio port direction register (dir0 to dir4 - addresses 0x400f 0000 to 0x400f 0080) bit description bit symbol description reset value 15:0 dirpin gpio direction port x (x = 0 to 4) control bits. bit 0 controls pin gpiox_0, bit 15 controls pin gpiox_15. 0 = controlled pin is input. 1 = controlled pin is output. 0x0 31:16 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1057 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.8.4.2 gpio port mask register (mask) this register is used to select port pins that will and will no t be affected by write accesses to the set, clr, and pin register. the mask re gister also filters out the port?s content when the pin register is read and masks th e contents of the set register for read operations. a zero in this register?s bit enables an access to the corresponding physical pin via a read or write access. if a bit in this register is one, the corr esponding pin w ill not be changed with write access and if r ead, will not be reflected in the updated pin register. reading returns the status of the mask register. aside from the 32-bit long a nd word only accessible maskn register, every gpio port can also be controlled via two byte and one half-word accessible register listed in table 984 . next to providing the same functions as th e maskn register, these additional registers allow easier and faster access to the physical port pins. table 982. gpio port direction control byte and halfword accessible register view generic register name description register length in bits /access reset value port x register name - address dirn_0 gpio port x (x = 0 to 4) direction control register 0. bit 0 corresponds to pin gpiox_0... bit 7 to pin gpiox_7. 8 (byte)/ r/w 0x00 dir0_0 - 0x400f 0000 dir1_0 - 0x400f 0020 dir2_0 - 0x400f 0040 dir3_0 - 0x400f 0060 dir4_0 - 0x00ff 0080 dirn_1 gpio port x direction control register 1. bit 0 corresponds to pin gpiox_8... bit 7 to pin gpiox_15. 8 (byte)/ r/w 0x00 dir0_1 - 0x400f 0001 dir1_1 - 0x400f 0021 dir2_1 - 0x400f 0041 dir3_1 - 0x400f 0061 dir4_1 - 0x400f 0081 dirn_l gpio port x direction control lower half-word register. bit 0 corresponds to pin gpiox_0... bit 15 to pin gpiox_15. 16 (half-word)/ r/w 0x0000 dir0_l - 0x400f 0000 dir1_l - 0x400f 0020 dir2_l - 0x400f 0040 dir3_l - 0x400f 0060 dir4_l - 0x400f 0080 table 983. gpio port mask register (mask0 to mask4 - addresses 0x400f 0010 to 0x400f 0090) bit description bit symbol description reset value 15:0 maskpin gpio physical pin access cont rol. bit 0 controls pin gpiox_0, bit 15 controls pin gpiox_15. 0 = controlled pin is affected by writes to the port?s setn, clrn, and pinn register(s). current state of the pin can be read from the pinn register. 1 = controlled pin is not affected by writes into the port?s setn, clrn and pinn register(s). when the pin register is read, this bit will not be updated with the state of the physical pin. 0x0 31:16 - reserved. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1058 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.8.4.3 gpio port pin value register (pin) writing to the pin register stores the value in the port output register, bypassing the need to use both the set and clr registers to obtain the entire written value. this feature should be used carefully in an application since it affects the entire port. this register provides the value of port pi ns that are configured to perform digital functions. a read of this register yields the logic value of the pin regardless of whether the pin is configured for input or output, as gpio, or as an alternate digital function. for example, a particular port pin may have gpio input, gpio output, uart receive, and pwm output as selectable functi ons. any configuration of th at pin will allow its current logic state to be read from the corresponding pin register. access to a port pin via the pin register is masked by the corresponding bit of the mask register (see section 42.8.4.2 ). only pins masked with zeros in the mask register (see section 42.8.4.2 ) will be correlated to the current content of the gpio port pin value register. remark: if the pinn register is read, its bit(s) masked with 1 in the mask register will be set to 0 regardless of the physical pin state. table 984. gpio port mask byte and half-word accessible register description generic register name description register length in bits /access reset value port x register name - address maskn_0 gpio port x (x = 0 to 4) mask register 0. bit 0 in corresponds to pin gpiox_0... bit 7 to pin gpiox_7. 8 (byte)/ r/w 0x0 mask0_0 - 0x400f 0010 mask1_0 - 0x400f 0030 mask2_0 - 0x400f 0050 mask3_0 - 0x400f 0070 mask4_0 - 0x400f 0090 maskn_1 gpio port x mask register 1. bit 0 corresponds to pin gpiox_8... bit 7 to pin gpiox_15. 8 (byte)/ r/w 0x0 mask0_1 - 0x400f 0011 mask1_1 - 0x400f 0031 mask2_1 - 0x400f 0051 mask3_1 - 0400f 0071 mask4_1 - 0x400f 0091 maskn_l gpio port x mask lower half-word register. bit 0 corresponds to pin gpiox_0... bit 15 to pin gpiox_15. 16 (half-word)/ r/w 0x0 mask0_l - 0x400f 0010 mask1_l - 0x400f 0030 mask2_l - 0x400f 0050 mask3_l - 0x400f 0070 mask4_l - 0x400f 0090 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1059 of 1164 nxp semiconductors UM10430 chapter 42: appendix aside from the 32-bit long and word only ac cessible pin register, every gpio port can also be controlled via two byte and one half-word accessible register listed in table 986 . next to providing the same functions as the pin register, these additional registers allow easier and faster access to the physical port pins. 42.8.4.4 gpio port output set register (set) set is used to produce a high level output at the port pins configured as gpio in output mode. writing 1 produces a high level at th e corresponding port pins. writing 0 has no effect. if any pin is configured as an input or a secondary function, writing 1 to the corresponding bit in the set has no effect. reading set returns the value of this register as determined by previous writes to set and clr (or pin as noted above). this value does not reflect the effect of any outside world influence on the i/o pins. access to a port pin via the set register is masked by the corresponding bit of the mask register (see section 42.8.4.2 ). table 985. gpio port pin value register (pin0 to pin0 - addresses 0x400f 0014 to 0x400f 0094) bit description bit symbol description reset value 15:0 valpin gpio output value bits. bit 0 corresponds to pin gpiox_0, bit 15 corresponds to pin gpiox_15. only bits also set to 0 in the maskn register are affected by a write or show the pin?s actual logic state. 0 = reading a 0 indicates that the port pin?s current state is low. writing 0 sets the output register value to low. 1 = reading a 1 indicates that the port pin?s current state is high. writing a 1 sets the output register value to high. 0x0 31:16 - reserved. - table 986. gpio port pin value byte and half-word accessible register description generic register name description register length in bits /access reset value port x register name - address pinn_0 gpio port x pin value register 0. bit 0 corresponds to pin gpiox_0... bit 7 to pin gpiox_7. 8 (byte)/ r/w 0x00 pin0_0 - 0x400f 0014 pin1_0 - 0x400f 0034 pin2_0 - 0x400f 0054 pin3_0 - 0x400f 0074 pin4_0 - 0x400f 0094 pinn_1 gpio port x pin value register 1. bit 0 corresponds to pin gpiox_8... bit 7 to pin gpiox_15. 8 (byte)/ r/w 0x00 pin0_1 - 0x400f 0015 pin1_1 - 0x400f 0035 pin2_1 - 0x400f 0055 pin3_1 - 0x400f 0075 pin4_1 - 0x400f 0095 pinn_l gpio port x pin value lower half-word register. bit 0 register corresponds to pin gpiox_0... bit 15 to pin gpiox_15. 16 (half-word)/ r/w 0x0000 pin0_l - 0x400f 0014 pin1_l - 0x400f 0034 pin2_l - 0x400f 0054 pin3_l - 0x400f 0074 pin4_l - 0x400f 0094 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1060 of 1164 nxp semiconductors UM10430 chapter 42: appendix aside from the 32-bit long and word only ac cessible fioset register, every gpio port can also be controlled via two byte and on e half-word accessible register listed in table 988 . next to providing the same functions as the fioset register, these additional registers allow easier and faster access to the physical port pins. 42.8.4.5 gpio port output clear register (clr) fioclr is used to produce a low level output at port pins configured as gpio in output mode. writing 1 produces a low level at the corresponding port pin and clears the corresponding bit in the set register. writing 0 ha s no effect. if any pin is configured as an input or a secondary function, writing to clr has no effect. the clr is a write-only register. access to a port pin via the fioclr register is masked by the corresponding bit of the mask register (see section 42.8.4.2 ). table 987. gpio port output set register (set0 to set4 - addresses 0x400f 0018 to 0x400f 0098) bit description bit symbol description reset value 15:0 setpin gpio output value set bits. bit 0 controls pin gpiox_0, bit 15 controls pin gpiox_15. 0 = controlled pin output is unchanged. 1 = controlled pin output is set to high. 0x0 31:16 - reserved. - table 988. gpio port output set byte and half-word accessible register description generic register name description register length in bits /access reset value port x register name - address setn_0 gpio port x output set register 0. bit 0 corresponds to pingpiox_0... bit 7 to pin gpiox_7. 8 (byte)/ r/w 0x00 set0_0 - 0x400f 0018 set1_0 - 0x400f 0038 set2_0 - 0x400f 0058 set3_0 - 0x400f 0078 set4_0 - 0x400f 0098 setn_1 gpio port x output set register 1. bit 0 corresponds to pin px.8... bit 7 to pin px.15. 8 (byte)/ r/w 0x00 set0_1 - 0x400f 0019 set1_1 - 0x400f 0039 set2_1 - 0x400f 0059 set3_1 - 0x400f 0079 set4_1 - 0x400f 0099 setn_l gpio port x output set lower half-word register. bit 0 in corresponds to pin gpiox_0... bit 15 to pin gpiox_15. 16 (half-word)/ r/w 0x0000 set0_l - 0x400f 0018 set1_l - 0x400f 0038 set2_l - 0x400f 0058 set3_l - 0x400f 0078 set4_l - 0x400f 0098 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1061 of 1164 nxp semiconductors UM10430 chapter 42: appendix aside from the 32-bit long and word only ac cessible clr register, every gpio port can also be controlled via two byte and one half-word accessible register listed in table 990 . next to providing the same functions as the clr register, these additional registers allow easier and faster access to the physical port pins. 42.9 lpc1850/30/20/10 rev ?-? i2s 42.9.1 how to read this chapter remark: this chapter applies to parts lpc1850/30/20/10 rev ?-?. the i 2 s interface is availabl e on all lpc18xx parts. 42.9.2 basic configuration the i 2 s interface is conf igured as follows: ? see ta b l e 9 0 1 for clocking and power control. ? the i2s is reset by the i2s_rst (reset # 52). ? the i2s interrupt is connected to slot # 28 in the nvic. table 989. gpio port output clear register (clr0 to clr4 - 0x400f 001c to 0x400f 009c) bit description bit symbol description reset value 15:0 clrpin gpio output value clear bits. bit 0 controls pin gpiox_0, bit 15 controls pin gpiox_15. 0 = controlled pin output is unchanged. 1 = controlled pin output is set to low. 0x0 31:16 - reserved. - table 990. gpio port output clear byte and half-word accessible register description generic register name description register length in bits/ access reset value port x register name - address clrn_0 gpio port x output clear register 0. bit 0 corresponds to pin gpiox_0... bit 7 to pin gpiox_7. 8 (byte)/ w 0x00 clr0_0 - 0x400f 001c clr1_0 - 0x400f 003c clr2_0 - 0x400f 005c clr3_0 - 0x400f 007c clr4_0 - 0x400f 009c clrn_1 gpio port x output clear register 1. bit 0 corresponds to pin gpiox_8... bit 7 to pin gpiox_15. 8 (byte)/ w 0x00 clr0_1 - 0x400f 001d clr1_1 - 0x400f 003d clr2_1 - 0x400f 005d clr3_1 - 0x400f 007d clr4_1 - 0x400f 009d clrn_l gpio port x output clear lower half-word register. bit 0 corresponds to pin gpiox_0... bit 15 to pin gpiox_15. 16 (half-word)/ w 0x0000 clr0_l - 0x400f 001c clr1_l - 0x400f 003c clr2_l - 0x400f 005c clr3_l - 0x400f 007c clr4_l - 0x400f 009c www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1062 of 1164 nxp semiconductors UM10430 chapter 42: appendix ? for connecting the i2s receive and transmi t lines to the gpdma, use the dmamux register in the creg block (see ta b l e 3 5 ) and enable the gpdma channel in the dma channel configuration registers ( section 16.6.20 ). ? see ta b l e 3 7 for interconnections between the i2s transmit/receive lines and the timer and sct inputs. 42.9.3 features the i2s bus provides a standard communication interface for digital audio applications. the i2s bus specification defines a 3-wire serial bus, having one data, one clock, and one word select signal. the basic i2s connection has one master, which is always the master, and one slave. the i2s interface provides a separate transmit and receive channel, each of which can operate as ei ther a master or a slave. ? the i2s input can operate in both master and slave mode. the i2s output can operate in both master and slave mode, independent of the i2s input. ? capable of handling 8-bit, 16-bit, and 32-bit word sizes. ? mono and stereo audio data supported. ? versatile clocking includes independent transmit and receive fractional rate generators, a nd an ability to use a single clock in put or output fo r a 4-wire mode. ? the sampling frequency (fs) can range (in pr actice) from 16 to 192 khz. (16, 22.05, 32, 44.1, 48, 96, or 192 khz) for audio applications. ? separate master clock outputs for both transmit and receive channels support a clock up to 512 times the i 2 s sampling frequency. ? word select period in master mode is configurable (separately for i 2 s input and i 2 s output). ? two 8 word (32 byte) fifo data buffers are provided, one for transmit and one for receive. ? generates interrupt requests when buffer levels cross a programmable boundary. ? two dma requests, controlled by programma ble buffer levels. these are connected to the general purpose dma block. ? controls include reset, stop and mute options separately for i2s input and i2s output. 42.9.4 general description the i2s performs serial data out via the transmit channel and serial data in via the receive channel. these support the nxp inter ic audio format for 8-bit, 16-bit and 32-bit audio data, both for stereo and mono modes. configuration, data access and control is performed by a apb register set. data stream s are buffered by fifos with a depth of 8 words. table 991. i2s clocking and power control base clock branch clock maximum frequency clock to the i2s register interface and i2s peripheral clock. base_apb1_clk clk_apb1_i2s 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1063 of 1164 nxp semiconductors UM10430 chapter 42: appendix the i2s receive and transmit stage can operat e independently in either slave or master mode. within the i2s module the difference between these modes lies in the word select (ws) signal which determines the timing of data transmissions. data words start on the next falling edge of the transmitting clock after a ws change. in stereo mode when ws is low left data is transmitted and right data when ws is high. in mono mode the same data is transmitted twice, once when ws is low and again when ws is high. ? in master mode, word select is generated internally with a 9-bit counter. the half period count value of this counter can be set in the control register. ? in slave mode, word select is input from the relevant bus pin. ? when an i2s bus is active, the word select, receive clock and transmit clock signals are sent continuously by the bus master, while data is sent continuously by the transmitter. ? disabling the i2s can be done with the stop or mute control bits separately for the transmit and receive. ? the stop bit will disable acce sses by the transmit channel or the receive channel to the fifos and will place the tran smit channel in mute mode. ? the mute control bit will place the transmit channel in mute mode. in mute mode, the transmit channel fifo operates normally, but the output is discarded and replaced by zeroes. this bit does not affect the receive channel, data reception can occur normally. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1064 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.9.5 pin description table 992. pin description pin name direction description i2s_rx_sck input/ output receive clock. a clock signal used to synchronize the transfer of data on the receive channel. it is driven by the master and received by the slave. corresponds to the signal sck in the i2s bus specification. i2s_rx_ws input/ output receive word select. selects the channel from which data is to be received. it is driven by the master and received by the slave. corresponds to the signal ws in the i2s bus specification. ws = 0 indicates that data is being received by channel 1 (left channel). ws = 1 indicates that data is being received by channel 2 (right channel). i2s_rx_sda input/ output receive data. serial data, received msb first. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i2s bus specification. i2s_rx_mclk output optional master clock output for the i2s receive function. i2s_tx_sck input/ output transmit clock. a clock signal used to synchronize the transfer of data on the transmit channel. it is driven by the master and received by the slave. corresponds to the signal sck in the i2s bus specification. i2s_tx_ws input/ output transmit word select. selects the channel to which data is being sent. it is driven by the master and received by the slave. corresponds to the signal ws in the i2s bus specification. ws = 0 indicates that data is being sent to channel 1 (left channel). ws = 1 indicates that data is being sent to channel 2 (right channel). i2s_tx_sda input/ output transmit data. serial data, sent msb first. it is driven by the transmitter and read by the receiver. corresponds to the signal sd in the i2s bus specification. is_tx_mclk output optional master clock output for the i2s transmit function. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1065 of 1164 nxp semiconductors UM10430 chapter 42: appendix fig 156. simple i2s configurations and bus timing transmitter (master) controller (master) transmitter (slave) receiver (master) sck: serial clock ws: word select sd: serial data transmitter (slave) receiver (slave) sck ws sd sck ws sd msb lsb msb word n left channel word n+1 right channel word n-1 right channel receiver (slave) sck: serial clock ws: word select sd: serial data www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1066 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.9.6 register description table 993 shows the registers associated with the i2s interface and a summary of their functions. following the table are details for each register. reset value reflects the data stored in used bits only. it does not include reserved bits content. 42.9.6.1 i2s digital audio output register the dao register controls the o peration of the i2s transmit channel. the function of bits in dao are shown in table 994 . table 993. register overview: i2s (base address 0x400a 2000) name access address offset description reset value dao r/w 0x000 i2s digital audio output register. contains control bits for the i2s transmit channel. 0x87e1 dai r/w 0x004 i2s digital audio input register. contains control bits for the i2s receive channel. 0x07e1 txfifo wo 0x008 i2s transmit fifo. access register for the 8 x 32-bit transmitter fifo. 0 rxfifo ro 0x00c i2s receive fifo. access register for the 8 x 32-bit receiver fifo. 0 state ro 0x010 i2s status feedback register. contains status information about the i2s interface. 0x7 dma1 r/w 0x014 i2s dma configuration register 1. contains control information for dma request 1. 0 dma2 r/w 0x018 i2s dma configuration register 2. contains control information for dma request 2. 0 irq r/w 0x01c i2s interrupt request control register. contains bits that control how the i2s interrupt request is generated. 0 txrate r/w 0x020 i2s transmit mclk divider. this register determines the i2s tx mclk rate by specifying the value to divide pclk by in order to produce mclk. 0 rxrate r/w 0x024 i2s receive mclk divider. this register determines the i2s rx mclk rate by specifying the value to divide pclk by in order to produce mclk. 0 txbitrate r/w 0x028 i2s transmit bit rate divider. this register determines the i2s transmit bit rate by specifying the value to divide tx_mclk by in order to produce the transmit bit clock. 0 rxbitrate r/w 0x02c i2s receive bit rate divider. this register determines the i2s receive bit rate by specifying the value to divide rx_mclk by in order to produce the receive bit clock. 0 txmode r/w 0x030 i2s transmit mode control. 0 rxmode r/w 0x034 i2s receive mode control. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1067 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.9.6.2 i2s digital audio input register the dai register controls the operation of the i2s receive channel. the function of bits in dai are shown in ta b l e 9 9 5 . 42.9.6.3 i2s transmit fifo register the txfifo register provides access to the tr ansmit fifo. the function of bits in txfifo are shown in ta b l e 9 9 6 . table 994. i2s digital audio output register (dao - address 0x400a 2000) bit description bit symbol value description reset value 1:0 wordwidth selects the number of bytes in data as follows: 01 0x0 8-bit data 0x1 16-bit data 0x2 reserved, do not use this setting 0x3 32-bit data 2 mono when 1, data is of monaural format. when 0, the data is in stereo format. 0 3 stop when 1, disables accesses on fifos, places the transmit channel in mute mode. 0 4 reset when 1, asynchronously resets the transmit channel and fifo. 0 5 ws_sel when 0, the interface is in master mode. when 1, the interface is in slave mode. see section 42.9.7.2 for a summary of useful combinations for this bit with txmode. 1 14:6 ws_halfperiod word select half period minus 1, i.e. ws 64clk period -> ws_halfperiod = 31. 0x1f 15 mute when 1, the transmit channel sends only zeroes. 1 31:16 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 995. i2s digital audio input register (dai - address 0x400a 2004) bit description bit symbol value description reset value 1:0 wordwidth selects the number of bytes in data as follows: 01 0x0 8-bit data 0x1 16-bit data 0x2 reserved, do not use this setting 0x3 32-bit data 2 mono when 1, data is of monaural format. when 0, the data is in stereo format. 0 3 stop when 1, disables accesses on fifos, places the transmit channel in mute mode. 0 4 reset when 1, asynchronously reset the transmit channel and fifo. 0 5 ws_sel when 0, the interface is in master mode. when 1, the interface is in slave mode. see section 42.9.7.2 for a summary of useful combinations for this bit with rxmode. 1 14:6 ws_halfperiod word select half period minus 1, i.e. ws 64clk period -> ws_halfperiod = 31. 0x1f 31:15 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1068 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.9.6.4 receive fifo register the i2srxfifo register provides access to the receive fifo. the function of bits in i2srxfifo are shown in table 997 . 42.9.6.5 i2s status feedback register the state register provides status informat ion about the i2s interface. the meaning of bits in state are shown in table 998 . 42.9.6.6 i2s dma configuration register 1 the dma1 register controls the operation of dm a request 1. the function of bits in dma1 are shown in ta b l e 9 9 9 . refer to chapter 16 ? lpc18xx general purpose dma (gpdma) controller ? for details of dma operation. this register enables the dma for the i 2 s receive and transmit channels and sets the fifo level. remark: the fifos contain eight 16-bit words. therefore, if the i 2 s controller is configured for 32-bit mode (see table 994 and table 995 ), the maximum allowed fifo level is 4. table 996. transmit fifo register (txfifo - address 0x400a 2008) bit description bit symbol description reset value 31:0 i2stxfifo 8 x 32-bit transmit fifo. 0 table 997. i2s receive fifo register (rxfifo - address 0x400a 200c) bit description bit symbol description reset value 31:0 i2srxfifo 8 x 32-bit transmit fifo. 0 table 998. i2s status feedback register (state - address 0x400a 2010) bit description bit symbol description reset value 0 irq this bit reflects the presence of receive interrupt or transmit interrupt. this is determined by comparing the current fifo levels to the rx_depth_irq and tx_depth_irq fields in the irq register. 1 1 dmareq1 this bit reflects the presence of receive or transmit dma request 1. this is determined by comparing the current fifo levels to the rx_depth_dma1 and tx_depth_dma1 fields in the dma1 register. 1 2 dmareq2 this bit reflects the presence of receive or transmit dma request 2. this is determined by comparing the current fifo levels to the rx_depth_dma2 and tx_depth_dma2 fields in the dma2 register. 1 7:3 - reserved. 0 11:8 rx_level reflects the current level of the receive fifo. 0 15:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 19:16 tx_level reflects the current level of the transmit fifo. 0 31:20 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1069 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.9.6.7 i2s dma configuration register 2 the dma2 register controls the operation of dm a request 2. the function of bits in dma2 are shown in ta b l e 9 9 4 . this register enables the dma for the i 2 s receive and transmit channels and sets the fifo level. remark: the fifos contain eight 16-bit words. therefore, if the i 2 s controller is configured for 32-bit mode (see table 994 and table 995 ), the maximum allowed fifo level is 4. 42.9.6.8 i2s interrupt request control register the irq register controls the operation of the i2 s interrupt request. the function of bits in irq are shown in table 994 . table 999. i2s dma configuration register 1 (dma1 - address 0x400a 2014) bit description bit symbol description reset value 0 rx_dma1_enable when 1, enables dma1 for i2s receive. 0 1 tx_dma1_enable when 1, enables dma1 for i2s transmit. 0 7:2 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. 0 11:8 rx_depth_dma1 set the fifo level that triggers a receive dma request on dma1. 0 15:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 19:16 tx_depth_dma1 set the fifo level that triggers a transmit dma request on dma1. 0 31:20 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 1000.i2s dma configuration register 2 (dma2 - address 0x400a 2018) bit description bit symbol description reset value 0 rx_dma2_enable when 1, enables dma1 for i2s receive. 0 1 tx_dma2_enable when 1, enables dma1 for i2s transmit. 0 7:2 - reserved. 0 11:8 rx_depth_dma2 set the fifo level that triggers a receive dma request on dma2. 0 15:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 19:16 tx_depth_dma2 set the fifo level that triggers a transmit dma request on dma2. 0 31:20 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 1001.i2s interrupt request control register (irq - address 0x400a 201c) bit description bit symbol description reset value 0 rx_irq_enable when 1, enables i2s receive interrupt. 0 1 tx_irq_enable when 1, enables i2s transmit interrupt. 0 7:2 - reserved. 0 11:8 rx_depth_irq set the fifo level on which to create an irq request. 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1070 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.9.6.9 i2s transmit clock rate register the mclk rate for the i2s transmitter is determ ined by the values in the txrate register. the required txrate setting depends on th e desired audio sample rate desired, the format (stereo/mono) used, and the data size. the transmitter mclk rate is generated using a fractional rate generator, dividing down the frequency of pclk_i2s ( = clk_apb1_i2s). values of the numerator (x) and the denominator (y) must be chosen to produce a frequency twice that desired for the transmitter mclk, which must be an integer multiple of the trans mitter bit clock rate. fractional rate generators have some aspects that the user should be aware of when choosing settings. these are discussed in section 42.9.6.9.1 . the equation for the fractional rate generator is: i2stxmclk = pclk_i2s * (x/y) /2 note: if the value of x or y is 0, then no clock is generated. also, the value of y must be greater than or equal to x. 42.9.6.9.1 notes on fractional rate generators the nature of a fraction al rate generator is th at there will be some ou tput jitter with some divide settings. this is because the fractional rate generator is a fully digital function, so output clock transitions are synchronous with the source clock, whereas a theoretical perfect fractional rate may have edges that ar e not related to the source clock. so, output jitter will not be greater than plus or minu s one source clock betwe en consecutive clock edges. for example, if x = 0x07 and y = 0x11, the fractional rate gene rator will output 7 clocks for every 17 (11 hex) input clocks, distributed as even ly as it can. in this example, there is no way to distribute the output clocks in a perfectly even fa shion, so some clocks will be longer than others. the output is divided by 2 in order to square it up, which also helps 15:12 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - 19:16 tx_depth_irq set the fifo level on which to create an irq request. 0 31:20 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 1001.i2s interrupt request control register (irq - address 0x400a 201c) bit description bit symbol description reset value table 1002.i2s transmit clock rate register (txrate - address 0x400a 2020) bit description bit symbol description reset value 7:0 y_divider i2s transmit mclk rate denominator. this value is used to divide pclk to produce the transmit mclk. eight bits of fractional divide supports a wide range of possibilities. a value of 0 stops the clock. 0 15:8 x_divider i2s transmit mclk rate numerator. this value is used to multiply pclk by to produce the transmit mclk. a value of 0 stops the clock. eight bits of fractional divide supports a wide range of possibilities. note: the resulting ratio x/y is divided by 2. 0 31:16 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1071 of 1164 nxp semiconductors UM10430 chapter 42: appendix with the jitter. the frequency av erages out to exactly (7/17) / 2, but some clocks will be a slightly different length than their neighbors. it is possible to avoid jitter entirely by choosing fractions such that x divides evenly into y, such as 2/4, 2/6, 3/9, 1/n, etc. 42.9.6.10 i2s receive clock rate register the mclk rate for the i2s receiver is determ ined by the values in the rxrate register. the required rxrate setting depends on the peripheral clock rate (pclk_i2s = clk_apb1_i2s) and the desired mclk rate (such as 256 fs). the receiver mclk rate is generated using a fractional rate generator, dividing down the frequency of pclk_i2s. values of the nume rator (x) and the denominator (y) must be chosen to produce a frequency twice that des ired for the receiver mclk, which must be an integer multiple of the receiver bit cloc k rate. fractional rate generators have some aspects that the user should be aware of when choosing settings. these are discussed in section 42.9.6.9.1 . the equation for the fractional rate generator is: i2srxmclk = pclk_i2s * (x/y) /2 note: if the value of x or y is 0, then no clock is generated. also, the value of y must be greater than or equal to x. 42.9.6.11 i2s transmit clock bit rate register the bit rate for the i2s transmitter is determi ned by the value of the txbitrate register. the value depends on the audio sample rate desired, and the data size and format (stereo/mono) used. for example, a 48 khz sample rate for 16-bit stereo data requires a bit rate of 48,000162 = 1.536 mhz. 42.9.6.12 i2s receive clock bit rate register the bit rate for the i2s receiver is determi ned by the value of the rxbitrate register. the value depends on the audio sample rate, as well as the data size and format used. the calculation is the same as for rxbitrate. table 1003.i2s receive clock rate register (rxrate - address 0x400a 2024) bit description bit symbol description reset value 7:0 y_divider i2s receive mclk rate denominator. this value is used to divide pclk to produce the receive mclk. eight bits of fractional divide supports a wide range of possibilities. a value of 0 stops the clock. 0 15:8 x_divider i2s receive mclk rate numerator. this value is used to multiply pclk by to produce the receive mclk. a value of 0 stops the clock. eight bits of fractional divide supports a wide range of possibilities. note: the resulting ratio x/y is divided by 2. 0 31:16 - reserved, user software should not write on es to reserved bits. the value read from a reserved bit is not defined. - table 1004.i2s transmit clock rate register (txbitrate - address 0x400a 2028) bit description bit symbol description reset value 5:0 tx_bitrate i2s transmit bit rate. this value plus one is used to divide tx_mclk to produce the transmit bit clock. 0 31:6 - reserved, user software should not write o nes to reserved bits. the value read from a reserved bit is not defined. - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1072 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.9.6.13 i2s transmit mode control register the transmit mode control register contains additional controls for transmit clock source, enabling the 4-pin mode, and how mclk is used. see section 42.9.7.2 for a summary of useful mode combinations. 42.9.6.14 i2s receive mode control register the receive mode control register contains additional controls for receive clock source, enabling the 4-pin mode, and how mclk is used. see section 42.9.7.2 for a summary of useful mode combinations. table 1005.i2s receive clock rate register (rxbitrate - address 0x400a 202c) bit description bit symbol description reset value 5:0 rx_bitr ate i2s receive bit rate. this value plus one is used to divide rx_mclk to produce the receive bit clock. 0 31:6 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. - table 1006.i2s transmit mode control register (txmode - address 0x400a 2030) bit description bit symbol value description reset value 1:0 txclksel clock source selection for the transmit bit clock divider. 0 0x0 select the tx fractional rate divider clock output as the source 0x1 reserved 0x2 select the rx_mclk signal as the tx_mclk clock source 0x3 reserved 2 tx4pin transmit 4-pin mode selection. when 1, enables 4-pin mode. 0 3 txmcena enable for the tx_mclk output. when 0, output of tx_mclk is not enabled. when 1, output of tx_mclk is enabled. 0 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na table 1007.i2s receive mode control register (rxmode - address 0x400a 2034) bit description bit symbol value description reset value 1:0 rxclksel clock source selection fo r the receive bit clock divider. 0 0x0 select the rx fractional rate divider clock output as the source 0x1 reserved 0x2 select the tx_mclk signal as the rx_mclk clock source 0x3 reserved 2 rx4pin receive 4-pin mode selection. when 1, enables 4-pin mode. 0 3 rxmcena enable for the rx_mclk output. when 0, output of rx_mclk is not enabled. when 1, output of rx_mclk is enabled. 0 31:4 - reserved, user software should not write ones to reserved bits. the value read from a reserved bit is not defined. na www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1073 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.9.7 functional description 42.9.7.1 i 2 s transmit and receive interfaces the i2s interface can transmit and receive 8-bi t, 16-bit or 32-bit stereo or mono audio information. some details of i2s implementation are: ? when the fifo is empty, th e transmit channel will repeat transmitting the same data until new data is written to the fifo. ? when mute is true, the da ta value 0 is transmitted. ? when mono is false, two successive data words are respectively left and right data. ? data word length is determined by the wo rdwidth value in the configuration register. there is a separate wordwidth value for the receive channel and the transmit channel. ? 0: word is considered to contain four 8-bit data words. ? 1: word is considered to contain two 16-bit data words. ? 3: word is considered to contain one 32-bit data word. ? when the transmit fifo cont ains insufficient data the transmit channe l will repeat transmitting the last data until new data is available. this can occur when the microprocessor or the dma at some time is unable to provide new data fast enough. because of this delay in new data ther e is a need to f ill the gap, which is accomplished by continuing to transmit the last sample. the data is not muted as this would produce an noticeable and undesirable effect in the sound. ? the transmit channel and the receive channel only handle 32-bit aligned words, data chunks must be clipped or extended to a multiple of 32 bits. when switching between data width or modes the i2s must be reset via the reset bit in the control register in order to ensure correct synchr onization. it is advisable to set the stop bit also until sufficient data has been written in the transmit fifo. note that when stopped data output is muted. all data accesses to fifos are 32 bits. figure 169 shows the possible data sequences. a data sample in the fifo consists of: ? 132 bits in 8-bit or 16-bit stereo modes. ? 132 bits in mono modes. ? 232 bits, first left data, second right data, in 32-bit stereo modes. data is read from the transmit fifo after the fallin g edge of ws, it w ill be transferred to the transmit clock domain after the rising ed ge of ws. on the next falling edge of ws the left data will be loaded in the shift register and tr ansmitted and on the fo llowing rising edge of ws the right data is loaded and transmitted. the receive ch annel will start receiving data after a change of ws. when word select becomes low it expects this data to be left data, when ws is high received data is expected to be right data. reception will stop when the bit counter has reached the limit set by wordwidth. on the ne xt change of ws the received data will be stored in the appropriate hold register. when complete data is available it w ill be written into the receive fifo. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1074 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.9.7.2 i 2 s operating modes the clocking and ws usage of the i2s interface is configurable. in addition to master and slave modes, which are independently configurable for the transmitter and the receiver, several different clock sources are possible, including variations that share the clock and/or ws between the transmit ter and receiver. this last op tion allows using i2s with fewer pins, typically four. many configurations are possible that are not considered useful, the following tables and figures give details of the configuratio ns that are most likely to be useful. table 1008.i2s transmit modes dao bit 5 txmode bits [3:0] description 0 0 0 0 0 typical transmitter master mode. see figure 157 . the i2s transmit function operates as a master. the transmit clock source is the fractional rate divider. the ws used is the internally generated tx_ws. the tx_mclk pin is not enabled for output. 0 0 0 1 0 transmitter master mode sharing the receiver reference clock. see figure 158 . the i2s transmit function operates as a master. the transmit clock source is rx_ref. the ws used is the internally generated tx_ws. the tx_mclk pin is not enabled for output. 0 0 1 0 0 4-wire transmitter master mode sharing the receiver bit clock and ws. see figure 159 . the i2s transmit function operates as a master. the transmit clock source is the rx bit clock. the ws used is the internally generated rx_ws. the tx_mclk pin is not enabled for output. 0 1 0 0 0 transmitter master mode with tx_mclk output. see figure 157 . the i2s transmit function operates as a master. the transmit clock source is the fractional rate divider. the ws used is the internally generated tx_ws. the tx_mclk pin is enabled for output. 1 0 0 0 0 typical transmitter slave mode. see figure 160 . the i2s transmit function operates as a slave. the transmit clock source is the tx_sck pin. the ws used is the tx_ws pin. 1 0 0 1 0 transmitter slave mode sharing the receiver reference clock. see figure 161 . the i2s transmit function operates as a slave. the transmit clock source is rx_ref. the ws used is the tx_ws pin. 1 0 1 0 0 4-wire transmitter slave mode sharing the receiver bit clock and ws. see figure 162 . the i2s transmit function operates as a slave. the transmit clock source is the rx bit clock. the ws used is rx_ws ref. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1075 of 1164 nxp semiconductors UM10430 chapter 42: appendix fig 157. typical transmitter master mode, with or wi thout mclk output i2stxmode[3] cclk n (1 to 64) 8-bit fractional rate divider 2 xy i 2 s peripheral block (transmit ) i2stxbitrate[5:0] tx_ref tx bit clock i2stx_rate[7:0] i2stx_rate[15:8] (pin oe) tx_ws ref i2s_tx_ws i2s_tx_sd a i2s_tx_sck fig 158. transmitter master mode sharing the receiver reference clock n (1 to 64) i2stxbitrate[5:0] rx_ref tx bit clock tx_ws ref i 2 s peripheral block (transmit ) i2s_tx_ws i2s_tx_sd a i2s_tx_sck fig 159. 4-wire transmitter master mode sharing the receiver bit clock and ws rx bit clock rx_ws ref i 2 s peripheral block (transmit ) i2s_tx_sda i2s_tx_sck fig 160. typical transmitter slave mode n (1 to 64) i 2 s peripheral block (transmit ) i2stxbitrate[5:0] tx_ref tx bit clock i2s_tx_ws i2s_tx_sd a i2s_tx_sck www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1076 of 1164 nxp semiconductors UM10430 chapter 42: appendix fig 161. transmitter slave mode sharing the receiver reference clock n (1 to 64) i 2 s peripheral block (transmit ) i2stxbitrate[5:0] rx _ref tx bit clock i2s_tx_ws i2s_tx_sd a fig 162. 4-wire transmitter slave mode sharing the receiver bit clock and ws rx bit clock rx_ws ref i 2 s peripheral block (transmit ) i2s_tx_sda table 1009.i2s receive modes dai bit 5 rxmode bit [3:0] description 0 0 0 0 0 typical receiver master mode. see figure 163 . the i2s receive function operates as a master. the receive clock source is the fractional rate divider. the ws used is the internally generated rx_ws. the rx_mclk pin is not enabled for output. 0 0 0 1 0 receiver master mode sharing the transmitter reference clock. see figure 164 . the i2s receive function operates as a master. the receive clock source is tx_ref. the ws used is the internally generated rx_ws. the rx_mclk pin is not enabled for output. 0 0 1 0 0 4-wire receiver master mode sharing the transmitter bit clock and ws. see figure 165 . the i2s receive function operates as a master. the receive clock source is the tx bit clock. the ws used is the internally generated tx_ws. the rx_mclk pin is not enabled for output. 0 1 0 0 0 receiver master mode with rx_mclk output. see figure 163 . the i2s receive function operates as a master. the receive clock source is the fractional rate divider. the ws used is the internally generated rx_ws. the rx_mclk pin is enabled for output. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1077 of 1164 nxp semiconductors UM10430 chapter 42: appendix 1 0 0 0 0 typical receiver slave mode. see figure 166 . the i2s receive function operates as a slave. the receive clock source is the rx_sck pin. the ws used is the rx_ws pin. 1 0 0 1 0 receiver slave mode sharing the transmitter reference clock. see figure 167 . the i2s receive function operates as a slave. the receive clock source is tx_ref. the ws used is the rx_ws pin. 1 0 1 0 0 this is a 4-wire receiver slave m ode sharing the transmitter bit clock and ws. see figure 168 . the i2s receive function operates as a slave. the receive clock source is the tx bit clock. the ws used is tx_ws ref. table 1009.i2s receive modes dai bit 5 rxmode bit [3:0] description fig 163. typical receiver master mode, with or without mclk output i2srxmode[3] cclk n (1 to 64) 8-bit fractional rate divider 2 xy i 2 s peripheral block (receive ) i2srxbitrate[5:0] rx_ref rx bit clock i2srx_rate[7:0] i2srx_rate[15:8] (pin oe) rx _ws ref i2s_rx_mclk i2s_rx_ws i2s_rx_sda i2s_rx_sck fig 164. receiver master mode sharing the transmitter reference clock n (1 to 64) i2srxbitrate[5:0] tx_ref rx bit clock rx_ws ref i 2 s peripheral block (receive) i2s_rx_ws i2s_rx_sd a i2s_rx_sck www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1078 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.9.7.3 fifo controller handling of data for transmission and reception is performed via the fifo controller which can generate two dma requests and an interrupt request. the controller consists of a set of comparators which compare fifo levels with depth settings contained in registers. the current status of the level comparators can be seen in the apb status register. fig 165. 4-wire receiver master mode sharing the transmitter bit clock and ws tx bit clock tx_ws ref i 2 s peripheral block (receive) i2s_rx_sda i2s_rx_sck fig 166. typical receiver slave mode n (1 to 64) i 2 s peripheral block (receive) i2srxbitrate[5:0] rx_ref rx bit clock i2s_rx_ws i2s_rx_sd a i2s_rx_sck fig 167. receiver slave mode sharing the transmitter reference clock n (1 to 64) i 2 s peripheral block (receive) i2srxbitrate[5:0] tx_ref rx bit clock i2s_rx_ws i2s_rx_sd a fig 168. 4-wire receiver slave mode sharing the transmitter bit clock and ws tx bit clock tx_ws ref i 2 s peripheral block (receive) i2s_rx_sd a www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1079 of 1164 nxp semiconductors UM10430 chapter 42: appendix system signaling occurs when a level detection is true and enabled. table 1010.conditions for fifo level comparison level comparison condition dmareq_tx_1 tx_depth_dma1 >= tx_level dmareq_rx_1 rx_depth_dma1 <= rx_level dmareq_tx_2 tx_depth_dma2 >= tx_level dmareq_rx_2 rx_depth_dma2 <= rx_level irq_tx tx_depth_irq >= tx_level irq_rx rx_depth_irq <= rx_level table 1011.dma and interrupt request generation system signaling condition irq (irq_rx & rx_irq_enable) | (irq_tx & tx_irq_enable) dmareq[0] (dmareq_tx_1 & tx_dma1_enable ) | (dmareq_rx_1 & rx_dma1_enable ) dmareq[1] ( dmareq_tx_2 & tx_dma2_enable ) | (dmareq_rx_2 & rx_dma2_enable ) table 1012.status feedback in the state register status feedback status irq irq_rx | irq_tx dmareq1 (dmareq_tx_1 | dmareq_rx_1) dmareq2 (dmareq_rx_2 | dmareq_tx_2) www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1080 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10 lpc1850/30/20/ 10 rev ?-? c_can 42.10.1 how to read this chapter the c_can controller is available on all lpc18xx parts. 42.10.2 basic configuration the c_can is configured as follows: ? see ta b l e 9 0 1 for clocking and power control. ? the c_can is reset by the can_rst (reset # 55). ? the c_can interrupt is connected to slot # 12 in the event router. fig 169. fifo contents for various i 2 s modes left + 1 7 0 right + 1 7 0 left 7 0 right 7 0 stereo 8-bit data mode n + 3 7 0 n + 2 7 0 n + 1 7 0 n 7 0 mono 8-bit data mode n + 1 15 0 n 15 0 mono 16-bit data mode left 15 0 right 15 0 stereo 16-bit data mode n 31 0 mono 32-bit data mode left 31 0 stereo 32-bit data mode n right 31 0 n + 1 table 1013.c_can clocking and power control base clock branch clock maximum frequency clock to the c_can register interface and c_can peripheral clock. base_apb3_clk clk_apb3_can 150 mhz www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1081 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.3 features ? conforms to protocol version 2.0 parts a and b. ? supports bit rate of up to 1 mbit/s. ? supports 32 message objects. ? each message object has its own identifier mask. ? provides programmable fifo mode (concatenation of message objects). ? provides maskable interrupts. ? supports disabled automatic retransmission (dar) mode for time-triggered can applications. ? provides programmable loop-back mode for self-test operation. 42.10.4 general description controller area network (can) is the definition of a high performance communication protocol for serial data communication. the c_ can controller is designed to provide a full implementation of the can protocol accordin g to the can specification version 2.0b. the c_can controller allows to build powerful local networks with low-cost multip lex wiring by supporting distributed real-time control with a very high level of security. the can controller consists of a can core, message ram, a message handler, control registers, and the apb interface. for communication on a can network, individual message objects are configured. the message objects and identifier masks for acceptance filtering of received messages are stored in the message ram. all functions concerning the handling of messages are implemented in the message handler. those functions are the acceptance f iltering, the transfer of messages between the can core and the message ram, and the handling of transmission requests as well as the generation of the module interrupt. the register set of the can controller can be accessed directly by an external cpu via the apb bus. these registers are us ed to control/configure th e can core and the message handler and to access the message ram. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1082 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.5 pin description fig 170. c_can block diagram can core message ram register interface message handler apb bus apb interface can1_td can1_rd c_can table 1014.c_can pin description function pinned out direction description can_rd i c_can receive input can_td o c_can transmit output www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1083 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.6 register description register values at reset after a hardware reset, the registers hold the values described in table 904 . additionally, the busoff state is reset and the output td0,1 is set to recessive (high). the value 0x0001 (init = ?1?) in the can control regist er enables the software initialization. the can controller does not communicate with th e can bus until the cpu resets init to ?0?. the data stored in the message ram is not affected by a hardware reset. after power-on, the contents of the message ram is undefined. timing of read/write operations remark: reading any of the can registers requires two consecutive read operations from the same location. only the data from the second read operation are valid. successive read operations to the c_can registers must be separated by a minimum of (clkdivval ? 2+2) ? pclk, where clkdivval is the can clock divider value and pclk is the peripheral clock. successive write operations to the c_can registers must be separated by a minimum of (clkdivval ? 2) ? pclk, where clkdivval is the can clock divider value and pclk is the peripheral clock. table 1015.register overview: c_can0 (base address 0x400e 2000) name access address offset description reset value cntl 0x000 can control 0x0001 stat 0x004 status register 0x0000 ec ro 0x008 error counter 0x0000 bt 0x00c bit timing register 0x2301 int ro 0x010 interrupt register 0x0000 test 0x014 test register - brpe 0x018 baud rate prescaler extension register 0x0000 - - 0x01c reserved - if1_cmdreq 0x020 message interface 1 command request 0x0001 if1_cmdmsk_w 0x024 message interface 1 command mask (write direction) 0x0000 if1_cmdmsk_r 0x024 message interface 1 command mask (read direction) 0x0000 if1_msk1 0x028 message interface 1 mask 1 0xffff if1_msk2 0x02c message interface 1 mask 2 0xffff if1_arb1 0x030 message interface 1 arbitration 1 0x0000 if1_arb2 0x034 message interface 1 arbitration 2 0x0000 if1_mctrl 0x038 message interface 1 message control 0x0000 if1_da1 0x03c message interface 1 data a1 0x0000 if1_da2 0x040 message interface 1 data a2 0x0000 if1_db1 0x044 message interface 1 data b1 0x0000 if1_db2 0x048 message interface 1 data b2 0x0000 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1084 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.6.1 can protocol registers 42.10.6.1.1 can control register after a hardware reset, the registers of the c_can controller hold the values described in table 904 . additionally, the busoff state is set, and the td0/1 outputs are set to high. the reset value 0x0001 of the canctrl register enables initialization by software (init = 1). the c_can does not influence the can bus until the cpu resets the init bit to 0. -0x04c - 0x07c reserved - if2_cmdreq 0x080 message interface 2 command request 0x0001 if2_cmdmsk 0x084 message interface 2 command mask 0x0000 if2_msk1 0x088 message interface 2 mask 1 0xffff if2_msk2 0x08c message interface 2 mask 2 0xffff if2_arb1 0x090 message interface 2 arbitration 1 0x0000 if2_arb2 0x094 message interface 2 arbitration 2 0x0000 if2_mctrl 0x098 message interface 2 message control 0x0000 if2_da1 0x09c message interface 2 data a1 0x0000 if2_da2 0x0a0 message interface 2 data a2 0x0000 if2_db1 0x0a4 message interface 2 data b1 0x0000 if2_db2 0x0a8 message interface 2 data b2 0x0000 - - 0x0ac - 0x0fc txreq1 ro 0x100 transmission request 1 0x0000 txreq2 ro 0x104 transmission request 2 0x0000 - - 0x108 - 0x11c reserved - nd1 ro 0x120 new data 1 0x0000 nd2 ro 0x124 new data 2 0x0000 - - 0x128 - 0x13c reserved - ir1 ro 0x140 interrupt pending 1 0x0000 ir2 ro 0x144 interrupt pending 2 0x0000 - - 0x148 - 0x15c reserved - msgv1 ro 0x160 message valid 1 0x0000 msgv2 ro 0x164 message valid 2 0x0000 - - 0x168 - 0x17c reserved - clkdiv r/w 0x180 can clock divider register 0x0001 table 1015.register overview: c_can0 (base address 0x400e 2000) name access address offset description reset value www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1085 of 1164 nxp semiconductors UM10430 chapter 42: appendix remark: the busoff recovery sequence (see can specification rev. 2.0 ) cannot be shortened by setting or re setting the init bit. if the device g oes into busoff state, it will set init, stopping all bus activities. once init has been cleare d by the cpu, the device will then wait for 129 occurr ences of bus idle (129 ? 11 consecutive high/recessive bits) before resuming normal operations. at the end of the busoff recovery sequence, the error management co unters will be reset. table 1016.can control registers (cntl, address 0x400e 2000) bit description bit symbol value description reset value access 0 init initialization 1 r/w 1 initialization is started. on reset, software needs to initialize the can controller. 0 normal operation. 1 ie module interrupt enable 0 r/w 1 enable can interrupts. the interrupt line is set to low and remains low until all pending interrupts are cleared. 0 disable can interrupts. the interrupt line is always high. 2 sie status change interrupt enable 0 r/w 1 enable status change interrupts. a status change interrupt will be generated when a message transfer is su ccessfully completed or a can bus error is detected. 0 disable status change interrupts. no status change interrupt will be generated. 3 eie error interrupt enable 0 r/w 1 enable error interrupt. a change in the bits boff or ewarn in the canstat registers will generate an interrupt. 0 disable error inte rrupt. no error status interrupt will be generated. 4- - reserved 0 - 5 dar disable automatic retransmission 0 r/w 1 automatic retransmission disabled. 0 automatic retransmission of disturbed messages enabled. 6 cce configuration change enable 0 r/w 1 the cpu has write access to the canbt register while the init bit is one. 0 the cpu has no write access to the bit timing register. 7 test test mode enable 0 r/w 1 test mode. 0 normal operation. 31:8 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1086 of 1164 nxp semiconductors UM10430 chapter 42: appendix during the waiting time after the resettin g of init, each time a sequence of 11 high/recessive bits has been monitored, a bit0 error code is written to the status register canstat, enabling the cpu to monitor the proceeding of the busoff recovery sequence and to determine whether the can bus is stuck at low/dominant or continuously disturbed. 42.10.6.1.2 can status register table 1017.can status register (stat, address 0x400e 2004) bit description bit symbol value description reset value access 2:0 lec last error code type of the last error to occur on the can bus.the lec field holds a code which indicates the type of the last error to occur on the can bus. this field will be cleared to ?0? when a message has been transferred (reception or transmission) without error. the unused code ?111? may be written by the cpu to check for updates. 000 r/w 0x0 no error . 0x1 stuff error : more than 5 equal bits in a sequence have occurred in a part of a received message where this is not allowed. 0x2 form error : a fixed format part of a received frame has the wrong format. 0x3 ackerror : the message this can core transmitted was not acknowledged. 0x4 bit1error : during the transmission of a message (with the exception of the arbitration field), the device wanted to send a high/recessive level (bit of logical value ?1?), but the monitored bus value was low/dominant. 0x5 bit0error : during the transmission of a message (or acknowledge bit, or active error flag, or overload flag), the device wanted to send a low/dominant level (data or identifier bit logical value ?0?), but the monitored bus value was high/recessive. during busoff recovery this status is set each time a sequence of 11 high/recessive bits has been monitored. this enables the cpu to monitor the proceeding of the busoff recovery sequence (indicating the bus is not stuck at low/dominant or continuously disturbed). 0x6 crcerror : the crc checksum was incorrect in the message received. 0x7 unused: no can bus event was detected (written by the cpu). 3 txok transmitted a message successfully this bit is reset by the cpu. it is never reset by the can controller. 0r/w 1 since this bit was last reset by the cpu, a message has been successfully transmitted (error free and acknowledged by at least one other node). 0 since this bit was reset by the cpu, no message has been successfully transmitted. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1087 of 1164 nxp semiconductors UM10430 chapter 42: appendix a status interrupt is generated by bits boff, ewarn, rxok, txok, or lec. boff and ewarn generate an error interrupt, and rxok, txok, and lec generate a status change interrupt if eie and sie respectively are set to enabled in the canctrl register. a change of bit epass and a wr ite to rxok, txok, or lec will never create a status interrupt. reading the canstat register will clear the st atus interrupt value in the canir register. 42.10.6.1.3 can error counter 4 rxok received a message successfully this bit is reset by the cpu. it is never reset by the can controller. 0r/w 1 since this bit was last set to zero by the cpu, a message has been successfully received independent of the result of acceptance filtering. 0 since this bit was last reset by the cpu, no message has been successfully transmitted. 5 epass error passive 0 ro 1 the can controller is in the error passive state as defined in the can 2.0 specification . 0 the can controller is in the error active state. 6 ewarn warning status 0 ro 1 at least one of the error counters in the eml has reached the error warning limit of 96. 0 both error counters are below the error warning limit of 96. 7 boff busoff status 0 ro 1 the can controller is in busoff state. 0 the can module is not in busoff. 31:8 - - reserved table 1017.can status register (stat, address 0x400e 2004) bit description ?continued bit symbol value description reset value access table 1018.can error counter (ec, address 0x400e 2008) bit description bit symbol value description reset value access 7:0 tec_7_0 transmit error counter current value of the transmit error counter (maximum value 127) 0ro 14:8 rec_6_0 receive error counter current value of the receive error counter (maximum value 255). 0ro 15 rp receive error passive 0 ro 1 the receive counter has reached the error passive level as defined in the can2.0 specification . 0 the receive counter is below the error passive level. 31:16 - - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1088 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.6.1.4 can bit timing register [1] hardware interprets the value progra mmed into these bits as the bit value ? 1. remark: with a module clock can_clk of 8 mhz, the reset value of 0x2301 configures the c_can for a bit rate of 500 kbit/s. the registers are only writable if a configuration change is enabled in canctrl and the controlle r is initialized by software (bits cce and init in the can control register are set). 42.10.6.1.5 can interrupt register if several interrupts are pending, the can inte rrupt register will po int to the pending interrupt with the highest prio rity, disregarding their chronological order. an interrupt remains pending until the cpu has cleared it. if intid is different from 0x0000 and ie is set, the interrupt line to the cpu is active. th e interrupt line remains active until intid is back to value 0x0000 (the cause of the interrupt is reset) or until ie is reset. the status interrupt has the highest priority . among the message interrupts, the message object? s interrupt prio rity decreases with increasing message number. a message interrupt is cleared by clearing the message object?s intpnd bit. the statusinterrupt is cleared by reading the status register. table 1019.can bit timing register (bt, address 0x400e 200c) bit description bit symbol description reset value access 5:0 brp baud rate prescaler the value by which the oscillator frequency is divided for generating the bit time quanta. the bit time is built up from a multiple of this quanta. valid values for the baud rate prescaler are 0 to 63 [1] . valid programmed values are 0x01 - 0x3f [1] . 1r/w 7:6 sjw (re)synchronization jump width valid programmed values are 0 to 3 [1] . 0r/w 11:8 tseg1 time segment after the sample point valid values are 0 to 7 [1] . 0011 r/w 14:12 tseg2 time segment before the sample point valid values are 1 to 15 [1] . 010 r/w 31:15 - reserved - - table 1020.can interrupt register (int, address 0x400e 2010) bit description bit symbol description reset value access 15:0 intid15_0 0x0000 = no interrupt is pending 0x0001 to 0x0020 = number of message object which caused the interrupt. 0x0021 to 0x7fff = unused 0x8000 = status interrupt 0x8001 to 0xffff = unused 0r 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1089 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.6.1.6 can test register write access to the test register is enabled by setting bit test in the can control register. the different test functions may be combined, but when tx[1:0] ? ?00? is selected, the message transfer is disturbed. 42.10.6.1.7 can baud rate prescaler extension register table 1021.can test register (test, address 0x400e 2014) bit description bit symbol value description reset value access 1:0 - - - 2 basic basic mode 0 r/w 1 if1 registers used as tx buffer, if2 registers used as rx buffer. 0 basic mode disabled. 3 silent silent mode 0 r/w 1 the module is in silent mode. 0 normal operation. 4 lback loop back mode 0 r/w 1 loop back mode is enabled. 0 loop back mode is disabled. 6:5 tx1_0 control of td pins 00 r/w 0x0 level at the td pin is controlled by the can controller. this is the value at reset. 0x1 the sample point can be monitored at the td pin. 0x2 td pin is driven low/dominant. 0x3 td pin is driven high/recessive. 7 rx monitors the actual value of the rd pin 0 r 1 the can bus is recessive (rd = 1). 0 the can bus is dominant (rd = 0). 31:8 - reserved - table 1022.can baud rate prescaler extension register (brpe, address 0x400e 2018) bit description bit symbol description reset value access 3:0 brpe baud rate prescaler extension by programming brpe the baud rate prescaler can be extended to values up to 1023. hardware interprets the value as the value of brpe (msbs) and brp (lsbs) plus one. allowed values are 0x00 to 0x0f 0x0000 r/w 31:4 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1090 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.6.2 message interface registers there are two sets of interface registers which are used to control the cpu access to the message ram. the interface registers avoi d conflicts between cpu access to the message ram and can message reception and tr ansmission by buffering the data to be transferred. a complete message object (see section 42.10.6.2.1 ) or parts of the message object may be transferred betw een the message ram and the ifx message buffer registers in one single transfer. the function of the two interface register sets is identical (except for test mode basic). one set of registers may be used for data transfer to the message ram while the other set of registers may be used for the data tr ansfer from the message ram, allowing both processes to be interrupted by each other. each set of interface registers consists of message buffer registers controlled by their own command registers. the command mask regist er specifies the direction of the data transfer and which parts of a message objec t will be transferred. the command request register is used to select a message object in the message ram as target or source for the transfer and to start the action sp ecified in the command mask register. fig 171. block diagram of a message object transfer if1 mask1, 2 if1 arbitration 1/2 if1 message ctrl if1 data a1/2 if1 data b1/2 if2 mask1, 2 if2 arbitration 1/2 if2 message ctrl if2 data a1/2 if2 data b1/2 message ram message object 1 message object 2 . . . message object 32 transfer a message object read transfer write transfer apb bus message buffer registers if1 command request if1 command mask if2 command request if2 command mask interface command registers message handler transmission request 1/2 new data 1/2 interrupt pending1/2 message valid1/2 can bus receive transfer a can frame transmit can core/ shift registers www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1091 of 1164 nxp semiconductors UM10430 chapter 42: appendix there are 32 message objects in the message ram. to avoid conflicts between cpu access to the message ram and can message reception and transmission, the cpu cannot directly access the message objects. the message objects are accessed through the ifx interface registers. 42.10.6.2.1 message objects a message object contains the information from the various bits in the message interface registers. table 1024 below shows a schematic representation of the structure of the message object. the bits of a message object and the respective interface register where this bit is set or cleared are shown. for bit functions see the corresponding interface register. 42.10.6.2.2 can message interface command request registers a message transfer is started as soon as the cpu has written the message number to the command request register. with this write opera tion the busy bit is automatically set to ?1? and the signal can_wait_b is pulled low) to notify the cpu that a transfer is in progress. after a wait time of 3 to 6 can_clk periods, the transfer between the interface register and the message ram has completed. the busy bit is set back to zero and the signal can_wait_b is set back). table 1023.message interface registers if1 register names if1 register set if2 register names if2 register set if1_cmdreq if1 command request if2_cmdreq if2 command request if1_cmdmask if1 command mask if2_cmdmask if2 command mask if1_mask1 if1 mask 1 if2_msk1 if2 mask 1 if1_mask2 if1 mask 2 if2_msk2 if2 mask 2 if1_arb1 if1 arbitration 1 if2_arb1 if2 arbitration 1 if1_arb2 if1 arbitration 2 if2_arb2 if2 arbitration 2 if1_mctrl if1 message control if2_mctrl if2 message control if1_da1 if1 data a1 if2_da1 if2 data a1 if1_da2 if1 data a2 if2_da2 if2 data a2 cif1_db1 if1 data b1 if2_db1 if2 data b1 if1_db2 if1 data b2 if2_db2 if2 data b2 table 1024.structure of a message object in the message ram umask msk[28:0] mxtd mdir eob newdat msglst rxie txie intpnd if1/2_mctrl if1/2_msk1/2 if1/2_mctrl rmten txrqst msgval id[28:0] xtd dir dlc3 dlc2 dlc1 dlc0 if1/2_mctrl if1/2_arb1/2 if1/2_mctrl data0 data1 data2 data3 data4 data5 data6 data7 if1/2_da1 if1/2_da2 if1/2_db1 if1/2_db2 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1092 of 1164 nxp semiconductors UM10430 chapter 42: appendix [1] when a message number that is not valid is writt en into the command request registers, the message number will be transformed into a valid value and that message object will be transferred. 42.10.6.2.3 can message interface command mask registers the control bits of the ifx command mask re gister specify the transfer direction and select which of the ifx message buffer r egisters are source or target of the data transfer.the functions of the register bits depe nd on the transfer dire ction (read or write) which is selected in the wr/rd bit (bit 7) of this command mask register. select the wr/rd to one for the write transfer direction (write to message ram) zero for the read transfer direct ion (read from message ram) transfer direction write table 1025.can message interface command re quest registers (if1_cmdreq, address 0x400e 2020 and if2_cmdreq, address 0x400e 2080) bit description bit symbol description reset value access 5:0 message number message number 0x01 to 0x20 = valid message numbers the message object in the message ram is selected for data transfer. 0x00 = not a valid message number. this value is interpreted as 0x20. [1] 0x21 to 0x3f = not a valid message number. this value is interpreted as 0x01 - 0x1f. [1] 0x01 r/w 14:6 - reserved 15 busy busy flag 0 r set to one by hardware when writing to this command request register. set to zero by hardwa re when read/write action to this command request register has finished. 31:16 - reserved - - table 1026.can message interface command mask registers write direction (if1_cmdmsk, address 0x400e 2024 and if2_cmdmsk, address 0x400e 2084) bit description bit symbol value description reset value access 0 data_b access data bytes 4-7 0 r/w 1 transfer data bytes 4-7 to message object. 0 data bytes 4-7 unchanged. 1 data_a access data bytes 0-3 0 r/w 1 transfer data bytes 0-3 to message object. 0 data bytes 0-3 unchanged. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1093 of 1164 nxp semiconductors UM10430 chapter 42: appendix transfer direction read 2 txrqst access transmission request bit 0 r/w 1 request a transmission. set the txrqst bit if1/2_mctrl. 0 no transmission request. txrqsrt bit unchanged in if1/2_mctrl. remark: if a transmission is requested by programming this bit, the txrqst bit in the canifn_mctrl register is ignored. 3 clrintpnd - this bit is ignored in the write direction. 0 r/w 4 ctrl access control bits 0 r/w 1 transfer control bits to message object 0 control bits unchanged. 5 arb access arbitration bits 0 r/w 1 transfer identifier, dir, xtd, and msgval bits to message object. 0 arbitration bits unchanged. 6 mask access mask bits 0 r/w 1 transfer identifier mask + mdir + mxtd to message object. 0 mask bits unchanged. 7 wr_rd 1 write transfer transfer data from the selected message buffer registers to the message object addressed by the command request register canifn_cmdreq. 0r/w 31:8 - - reserved 0 - table 1027.can message interface command mask registers read direction (if1_cmdmsk, address 0x400e 2024 and if2_cmdmsk, address 0x400e 2084) bit description bit symbol value description reset value access 0 data_b access data bytes 4-7 0 r/w 1 transfer data bytes 4-7 to ifx message buffer register. 0 data bytes 4-7 unchanged. 1 data_a access data bytes 0-3 0 r/w 1 transfer data bytes 0-3 to ifx message buffer. 0 data bytes 0-3 unchanged. table 1026.can message interface command mask registers write direction (if1_cmdmsk, address 0x400e 2024 and if2_cmdmsk, address 0x400e 2084) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1094 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.6.2.4 if1 and if2 message buffer registers the bits of the message buffer registers mirror the message objects in the message ram. 2 newdat access new data bit 0 r/w 1 clear newdat bit in the message object. 0 newdat bit remains unchanged. remark: a read access to a message object can be combined with the reset of the control bits intpnd and newdat in if1/2_mctrl. the values of these bits transferred to the ifx message control register always reflect the status before resetting these bits. 3 clrintpnd clear interrupt pending bit. 0 r/w 1 clear intpnd bit in the message object. 0 intpnd bit remains unchanged. 4 ctrl access control bits 0 r/w 1 transfer control bits to ifx message buffer. 0 control bits unchanged. 5 arb access arbitration bits 0 r/w 1 transfer identifier, dir, xtd, and msgval bits to ifx message buffer register. 0 arbitration bits unchanged. 6 mask access mask bits 0 r/w 1 transfer identifier mask + mdir + mxtd to ifx message buffer register. 0 mask bits unchanged. 7 wr_rd 0 read transfer transfer data from the message object addressed by the command request register to the selected message buffer registers canifn_cmdreq. 0r/w 31:8 - - reserved 0 - table 1027.can message interface command mask registers read direction (if1_cmdmsk, address 0x400e 2024 and if2_cmdmsk, address 0x400e 2084) bit description bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1095 of 1164 nxp semiconductors UM10430 chapter 42: appendix can message interface command mask 1 registers can message interface command mask 2 registers can message interface command arbitration 1 registers table 1028.can message interface command mask 1 registers (if1_msk1, address 0x400e 2028 and if2_msk1, address 0x400e 2088) bit description bit symbol description reset value access 15:0 msk15_0 identifier mask 0 = the corresponding bit in the identifier of the message can not inhibit the match in the acceptance filtering. 1 = the corresponding identifier bit is used for acceptance filtering. 0xffff r/w 31:16 - reserved 0 - table 1029.can message interface command mask 2 registers (if1_msk2, address 0x400e 202c and if2_msk2, 0x400e 208c) bit description bit symbol value description reset value access 12:0 msk28_16 identifier mask 0 = the corresponding bit in the identifier of the message can not inhibit the match in the acceptance filtering. 1 = the corresponding identifier bit is used for acceptance filtering. 0xfff r/w 13 - reserved 1 - 14 mdir mask message direction 1 r/w 1 the message direction bit (dir) is used for acceptance filtering. 0 the message direction bit (dir) has no effect on acceptance filtering. 15 mxtd mask extend identifier 1 r/w 1 the extended identifier bit (ide) is used for acceptance filtering. 0 the extended identifier bit (ide) has no effect on acceptance filtering. 31:16 - - reserved 0 - table 1030.can message interface command arbi tration 1 registers (if1_arb1, address 0x400e 2030 and if2_arb1, address 0x400e 2090) bit description bit symbol description reset value access 15:0 id15_0 message identifier 29-bit identifier (?extended frame?) 11-bit identifier (?standard frame?) 0x00 r/w 31:16 - reserved 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1096 of 1164 nxp semiconductors UM10430 chapter 42: appendix can message interface command arbitration 2 registers table 1031.can message interface command arbi tration 2 registers (if1_arb2, address 0x400e 2034 and if2_arb2, address 0x400e 2094) bit description bit symbol value description reset value access 12:0 id28_16 message identifier 29-bit identifier (?extended frame?) 11-bit identifier (?standard frame?) 0x00 r/w 13 dir message direction 0x00 r/w 1 direction = transmit. on txrqst, the respecti ve message object is transmitted as a data frame. on reception of a remote frame with matching identifier, the txrqst bit of this message object is set (if rmten = one). 0 direction = receive. on txrqst, a remote frame with the identifier of this message object is transmitted. on reception of a data frame with matching identifier, that message is stored in this message object. 14 xtd extend identifier 0x00 r/w 1 the 29-bit extended identifier will be used for this message object. 0 the 11-bit standard identifier will be used for this message object. 15 msgval message valid remark: the msgval bit of all unused messages objects is reset during the initialization before bit init is reset in the can control register. this bit must be set to zero before the identifier id28:0, the control bits xtd, dir, or the data length code dlc3:0 are modified, or if the messages object is no longer required. 0r/w 1 the message object is configured and should be considered by the message handler. 0 the message object is ignored by the message handler. 31:16 - - reserved 0 - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1097 of 1164 nxp semiconductors UM10430 chapter 42: appendix can message interface message control registers table 1032.can message interf ace message control regist ers (if1_mctrl, address 0x400e 2038 and if2_mctrl, address 0x400e 2098) bit description bit symbol value description reset value access 3:0 dlc[3:0] data length code remark: the data length code of a message object must be defined the same as in all the corresponding objects with the same identifier at other nodes. when the message handler stores a data frame, it will write the dlc to the value given by the received message. 0000 to 1000 = data frame has 0 - 8 data bytes. 1001 to 1111 = data frame has 8 data bytes. 0000 r/w 6:4 - reserved - - 7 eob end of buffer 0 r/w 1 single message object or last message object of a fifo buffer. 0 message object belongs to a fifo buffer and is not the last message object of that fifo buffer. 8 txrqst transmit request 0 r/w 1 the transmission of this message object is requested and is not yet done 0 this message object is not waiting for transmission. 9 rmten remote enable 0 r/w 1 at the reception of a remote frame, txrqst is set. 0 at the reception of a remote frame, txrqst is left unchanged. 10 rxie receive interrupt enable 0 r/w 1 intpnd will be set after successful reception of a frame. 0 intpnd will be left unchanged after successful reception of a frame. 11 txie transmit interrupt enable 0 r/w 1 intpnd will be set after a successful reception of a frame. 0 the intpnd bit will be left unchanged after a successful reception of a frame. 12 umask use acceptance mask remark: if umask is set to 1, the message object?s mask bits have to be programmed during initialization of the message object before magval is set to 1. 0r/w 1 use mask (msk[28:0], mxtd, and mdir) for acceptance filtering. 0 mask ignored. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1098 of 1164 nxp semiconductors UM10430 chapter 42: appendix can message interface data a1 registers : in a can data frame, data0 is the first, data7 (in can_if1b2 and can_if2b2) is the last byte to be transmitted or received. in can?s serial bit stream, the msb of ea ch byte will be transmitted first. remark: byte data0 is the first data byte shifted into the shift register of the can core during a reception, byte data7 is the las t. when the message handler stores a data frame, it will write all the eigh t data bytes into a message ob ject. if the data length code is less than 8, the remaining bytes of th e message object will be overwritten by non specified values. 13 intpnd interrupt pending 0 r/w 1 this message object is the source of an interrupt. the interrupt identifier in the interrupt register will point to this message object if there is no other interrupt source with higher priority. 0 this message object is not the source of an interrupt. 14 msglst message lost (only valid for message objects in the direction receive). 0r/w 1 the message handler stored a new message into this object when newdat was still set, the cpu has lost a message. 0 no message lost since this bit was reset last by the cpu. 15 newdat new data 0 r/w 1 the message handler or the cpu has written new data into the data portion of this message object. 0 no new data has been written into the data portion of this message object by the message handler since this flag was cleared last by the cpu. 31:16 - - reserved 0 - table 1033.can message interface data a1 registers (if1_da1, address 0x400e 203c and if2_da1, address 0x400e 209c) bit description bit symbol description reset value access 7:0 data0 data byte 0 0x00 r/w 15:8 data1 data byte 1 0x00 r/w 31:16 - reserved - - table 1032.can message interf ace message control regist ers (if1_mctrl, address 0x400e 2038 and if2_mctrl, address 0x400e 2098) bit description ?continued bit symbol value description reset value access www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1099 of 1164 nxp semiconductors UM10430 chapter 42: appendix can message interface data a2 registers can message interface data b1 registers can message interface data b2 registers 42.10.6.3 message handler registers all message handler registers are read-only. their contents (txrqst, newdat, intpnd, and msgval bits of each message obje ct and the interrupt id entifier) is status information provided by the message handler fsm. 42.10.6.3.1 can transmission request 1 register this register contains the txrqst bits of message objects 1 to 16. by reading out the txrqst bits, the cpu can check for which message object a transmission request is pending. the txrqst bit of a specific message object can be set/reset by the cpu via the ifx message interface registers or by the message handler after reception of a remote frame or after a successful transmission. table 1034.can message interface data a2 registers (if1_da2, address 0x400e 2040 and if2_da2, address 0x400e 20a0) bit description bit symbol description reset value access 7:0 data2 data byte 2 0x00 r/w 15:8 data3 data byte 3 0x00 r/w 31:16 - reserved - - table 1035.can message interface data b1 registers (if1_db1, address 0x400e 2044 and if2_db1, address 0x400e 20a4) bit description bit symbol description reset value access 7:0 data4 data byte 4 0x00 r/w 15:8 data5 data byte 5 0x00 r/w 31:16 - reserved - - table 1036.can message interface data b2 registers (if1_db2, address 0x400e 2048 and if2_db2, address 0x400e 20a8) bit description bit symbol description reset value access 7:0 data6 data byte 6 0x00 r/w 15:8 data7 data byte 7 0x00 r/w 31:16 - reserved - - table 1037.can transmission request 1 register (txreq1, address 0x400e 2100) bit description bit symbol description reset value access 15:0 txrqst16_1 transmission request bit of message objects 16 to 1. 0 = this message object is not waiting for transmission. 1 = the transmission of this message object is requested and not yet done. 0x00 r 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1100 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.6.3.2 can transmission request 2 register this register contains the txrqst bits of message objects 32 to 17. by reading out the txrqst bits, the cpu can check for which message object a transmission request is pending. the txrqst bit of a specific message object can be set/reset by the cpu via the ifx message interface registers or by the message handler after reception of a remote frame or after a successful transmission. 42.10.6.3.3 can new data 1 register this register contains the newdat bits of message objects 16 to 1. by reading out the newdat bits, the cpu can check for which message object the data portion was updated. the newdat bit of a specific mess age object can be set/reset by the cpu via the ifx message interface registers or by th e message handler after reception of a data frame or after a successful transmission. 42.10.6.3.4 can new data 2 register this register contains the newdat bits of message objects 32 to 17. by reading out the newdat bits, the cpu can check for which message object the data portion was updated. the newdat bit of a specific mess age object can be set/reset by the cpu via the ifx message interface registers or by th e message handler after reception of a data frame or after a successful transmission. table 1038.can transmission request 2 register (txreq2, address 0x400e 2104) bit description bit symbol description reset value access 15:0 txrqst32_17 transmission request bit of message objects 32 to 17. 0 = this message object is not waiting for transmission. 1 = the transmission of this message object is requested and not yet done. 0x00 r 31:16 - reserved - - table 1039.can new data 1 register (nd1, address 0x400e 2120) bit description bit symbol description reset value access 15:0 newdat16_1 new data bits of message objects 16 to 1. 0 = no new data has been written into the data portion of this message object by the message handler since last time this flag was cleared by the cpu. 1 = the message handler or the cpu has written new data into the data portion of this message object. 0x00 r 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1101 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.6.3.5 can interrupt pending 1 register this register contains the intpnd bits of message objects 16 to 1. by reading out the intpnd bits, the cpu can check for which message object an interrupt is pending. the intpnd bit of a specific message object can be set/reset by the cpu via the ifx message interface registers or by the message handler after reception or after a successful transmission of a frame. this w ill also affect the value of intpnd in the interrupt register. 42.10.6.3.6 can interrupt pending 2 register this register contains the intpnd bits of message objects 32 to 17. by reading out the intpnd bits, the cpu can check for which message object an interrupt is pending. the intpnd bit of a specific message object can be set/reset by the cpu via the ifx message interface registers or by the message handler after reception or after a successful transmission of a frame. this w ill also affect the value of intpnd in the interrupt register. table 1040.can new data 2 register (nd2, address 0x400e 2124) bit description bit symbol description reset value access 15:0 newdat32_17 new data bits of message objects 32 to 17. 0 = no new data has been written into the data portion of this message object by the message handler since last time this flag was cleared by the cpu. 1 = the message handler or the cpu has written new data into the data portion of this message object. 0x00 r 31:16 - reserved - - table 1041.can interrupt pending 1 register (ir1, address 0x400e 2140) bit description bit symbol description reset value access 15:0 intpnd16_1 interrupt pending bits of message objects 16 to 1. 0 = this message object is ignored by the message handler. 1 = this message object is the source of an interrupt. 0x00 r 31:16 - reserved - - table 1042.can interrupt pending 2 register (ir2, addresses 0x400e 2144) bit description bit symbol description reset value access 15:0 intpnd32_17 interrupt pending bits of message objects 32 to 17. 0 = this message object is ignored by the message handler. 1 = this message object is the source of an interrupt. 0x00 r 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1102 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.6.3.7 can message valid 1 register this register contains the msgval bits of message objects 16 to 1. by reading out the msgval bits, the cpu can check which message object is valid. the msgval bit of a specific message object can be set/reset by the cpu via the ifx message interface registers. 42.10.6.3.8 can message valid 2 register this register contains the msgval bits of message objects 32 to 17. by reading out the msgval bits, the cpu can check which message object is valid. the msgval bit of a specific message object can be set/reset by the cpu via the ifx message interface registers. 42.10.6.4 can timing register 42.10.6.4.1 can clock divider register this register determines the can clock signal. the can_clk is derived from the peripheral clock pclk divided by the values in this register. table 1043.can message valid 1 register (msgv1, addresses 0x400e 2160) bit description bit symbol description reset value access 15:0 msgval16_1 message valid bits of message objects 16 to 1. 0 = this message object is ignored by the message handler. 1 = this message object is configured and should be considered by the message handler. 0x00 r 31:16 - reserved - - table 1044.can message valid 2 register (msgv2, address 0x400e 2164) bit description bit symbol description access reset value 15:0 msgval32_17 message valid bits of message objects 32 to 17. 0 = this message object is ignored by the message handler. 1 = this message object is configured and should be considered by the message handler. r0x00 31:16 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1103 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.7 functional description 42.10.7.1 c_can controller state after reset after a hardware reset, the registers hold the values described in table 904 . additionally, the busoff state is reset and the output can_txd is set to recessive (high). the value 0x0001 (init = ?1?) in the can control regist er enables the software initialization. the can controller does not communicate with th e can bus until the cpu resets init to ?0?. the data stored in the message ram is not affected by a hardware reset. after power-on, the contents of the message ram is undefined. 42.10.7.2 c_can operating modes 42.10.7.2.1 softwar e initialization the software initia lization is started by setting the bit init in the can control register, either by software or by a hardware reset, or by entering the busoff state. during software initialization (init bit is set), the following conditions are present: ? all message transfer from a nd to the can bus is stopped. ? the status of the can output can_txd is recessive (high). ? the eml counters are unchanged. ? the configuration registers are unchanged. ? access to the bit timing register and the br p extension register is enabled if the cce bit in the can control register is also set. to initialize the can controller, software has to set up the bit timing register and each message object. if a message object is not needed, it is sufficient to set its msgval bit to not valid. otherwise, the whole mess age object has to be initialized. table 1045.can clock divider register (c lkdiv, address 0x400e 2180) bit description bit symbol description reset value access 3:0 clkdivval clock divider value can_clk = pclk/(2 clkdivval -1 +1) 0000: can_clk = pclk divided by 1. 0001: can_clk = pclk divided by 2. 0010: can_clk = pclk divided by 3. 0010: can_clk = pclk divided by 4. 0011: can_clk = pclk divided by 5. 0100: can_clk = pclk divided by 9. 0101: can_clk = pclk divided by 17. ... 1111: can_clk = pclk divided by 1 6385. 0000 r/w 31:4 - reserved - - www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1104 of 1164 nxp semiconductors UM10430 chapter 42: appendix resetting the init bit finishes the software initialization. afterwards the bit stream processor bsp synchronizes itself to the data transfer on the can bus by waiting for the occurrence of a sequence of 11 consecutive re cessive bits (bus idle) before it can take part in bus activities and starts the message transfer. remark: the initialization of the message objects is independent of init and also can be done on the fly, but the message objects should all be configured to particular identifiers or set to not valid during so ftware initialization before the bsp starts the message transfer. to change the configuration of a message ob ject during normal operation, the cpu has to start by setting the msgval bit to not valid. when the configuration is completed, msagvalis set to valid again. 42.10.7.2.2 can message transfer once the can controller is initialized and init is reset to zero, the can core synchronizes itself to the can bus and starts the message transfer. received messages are stored into their appropriate message objects if they pass the message handler?s acceptance filtering. the whole message including all arbitration bits, dlc and eight data bytes is stored into the message object. if the identifier mask is used, the arbitration bits which are masked to ?don?t care? may be overwritten in the message object. the cpu may read or write each message any time via the interface registers. the message handler guarantees data consiste ncy in case of c oncurrent accesses. messages to be transmitted are updated by the cpu. if a permanent message object (arbitration and control bits set up during c onfiguration) exists for the message, only the data bytes are updated and then txrqut bit with newdat bit are set to start the transmission. if several transmit messages are assigned to the same message object (when the number of message objects is not sufficient), the whole message object has to be configured before the transmission of this message is requested. the transmission of any number of message objects may be requested at the same time, and they are transmitted subsequently according to their internal priority. messages may be updated or set to not valid any time, even when their r equested transmission is still pending. the old data will be discarded when a message is updated before its pending transmission has started. depending on the configuration of the message object, the transmission of a message may be requested autonomously by the reception of a remote frame with a matching identifier. 42.10.7.2.3 disabled auto matic retransmission (dar) according to the can specification (iso11898, 6.3.3 recovery management) , the can controller provides means for automatic retransmission of frames that have lost arbitration or that have been disturbed by errors during transmission. th e frame transmission service will not be confirmed to the us er before the transmission is successfully completed. by default, the automatic retransmission on lost arbitration or error is enabled. it can be disabled to enable the can controller to wo rk within a time triggered can (ttcan, see iso11898-1) environment. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1105 of 1164 nxp semiconductors UM10430 chapter 42: appendix the disable automatic retransmission mode is enabled by programming bit dar in the can control register to one. in this operat ion mode the programmer has to consider the different behavior of bits txrqst and newdat in the control registers of the message buffers: ? when a transmission starts, bit txrqst of the respective message buffer is reset while bit newdat remains set. ? when the transmission completed successfully, bit newdat is reset. ? when a transmission failed (lost arbitratio n or error), bit newdat remains set. to restart the transmission, the cpu has to set txrqst back to one. 42.10.7.2.4 test modes the test mode is entered by setting bit test in the can control register to one. in test mode the bits tx1, tx0, lback, silent, and basic in the test register are writable. bit rx monitors the state of pins rd0,1 and ther efore is only readable. all test register functions are disabled when bit test is reset to zero. silent mode: the can core can be set in silent mode by programming the test register bit silent to one. in silent mode, the can controller is able to receive valid data frames and valid remote frames, but it sends only recessive bits on the can bus, and it cannot start a transmission. if the can core is required to send a dominant bit (ack bit, overload flag, active error flag), the bit is rerouted internally so that the can core monitors this dominant bit, although the can bus may remain in recessive state. the silent mode can be used to analyze the traffic on a can bus without affecting it by the transmission of dominant bits (acknowledge bits, error frames). loop-back mode: the can core can be set in loop-back mode by programming the test register bit lback to one. in loop -back mode, the can core treats its own transmitted messages as received messages and stores them (if they pass acceptance filtering) into a receive buffer. this mode is provided for self-test functions. to be independent from external stimulation, the can core ignores acknowledge errors (rec essive bit sampled in the acknowledge slot of a data/remote frame) in loop-back mode. in this mode the can core performs an internal feedback from its can_txd output to its can_rxd input. the actual value of the can_rxd input pin is disregarded by the can core. the transmitted messages can be monitored at the can_txd pin. fig 172. can core in silent mode can core td0, td1 rd0, rd1 c_can = 1 rx tx www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1106 of 1164 nxp semiconductors UM10430 chapter 42: appendix loop-back mode combined with silent mode: it is also possible to combine loop-back mode and silent mode by programming bits lback and silent to one at the same time. this mode can be used for a ?hot selftest?, meaning the c_can can be tested without affecting a running can system connected to the pins can_txd and can_rxd. in this mode the can_rxd pin is disconnected from the can core and the can_txd pin is held recessive. basic mode: the can core can be set in basic mode by programming the test register bit basic to one. in this mode the can controller runs without the message ram. the if1 registers are used as transmit buffer . the transmission of the contents of the if1 registers is requested by writing the bu sy bit of the if1 command request register to ?1?. the if1 registers are locked while the busy bit is set. the busy bit indicates that the transmission is pending. as soon the can bus is idle, the if1 registers are loaded into the shift register of the can core and the transmission is started. when the transmission has completed, the busy bit is reset and the locked if1 registers are released. a pending transmission can be aborted at any time by resetting the busy bit in the if1 command request register while the if1 regi sters are locked. if the cpu has reset the busy bit, a possible retransmission in case of lo st arbitration or in case of an error is disabled. fig 173. can core in loop-back mode fig 174. can core in loop-back mo de combined with silent mode can core td0, td1 rd0, rd1 c_can rx tx can core td0, td1 rd0, rd1 c_can = 1 rx tx www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1107 of 1164 nxp semiconductors UM10430 chapter 42: appendix the if2 registers are used as receive buff er. after the reception of a message the contents of the shift register is stored in to the if2 registers, without any acceptance filtering. additionally, the actual contents of the shift register can be monitored during the message transfer. each time a read message object is initiated by writing the busy bit of the if2 command request register to ?1?, the contents of the shift register is stored into the if2 registers. in basic mode the evaluation of all message object related control and status bits and of the control bits of the ifx command mask registers is turned off. the message number of the command request registers is not evaluated. the newdat and msglst bits of the if2 message control regi ster retain their function, dlc3 -0 will show the received dlc, the other control bits will be read as ?0?. in basic mode the ready output can_wait_b is disabled (always ?1?) software control of pin can_txd: four output functions are available for the can transmit pin can_txd: 1. serial data output (default). 2. drives can sample point signal to monitor the can controller?s timing. 3. drives recessive constant value. 4. drives dominant constant value. the last two functions, combined with the readable can receive pin can_rxd, can be used to check the can bus? physical layer. the output mode of pin can_txd is selected by programming the test register bits tx1 and tx0 as described section 42.10.6.1.6 . remark: the three test functions for pin can_txd interfere with all can protocol functions. the can_txd pin must be left in its default function when can message transfer or any of the test modes loo-ba ck mode, silent mode, or basic mode are selected. 42.10.7.3 can message handler the message handler controls the data transfer between the rx/tx shift register of the can core, the message ram and the ifx registers, see figure 171 . the message handler controls the following functions: ? data transfer between ifx registers and the message ram ? data transfer from shift register to the message ram ? data transfer from mess age ram to shift register ? data transfer from shift register to the acceptance filtering unit ? scanning of message ram for a matching message object ? handling of txrqst flags ? handling of interrupts www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1108 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.7.3.1 management of message objects the configuration of the messa ge objects in the message ra m will (with the exception of the bits msgval, newdat, intpnd, and txrqst ) is not be affected by resetting the chip. all the message objects must be initialized by the cpu or they must be set to not valid (msgval = ?0?).the bit timing must be configured before the cpu clears the init bit in the can control register. the configuration of a message object is don e by programming mask, arbitration, control and data field of one of the two interface regist er sets to the desired values. by writing to the corresponding ifx command request register, the ifx message buffer registers are loaded into the addressed message object in the message ram. when the init bit in the can control regist er is cleared, the can protocol controller state machine of the can core and the message handler state machine control the can controller?s internal data flow. received messages that pass the acceptance filtering are stored into the message ram, and messages with pending transmission request are loaded into the can core?s shift regist er and are transmitted via the can bus. the cpu reads received messages and updates messages to be transmitted via the ifx interface registers. depending on the configur ation, the cpu is interrupted on certain can message and can error events. fig 175. block diagram of a message object transfer if1 mask1, 2 if1 arbitration 1/2 if1 message ctrl if1 data a1/2 if1 data b1/2 if2 mask1, 2 if2 arbitration 1/2 if2 message ctrl if2 data a1/2 if2 data b1/2 message ram message object 1 message object 2 . . . message object 32 transfer a message object read transfer write transfer apb bus message buffer registers if1 command request if1 command mask if2 command request if2 command mask interface command registers message handler transmission request 1/2 new data 1/2 interrupt pending1/2 message valid1/2 can bus receive transfer a can frame transmit can core/ shift registers www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1109 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.7.3.2 data transfer between ifx registers and the message ram when the cpu initiates a data transfer between the ifx registers and message ram, the message handler sets the busy bit in the respective command register to ?1?. after the transfer has completed, the busy bit is set back to ?0?. the command mask register spec ifies whether a complete message object or only parts of it will be transf erred. due to the st ructure of the message ram it is not possible to write single bits/bytes of one message object. software must always write a complete message object into the message ram. therefore the data transfer from the ifx registers to the message ram requires a read-modify-write cycle: 1. read the parts of the message object that are not to be changed from the message ram using the command mask register. ? after the partial read of a message object, the message buffer registers that are not selected in the command mask register will be left unchanged. 2. write the complete contents of the message buffer registers into the message object. ? after the partial write of a message object, the message buffer registers that are not selected in the command mask register will set to th e actual contents of the selected message object. 42.10.7.3.3 transmission of messages between the shift registers in the can core and the message buffer if the shift register of the can core cell is ready for loading and if ther e is no data transfer between the ifx registers and message ram, the msgval bits in the message valid register txrqst bits in the transmission request register are evaluated. the valid message object with the highest priority pendi ng transmission request is loaded into the shift register by the message handler and the transmission is started. the message object?s newdat bit is reset. after a successful transmission and if no ne w data was written to the message object (newdat = ?0?) since the start of the transmission, the txrq st bit will be reset. if txie is set, intpnd will be set afte r a successful transmission. if the can controller has lost the arbitration or if an er ror occurred during the trans mission, the message will be retransmitted as soon as the can bus is free again. if meanwhile the transmission of a message with higher priority has been requested, the messages will be transmitted in the order of their priority. 42.10.7.3.4 acceptance filtering of received messages when the arbitration and control field (identifier + ide + rtr + dlc) of an incoming message is comple tely shifted into the rx/tx shift register of the can core, the message handler state machine starts the scanning of the message ram for a matching valid message object. to scan the message ram for a matching me ssage object, the acceptance filtering unit is loaded with the arbitration bits from the ca n core shift register. then the arbitration and mask fields (including msgval, umask, ne wdat, and eob) of message object 1 are loaded into the acceptance filtering unit and compared with the arbitration field from the shift register. this is repeated with each following message object until a matching message object is found or until th e end of the message ram is reached. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1110 of 1164 nxp semiconductors UM10430 chapter 42: appendix if a match occurs, the scanning is stopped and the message handler state machine proceeds depending on the type of frame (data frame or remote frame) received. reception of a data frame: the message handler state machine stores the message from the can core shift register into the respective message object in the message ram. the data bytes, all arbitration bits, and the data length code are stored into the corresponding message object. this is implemented to keep the data bytes connected with the identifier even if arbitration mask registers are used. the newdat bit is set to indicate that new data (not yet seen by the cpu) has been received. the cpu/software should reset newdat when it reads the message object. if at the time of the reception the newdat bit was already set, msglst is set to indicate that the previous data (supposedly not seen by the cpu) is lost. if the rxie bit is set, the intpnd bit is also set, causing the interrupt register to point to this message object. the txrqst bit of this message object is reset to prevent the transmission of a remote frame, while the requested data frame has just been received. reception of a remote frame: when a remote frame is received, three different configurations of the matching mess age object have to be considered: 1. dir = ?1? (direction = transmit), rmten = ?1?, umask = ?1? or ?0? on the reception of a matching remote frame, the txrqst bit of this message object is set. the rest of the message object remains unchanged. 2. dir = ?1? (direction = transm it), rmten = ?0?, umask = ?0? on the reception of a matching remote frame, the txrqst bit of this message object remains unchanged; the remote frame is ignored. 3. dir = ?1? (direction = transm it), rmten = ?0?, umask = ?1? on the reception of a matching remote frame, the txrqst bit of this message object is reset. the arbitration and contro l field (identifier + ide + rtr + dlc) from the shift register is stored into the me ssage object in the message ram, and the newdat bit of this message object is set. the data field of the message object remains unchanged; the remote frame is treated similar to a received data frame. 42.10.7.3.5 receive/transmit priority the receive/transmit priority for the message objects is attached to the message number. message object 1 has the highest priority, while message object 32 has the lowest priority. if more than one transmission requ est is pending, they are serviced due to the priority of the corresponding message object. 42.10.7.3.6 configuration of a transmit object table 1046 shows how a transmit object should be initialized by software (see also table 1024 ): table 1046.initialization of a transmit object msgval arbitration bits data bits mask bits eob dir newdat 1 application dependent application dependent application dependent 110 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1111 of 1164 nxp semiconductors UM10430 chapter 42: appendix the arbitration registers (id28:0 and xtd bit) are given by the application. they define the identifier and the type of the outgoing message. if an 11-bit identifier (?standard frame?) is used, it is programmed to id28. in this case id18, id17 to id0 can be disregarded. if the txie bit is set, the in tpnd bit will be set after a su ccessful transmission of the message object. if the rmten bit is set, a matching received remote frame will cause the txrqst bit to be set, and the remo te frame will autonomously be answered by a data frame. the data registers (dlc3:0, data0:7) are given by the application. txrqst and rmten may not be set before the data is valid. the mask registers (msk28-0, umask, mxtd, and mdir bits) may be used (umask=?1?) to allow groups of remote frames with similar identifiers to set the txrqst bit. for details see section . the dir bit should not be masked. 42.10.7.3.7 updating a transmit object the cpu may update the data bytes of a transmit object any time via the ifx interface registers. neither msgval nor txrqst have to be reset before the update. even if only a part of the data bytes are to be updated, all four bytes of the corresponding ifx data a register or ifx data b register have to be valid before the content of that register is transferred to the message object . either the cpu has to write all four bytes into the ifx data register or the message obje ct is transferred to the ifx data register before the cpu writes the new data bytes. when only the (eight) data bytes are updated, first 0x0087 is written to the command mask register. then the number of the message object is written to the command request register, concurrently updati ng the data bytes and setting txrqst. to prevent the reset of txrqst at the end of a transmission that may already be in progress while the data is updated, newdat has to be set together with txrqst. for details see section 42.10.7.3.3 . when newdat is set together with txrqst , newdat will be reset as soon as the new transmission has started. 42.10.7.3.8 configuration of a receive object table 1047 shows how a receive object should be initialized by software (see also table 1024 ) msglst rxie txie intpnd rmten txrqst 0 0 application dependent 0 application dependent 0 table 1047.initialization of a receive object msgval arbitration bits data bits mask bits eob dir newdat 1 application dependent application dependent application dependent 100 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1112 of 1164 nxp semiconductors UM10430 chapter 42: appendix the arbitration registers (id28-0 and xtd bit) are given by the application. they define the identifier and type of accepted received me ssages. if an 11-bit identifier (?standard frame?) is used, it is programmed to id28 to id18. id17 to id0 can then be disregarded. when a data frame with an 11-bit identifier is received, id17 to id0 will be set to ?0?. if the rxie bit is set, the intpnd bit will be set when a received data frame is accepted and stored in the message object. the data length code (dlc[3:0] is given by the application. when the message handler stores a data frame in the message object, it will store the receiv ed data length code and eight data bytes. if the data length code is less than 8, the remaining bytes of the message object will be overwritten by no n specified values. the mask registers (msk[28:0], umask, mxtd, and mdir bits) may be used (umask=?1?) to allow groups of data frames with similar identifiers to be accepted. for details see section section . the dir bit should not be masked in typical applications. 42.10.7.3.9 handling of received messages the cpu may read a received message any time via the ifx interface registers. the data consistency is guaranteed by the message handler state machine. to transfer the entire received message from message ram into the message buffer, software must write first 0x007f to the command mask register and then the number of the message object to the command request register. additionally, the bits newdat and intpnd are cleared in the message ram (not in the message buffer). if the message object uses masks for acceptance filtering, the arbitration bits show which of the matching messages has been received. the actual value of newdat shows whether a new message has been received since last time this message object was read. the actual value of msglst shows whether more than one message has been received since last time this message object was read. msglst will not be automatically reset. using a remote frame, the cpu may request another can node to provide new data for a receive object. setting the txrqst bit of a receive object will caus e the transm ission of a remote frame with the receive object?s identifier. this remote frame triggers the other can node to start the transmission of the matching data frame. if the matching data frame is received before the remote frame could be transmitted, the txrqst bit is automatically reset. 42.10.7.3.10 configurat ion of a fifo buffer with the exception of the eob bit, the conf iguration of receive objects belonging to a fifo buffer is the same as the configuratio n of a (single) receive object, see section section 42.10.7.3.8 . to concatenate two or more message objects into a fifo buffer, the identifiers and masks (if used) of these message objects have to be programmed to matching values. due to the implicit pr iority of the message objects, the message object with the lowest msglst rxie txie intpnd rmten txrqst 0 application dependent 000 0 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1113 of 1164 nxp semiconductors UM10430 chapter 42: appendix number will be the first message object of th e fifo buffer. the eob bit of all message objects of a fifo buffer except the last have to be programmed to zero. the eob bits of the last message object of a fifo buffer is se t to one, configuring it as the end of the block. reception of messages with fifo buffers: received messages with identifiers matching to a fifo buffer are stored into a me ssage object of this fifo buffer starting with the message object with the lowest message number. when a message is stored into a message object of a fifo buffer the newdat bit of this message object is set. by setting newdat while eob is zero the message object is locked for further write accesses by the message handler until the cpu has written the newdat bit back to zero. messages are stored into a fifo buffer until the last message object of this fifo buffer is reached. if none of the preceding message objects is released by writing newdat to zero, all further me ssages for this fifo buffer will be wr itten into the last message object of the fifo buffer and therefore overwrite previous messages. reading from a fifo buffer: when the cpu transfers the contents of message object to the ifx message buffer registers by writing its number to the ifx command request register, bits newdat and intpnd in the corresponding command mask register should be reset to zero (txrqst/newdat = ?1? and clrintpnd = ?1?). the values of these bits in the message control register always reflect the status before resetting the bits. to assure the correct function of a fifo buffer, the cpu should read out the message objects starting at the fifo object with the lowest message number. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1114 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.7.4 interrupt handling if several interrupts are pending, the can inte rrupt register will po int to the pending interrupt with the highest prio rity, disregarding their chronological order. an interrupt remains pending until the cpu has cleared it. fig 176. reading a message from the fifo buffer to the message buffer start end read canir messagenum = intid read canifx_mctrl write messagenum to canifx_cmdreq read data from canifx_da/b messagenum = messagenum +1 read message to message buffer reset newdat = 0 reset intpnd = 0 intid = 0x8000 ? newdat = 1 eob = 1 intid = 0x0001 to 0x0020 ? intid = 0x0000 ? status change interrupt handling yes yes yes yes no no yes www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1115 of 1164 nxp semiconductors UM10430 chapter 42: appendix the status interrupt has the highest priority . among the message interrupts, the message object?s interrupt priority decrea ses with increasing message number. a message interrupt is cleared by clearing the message object?s intpnd bit. the status interrupt is cleared by reading the status register. the interrupt identifier intid in the interrupt register indicates the cause of the interrupt. when no interrupt is p ending, the register w ill hold the value zero. if the value of the interrupt register is different fr om zero, then there is an interr upt pending and, if ie is set, the interrupt line to the cpu, irq_b, is acti ve. the interrupt line re mains active until the interrupt register is ba ck to value zero (the cause of the in terrupt is reset) or until ie is reset. the value 0x8000 indicates that an interrupt is pending because the can core has updated (not necessarily changed) the status re gister (error interrupt or status interrupt). this interrupt has the highest priority. the cpu can update (reset) the status bits rxok, txok and lec, but a write access of the cpu to the status register can never generate or reset an interrupt. all other values indicate that the source of the interrupt is one of the message objects where intid points to the pending message interrupt with the highest interrupt priority. the cpu controls whether a change of the status register may cause an interrupt (bits eie and sie in the can control register) and whether the interrupt line becomes active when the interrupt register is different from ze ro (bit ie in the can control register). the interrupt register will be updated even when ie is reset. the cpu has two possibilities to follow the source of a message interrupt: ? software can follow the intid in the interrupt register. ? software can poll the interrupt pending register. an interrupt service routine reading the message that is the source of the interrupt may read the message and reset the message object?s intpnd at the same time (bit clrintpnd in the command mask register). when intpnd is cleared, the interrupt register will point to the next messag e object with a pending in terrupt. 42.10.7.5 bit timing even if minor errors in the c onfiguration of the can bit timing do not result in immediate failure, the performance of a can network can be reduced significantly. in many cases, the can bit synchronization will amend a faulty configuration of the can bit timing to such a degree that only occasionally an error fr ame is generated. in the case of arbitration however, when two or more can nodes simu ltaneously try to transmit a frame, a misplaced sample point may cause one of the transmitters to become error passive. the analysis of such sporadic errors re quires a detailed knowledge of the can bit synchronization inside a can node and of the can nodes? interaction on the can bus. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1116 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.10.7.5.1 bit time and bit rate can supports bit rates in the range of lower than 1 kbit/s up to 1000 kbit/s. each member of the can network has its own clock generat or, usually a quartz oscillator. the timing parameter of the bit time (i.e. the reciprocal of the bit rate) can be configured individually for each can node, creating a common bit ra te even though the can nodes? oscillator periods (f osc ) may be different. the frequencies of these oscilla tors are not absolu tely stable, as small variations are caused by changes in temperature or voltage and by deteriorating components. as long as the variations remain insi de a specific oscillator tolera nce range (df), the can nodes are able to compensate for the different bit rates by re-synchronizing to the bit stream. according to the can specification, the bi t time is divided into four segments ( figure 177 ). the synchronization segment, the propag ation time segment, the phase buffer segment 1, and the phase buffer segment 2. each segment consists of a specific, programmable number of time quanta (see table 1048 ). the length of the time quantum (t q ), which is the basic time unit of the bit ti me, is defined by the can controller?s system clock f and the baud rate prescaler (brp): t q = brp / f sys . the c_can?s system clock f sys is the frequency c_can peripheral clock. the synchronization segment sync_seg is the part of the bit time where edges of the can bus level are expected to occur; the distance between an edge that occurs outside of sync_seg and the sync_seg is called the phase error of that edge. the propagation time segment prop_seg is intended to comp ensate for the physica l delay times within the can network. the phase buffer segments phase_seg1 and phase_seg2 surround the sample point. the (re-)synchroniza tion jump width (sjw) defines how far a re-synchronization may move the sample point inside the limits defined by the phase buffer segments to compensate for edge phase errors. table 1048 describes the minimum programmable r anges required by the can protocol. bit time parameters are programmed through the bt register, ta b l e 1 0 1 9 . for details on bit timing and examples, see the c_can user?s manual, revision 1.2 . table 1048.parameters of the c_can bit time parameter range function brp (1...32) defines the length of the time quantum t q . sync_seg 1t q synchronization segment. fixed length. synchronization of bus input to system clock. prop_seg (1...8) ? t q propagation time segment. compensates for physical delay times. this parameter is determined by the system delay times in the c_can network. tseg1 (1...8) ? t q phase buffer segment 1. may be lengthened temporarily by synchronization. tseg2 (1...8) ? t q phase buffer segment 2. may be shortened temporarily by synchronization. sjw (1...4) ? t q (re-) synchronization jump width. may not be longer than either phase buffer segment. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1117 of 1164 nxp semiconductors UM10430 chapter 42: appendix 42.11 lpc1850/30/20/10 r ev ?-? sct interconnections 42.11.1 input muxing for state conf igurable timer and general purpose timers fig 177. bit timing (1) see figure 179 . fig 178. sct/general purpose timers cross connections timer0 inp0 outp0 outp1 outp2 outp3 outp4 outp5 outp6 outp7 outp8 outp9 outp10 outp11 outp12 outp13 outp14 outp15 inp1 inp2 inp3 inp4 inp5 inp6 inp7 inp0 outp0 outp1 outp2 outp3 inp1 inp2 inp3 timer1 inp0 outp0 outp1 outp2 outp3 inp1 inp2 inp3 timer2 inp0 outp0 outp1 outp2 outp3 inp1 inp2 inp3 timer3 inp0 outp0 outp1 outp2 outp3 inp1 inp2 inp3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 15 14 0 1 2 3 4 5 6 7 8 9 10 11 12 13 15 14 7 11 15 3 outp ctin_0 ctin_2 inp1 inp3 inp4 inp5 inp6 inp7 combined timers (1) combined timers (1) combined timers (1) combined timers (1) combined timers (1) combined timers (1) sct www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1118 of 1164 nxp semiconductors UM10430 chapter 42: appendix fig 179. input muxing for sct and general purpose timers rx_mws tx_mws sof_vf_indicator sof_vf_indicator outp15 outp8 mcoa2 outp2 outp6 outp14 inp3 inp4 inp1 inp5 inp6 inp7 usart0 tx usart0 rx usart2 tx usart2 rx usart3 tx usart3 rx ctin_3 ctin_4 ctin_1 ctin_5 ctin_6 start conversion triggers adctrig0 adctrig1 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1119 of 1164 43.1 abbreviations UM10430 chapter 43: supplementary information rev. 00.13 ? 20 july 2011 user manual table 1049.abbreviations acronym description adc analog-to-digital converter aes advanced encryption standard ahb advanced high-performance bus apb advanced peripheral bus api application programming interface bod brownout detection can controller area network cmac cipher-based message authentication code csma/cd carrier sense multiple access with collision detection dac digital-to-analog converter dc-dc direct current-to-direct current dma direct memory access gpio general purpose input/output irc internal rc irda infrared data association jtag joint test action group lcd liquid crystal display lsb least significant bit mac media access control mcu microcontroller unit miim media independent interface management n.c. not connected ohci open host controller interface otg on-the-go phy physical layer pll phase-locked loop pmc power mode control pwm pulse width modulator rit repetitive interrupt timer rmii reduced media independent interface sdram synchronous dynami c random access memory simd single instruction multiple data spi serial peripheral interface ssi serial synchronous interface ssp synchronous serial port tcp/ip transmission control protocol/internet protocol www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1120 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information ttl transistor-transistor logic uart universal asynchronous receiver/transmitter ulpi utmi+ low pin interface usart universal synchronous asynchronous receiver/transmitter usb universal serial bus utmi usb2.0 transceiver macrocell interface table 1049.abbreviations ?continued acronym description www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1121 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 43.2 legal information 43.2.1 definitions draft ? the document is a draft versi on only. the content is still under internal review and subject to formal approval, which may result in modifications or additions. nxp semiconductors does not give any representations or warranties as to the accuracy or completeness of information included herein and shall hav e no liability for the consequences of use of such information. 43.2.2 disclaimers limited warranty and liability ? information in this document is believed to be accurate and reliable. however, nxp semiconductors does not give any representations or warranties, expressed or implied, as to the accuracy or completeness of such information and shall have no liability for the consequences of use of such information. in no event shall nxp semiconductors be liable for any indirect, incidental, punitive, special or consequential damages (including - without limitation - lost profits, lost savings, business interrupt ion, costs related to the removal or replacement of any products or rework charges) whether or not such damages are based on tort (including negligence), warranty, breach of contract or any other legal theory. notwithstanding any damages that customer might incur for any reason whatsoever, nxp semiconductors? aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the terms and conditions of commercial sale of nxp semiconductors. right to make changes ? nxp semiconductors reserves the right to make changes to information published in this document, including without limitation specifications and product descriptions, at any time and without notice. this document supersedes and replaces all information supplied prior to the publication hereof. suitability for use ? nxp semiconductors products are not designed, authorized or warranted to be suitable for use in life support, life-critical or safety-critical systems or equipment, nor in applications where failure or malfunction of an nxp semiconductors product can reasonably be expected to result in personal injury, death or severe property or environmental damage. nxp semiconductors accepts no liability for inclusion and/or use of nxp semiconductors products in su ch equipment or applications and therefore such inclusion and/or use is at the customer?s own risk. applications ? applications that are described herein for any of these products are for illustrative purpos es only. nxp semiconductors makes no representation or warranty that such applications will be suitable for the specified use without further testing or modification. customers are responsible for the design and operation of their applications and products using nxp semiconducto rs products, and nxp semiconductors accepts no liability for any assistance wi th applications or customer product design. it is customer?s sole responsibility to determine whether the nxp semiconductors product is suitable and fit for the customer?s applications and products planned, as well as fo r the planned application and use of customer?s third party customer(s). customers should provide appropriate design and operating safeguards to minimize the risks associated with their applications and products. nxp semiconductors does not accept any liability related to any default, damage, costs or problem which is based on any weakness or default in the customer?s applications or products, or the application or use by customer?s third party customer(s). customer is responsible for doing all necessary testing for the customer?s applic ations and products using nxp semiconductors products in order to av oid a default of the applications and the products or of the application or use by customer?s third party customer(s). nxp does not accept any liability in this respect. export control ? this document as well as the item(s) described herein may be subject to export control regulations. export might require a prior authorization from national authorities. evaluation products ? this product is provided on an ?as is? and ?with all faults? basis for evaluati on purposes only. nxp semico nductors, its affiliates and their suppliers expressly disclaim all warranties, whether express, implied or statutory, including but not limited to the implied warranties of non-infringement, merchantability and fitness for a particular purpose. the entire risk as to the quality, or arising out of the use or performance, of this product remains with customer. in no event shall nxp semiconductors, its affiliates or their suppliers be liable to customer for any special, indirect, consequential, punitive or incidental damages (including without limitation damages for loss of business, business interruption, loss of use, loss of data or information, and the like) arising out the use of or inability to use the product, whether or not based on tort (including negligence), strict liability, breach of contract, breach of warranty or any other theory, even if advised of the possibility of such damages. notwithstanding any damages that customer might incur for any reason whatsoever (including without limitat ion, all damages referenced above and all direct or general damages), the entire liability of nxp semiconductors, its affiliates and their suppliers and custom er?s exclusive remedy for all of the foregoing shall be limited to actual damages incurred by customer based on reasonable reliance up to the greater of the amount actually paid by customer for the product or five dollars (us$5.00) . the foregoing limitations, exclusions and disclaimers shall apply to the ma ximum extent permitted by applicable law, even if any remedy fails of its essential purpose. 43.2.3 trademarks notice: all referenced brands, produc t names, service names and trademarks are the property of their respective owners. i 2 c-bus ? logo is a trademark of nxp b.v. www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1122 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 43.3 tables table 1. ordering information . . . . . . . . . . . . . . . . . . . . .7 table 2. ordering options . . . . . . . . . . . . . . . . . . . . . . . . .7 table 3. ordering information (parts with on-chip flash). .8 table 4. ordering options (parts with on-chip flash) . . . . .8 table 5. lpc185x/3x/2x/1x sram configuration . . . . . .15 table 6. lpc185x/3x/2x/1x flash configuration . . . . . . .15 table 7. boot mode when otp boot_src bits are programmed . . . . . . . . . . . . . . . . . . . . . . . . . . .23 table 8. boot mode when opt boot_src bits are zero. 23 table 9. image header . . . . . . . . . . . . . . . . . . . . . . . . . .26 table 10. boot process timing parameters . . . . . . . . . . . .31 table 11. security api calls . . . . . . . . . . . . . . . . . . . . . . .34 table 12. nvic pin description . . . . . . . . . . . . . . . . . . . . .36 table 13. connection of interrupt sources to the nvic . .37 table 14. register overview: nvic (base address 0xe000 e000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 table 15. event router clocking and power control. . . . . .40 table 16. event router inputs . . . . . . . . . . . . . . . . . . . . . .41 table 17. event router pin description . . . . . . . . . . . . . . .41 table 18. register overview: event router (base address 0x4004 4000) . . . . . . . . . . . . . . . . . . . . . . . . . .42 table 19. level configuration register (hilo - address 0x4004 4000) bit description . . . . . . . . . . . . .42 table 20. edge and hilo combined register settings . .44 table 21. edge configuration register (edge - address 0x4004 4004) bit description . . . . . . . . . . . . .45 table 22. interrupt clear enable register (clr_en - address 0x4004 4fd8) bit description . . . . . . . . . . . . . .47 table 23. event set enable register (set_en - address 0x4004 4fdc) bit description . . . . . . . . . . . . . .48 table 24. interrupt status register (status - address 0x4004 4fe0) bit description . . . . . . . . . . . . . .49 table 25. event enable register (enable - address 0x4004 4fe4) bit description. . . . . . . . . . . . . . . . . . . . .50 table 26. interrupt clear status register (clr_stat - address 0x4004 4fe8) bit description . . . . . . .51 table 27. interrupt set status register (set_stat - address 0x4004 4fec) bit description . . . . . . . . . . . . . .52 table 28. creg clocking and power control . . . . . . . . . .54 table 29. register overview: configuration registers (base address 0x4004 3000) . . . . . . . . . . . . . . . . . . .55 table 30. irc trim register (irctrm, address 0x4004 3000) bit description . . . . . . . . . . . . . . . . . . . .55 table 31. creg0 register (creg0, address 0x4004 3004) bit description . . . . . . . . . . . . . . . . . . . . . . . . .56 table 32. power mode control register (pmucon, address 0x4004 3008) bit description . . . . . . . . . . . . .57 table 33. memory mapping register (m3memmap, address 0x4004 3100) bit description . . . . . . . . . . . . .57 table 34. creg5 control register (creg5, address 0x4004 3118) bit description . . . . . . . . . . . . . . . . . . . .57 table 35. dma muxing register (dmamux, address 0x4004 311c) bit description . . . . . . . . . . . . . . . . . . . .57 table 36. etb sram configuration register (etbcfg, address 0x4004 3128) bit description . . . . . . .60 table 37. creg6 control register (creg6, address 0x4004 312c) bit description . . . . . . . . . . . . . . . . . . . 60 table 38. part id register (chipid, address 0x4004 3200) bit description . . . . . . . . . . . . . . . . . . . . . . . . . 61 table 39. register overview: power mode controller (pmc) (base address 0x4004 2000) . . . . . . . . . . . . . . 64 table 40. hardware sleep event enable register (pd0_sleep0_hw_ena - address 0x4004 2000) bit description . . . . . . . . . . . . . . 64 table 41. sleep power mode register (pd0_sleep0_mode - address 0x4004 201c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . 64 table 42. typical settings for pmc power modes . . . . . . 65 table 43. cgu clocking and power control . . . . . . . . . . . 66 table 44. cgu0 base clocks . . . . . . . . . . . . . . . . . . . . . 68 table 45. available clock sources for clock generators with selectable inputs . . . . . . . . . . . . . . . . . . . . . . 69 table 46. clock sources for output stages. . . . . . . . . . . . 69 table 47. cgu pin description. . . . . . . . . . . . . . . . . . . . . 71 table 48. register overview: cgu (base address 0x4005 0000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 table 49. freq_mon register (freq_mon, address 0x4005 0014) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 table 50. xtal_osc_ctrl register (xtal_osc_ctrl, address 0x4005 0018) bit description . . . . . . . 74 table 51. pll0usb status register (pll0usb_stat, address 0x4005 001c) bit description . . . . . . 75 table 52. pll0usb control register (pll0usb_ctrl, address 0x4005 0020) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 table 53. pll0usb m-divider register (pll0usb_mdiv, address 0x4005 0024) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 table 54. pll0usb np-divider register (pll0usb_np_div, address 0x4005 0028) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 table 55. pll0audio status register (pll0audio_stat, address 0x4005 002c) bit description . . . . . . 77 table 56. pll0audio control register (pll0audio_ctrl, address 0x4005 0030) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 table 57. pll0audio m-divider register (pll0audio_mdiv, address 0x4005 0034) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 table 58. pll0 audio np-divider register (pll0audio_np_div, address 0x4005 0038) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 table 59. pll0audio fractional divider register (pll0audio_frac, address 0x4005 003c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 table 60. pll1 status register (pll1_stat, address www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1123 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 0x4005 0040) bit description . . . . . . . . . . . . . .79 table 61. pll1_ctrl register (pll1_ctrl, address 0x4005 0044) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 table 62. idiva control register (idiva_ctrl, address 0x4005 0048) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 table 63. idivb/c/d control registers (idivb_ctrl, address 0x4005 004c; idivc_ctrl, address 0x4005 0050; idivc_ctrl, address 0x4005 0054) bit description . . . . . . . . . . . . . . . . . . . .82 table 64. idive control register (idive_ctrl, address 0x4005 0058) bit description . . . . . . . . . . . . .83 table 65. output stage 0 control register (outclk_0_ctrl, address 0x4005 005c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .84 table 66. output stage 1 control register (outclk_1_ctrl, address 0x4005 0060) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .85 table 67. output stage 3 control register (outclk_3_ctrl, address 0x4005 0068) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .85 table 68. output stage 4 to 19 control registers (outclk_4_ctrl to outclk_19_ctrl, address 0x4005 006c to 0x4005 00a8) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .86 table 69. output stage 20 control register (outclk_20_ctrl, addresses 0x4005 00ac) bit description . . . . . . . . . . . . . . . . . . . . . . . . .87 table 70. output stage 25 control register (outclk_25_ctrl, addresses 0x4005 00c0) bit description . . . . . . . . . . . . . . . . . . . . . . . . .88 table 71. output stage 26 to 27 control register (outclk_26_ctrl to outclk_27_ctrl, addresses 0x4005 00c4 to 0x4005 00c8) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .89 table 72. pll operating modes . . . . . . . . . . . . . . . . . . .92 table 73. directl and directo bit settings in hp0/1_mode register . . . . . . . . . . . . . . . . . . . .92 table 74. system pll divider ratio settings for 12 mhz. .94 table 75. ccu clocking and power control . . . . . . . . . . .99 table 76. ccu1 branch clocks . . . . . . . . . . . . . . . . . . . . .99 table 77. ccu2 branch clocks . . . . . . . . . . . . . . . . . . . .101 table 78. register overview: ccu1 (base address 0x4005 1000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102 table 79. register overview: ccu2 (base address 0x4005 2000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 table 80. ccu1/2 power mode register (ccu1_pm, address 0x4005 1000 and ccu2_pm, address 0x4005 2000) bit description . . . . . . . . . . . . .106 table 81. ccu1 base clock status register (ccu1_base_stat, addre ss 0x4005 1004) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .106 table 82. ccu2 base clock status register (ccu2_base_stat, addre ss 0x4005 2004) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .107 table 83. ccu1 branch clock configuration register (clk_xxx_cfg, addresses 0x4005 1100, 0x4005 1104,..., 0x4005 1a00) bit description . . 108 table 84. ccu1 branch clock configuration register (clk_emcdiv_cfg, addresses 0x4005 1478) bit description . . . . . . . . . . . . . . . . . . . . . . . . 108 table 85. ccu2 branch clock configuration register (clk_xxx_cfg, addresses 0x4005 2100, 0x4005 2200,..., 0x4005 2800) bit description . . 109 table 86. ccu1 branch clock status register (clk_xxx_stat, addresses 0x4005 1104, 0x4005 110c,..., 0x4005 1a04) bit description . . 109 table 87. ccu2 branch clock status register (clk_xxx_stat, addresses 0x4005 2104, 0x4005 2204,..., 0x4005 2804) bit description . . 110 table 88. rgu clocking and power control . . . . . . . . . . 111 table 89. reset output configuration . . . . . . . . . . . . . . 112 table 90. reset priority . . . . . . . . . . . . . . . . . . . . . . . . . 114 table 91. register overview: rgu (base address: 0x4005 3000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 table 92. reset control regi ster 0 (reset_ctrl0, address 0x4005 3100) bit description . . . . . . . . . . . . 118 table 93. reset control regi ster 1 (reset_ctrl1, address 0x4005 3104) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 table 94. reset status re gister 0 (reset_status0, address 0x4005 3110) bit description . . . . . . 121 table 95. reset status re gister 1 (reset_status1, address 0x4005 3114) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 table 96. reset status re gister 2 (reset_status2, address 0x4005 3118) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 table 97. reset status re gister 3 (reset_status3, address 0x4005 311c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 table 98. reset active status register 0 (reset_active_status0, address 0x4005 3150) bit description . . . . . . . . . . . . . . . . . . . 127 table 99. reset active status register 1 (reset_active_status1, address 0x4005 3154) bit description . . . . . . . . . . . . . . . . . . . 129 table 100. reset external status register 0 (reset_ext_stat0, address 0x4005 3400) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 131 table 101. reset external status register 1 (reset_ext_stat1, address 0x4005 3404) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 132 table 102. reset external status register 2 (reset_ext_stat2, address 0x4005 3408) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 132 table 103. reset external status register 4 (reset_ext_stat4, address 0x4005 3410) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 132 table 104. reset external status register 5 (reset_ext_stat5, address 0x4005 3414) bit www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1124 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information description . . . . . . . . . . . . . . . . . . . . . . . . . .132 table 105. reset external status registers x (reset_ext_statx, address 0x4005 34xx) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .133 table 106. reset external status registers y (reset_ext_staty, address 0x4005 34yy) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .133 table 107. pin description . . . . . . . . . . . . . . . . . . . . . . .135 table 108. scu clocking and power control . . . . . . . . . .185 table 109. pin multiplexing . . . . . . . . . . . . . . . . . . . . . . .187 table 110. register overview: system control unit (scu) (base address 0x4008 6000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .198 table 111. pin configuration for normal drive pins p0_n to pf_n and clk0 to clk3 registers (sfs, address 0x4008 6000 (spsp0_0) to 0x4008 6c0c (sfsclk3)) bit description . . . . . . . . . . . . . .205 table 112. pin configuration for high drive pins p0_n to pf_n and clk0 to clk3 registers (sfs, address 0x4008 6000 (sfsp0_0) to 0x4008 6c0c (sfsclk3) bit description . . . . . . . . . . . . . .206 table 113. pins controlled by the enaio0 register . . . . .207 table 114. adc0 function select register (enaio0, address 0x4008 6c88) bit description . . . . . . . . . . . .207 table 115. pins controlled by the enaio1 register . . . . .208 table 116. adc1 function select register (enaio1, address 0x4008 6c8c) bit description . . . . . . . . . . . .208 table 117. pins controlled by the enaio2 register . . . . .209 table 118. analog function select register (enaio2, address 0x4008 6c90) bit description . . . . . . . . . . . .210 table 119. pin configuration for pins dp1/dm1 register (sfsusb, address 0x4008 6c80) bit description 210 table 120. pin configuration for open-drain i 2 c-bus pins register (sfsi2c0, address 0x4008 6c84) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .210 table 121. emc clock delay register (emcclkdelay, address 0x4008 6d00) bit description . . . . . 211 table 122. emc control delay register (emcctrldelay, address 0x4008 6d04) bit description . . . . .212 table 123. emc chip select delay register (emccsdelay, address 0x4008 6d08) bit description . . . . .212 table 124. emc data out delay register (emcdoutdelay, address 0x4008 6d0c) bit description . . . . .213 table 125. emc dqm delay register (emcfbclkdelay, address 0x4008 6d10) bit description . . . . .214 table 126. emc address delay register 0 (emcaddrdelay0, address 0x4008 6d14) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .214 table 127. emc address delay register 1 (emcaddrdelay1, address 0x4008 6d18) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .215 table 128. emc address delay register 2 (emcaddrdelay2, address 0x4008 6d1c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .215 table 129. emc data in delay register 3 (emcdindelay, address 0x4008 6d24) bit description . . . . .216 table 130. pin interrupt select register 0 (pintsel0, address 0x4008 6e00) bit description . . . . . . 217 table 131. pin interrupt select register 1 (pintsel1, address 0x4008 6e04) bit description . . . . . . 218 table 132. gima clocking and power control . . . . . . . . . 220 table 133. gima inputs . . . . . . . . . . . . . . . . . . . . . . . . . 220 table 134. register overview: gima (base address: 0x400c 7000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 table 135. timer 0 cap0_0 capture input multiplexer (cap0_0_in, address 0x400c 7000) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 table 136. timer 0 cap0_1 capture input multiplexer (cap0_1_in, address 0x400c 7004) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 table 137. timer 0 cap0_2 capture input multiplexer (cap0_2_in, address 0x400c 7008) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 table 138. timer 0 cap0_3 capture input multiplexer (cap0_3_in, address 0x400c 700c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 table 139. timer 1 cap1_0 capture input multiplexer (cap1_0_in, address 0x400c 7010) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 table 140. timer 1 cap1_1 capture input multiplexer (cap1_1_in, address 0x400c 7014) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 table 141. timer 1 cap1_2 capture input multiplexer (cap1_2_in, address 0x400c 7018) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 table 142. timer 1 cap1_3 capture input multiplexer (cap1_3_in, address 0x400c 701c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 table 143. timer 2 cap2_0 capture input multiplexer (cap2_0_in, address 0x400c 7020) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 table 144. timer 2 cap2_1 capture input multiplexer (cap2_1_in, address 0x400c 7024) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 table 145. timer 2 cap2_2 capture input multiplexer (cap2_2_in, address 0x400c 7028) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 table 146. timer 2 cap2_3 capture input multiplexer (cap2_3_in, address 0x400c 702c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 table 147. timer 3 cap3_0 capture input multiplexer (cap3_0_in, address 0x400c 7030) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 table 148. timer 3 cap3_1 capture input multiplexer (cap3_1_in, address 0x400c 7034) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 table 149. timer 3 cap3_2 capture input multiplexer (cap3_2_in, address 0x400c 7038) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 table 150. timer 3 cap3_3 capture input multiplexer (cap3_3_in, address 0x400c 703c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 table 151. sct ctin_0 capture input multiplexer (ctin_0_in, address 0x400c 7040) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1125 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 152. sct ctin_1 capture input multiplexer (ctin_1_in, address 0x400c 7044) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .237 table 153. sct ctin_2 capture input multiplexer (ctin_2_in, address 0x400c 7048) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .237 table 154. sct ctin_3 capture input multiplexer (ctin_3_in, address 0x400c 704c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .238 table 155. sct ctin_4 capture input multiplexer (ctin_4_in, address 0x400c 7050) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .238 table 156. sct ctin_5 capture input multiplexer (ctin_5_in, address 0x400c 7054) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .239 table 157. sct ctin_6 capture input multiplexer (ctin_6_in, address 0x400c 7058) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .240 table 158. sct ctin_7 capture input multiplexer (ctin_7_in, address 0x400c 705c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .240 table 159. adc trigger input multiplexer (vadc_trigger_in, address 0x400c 7060) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .241 table 160. event router input 13 multiplexer (eventrouter_13_in, address 0x400c 7064) bit description . . . . . . . . . . . . . . . . . . . . . . . . .241 table 161. event router input 14 multiplexer (eventrouter_14_in, address 0x400c 7068) bit description . . . . . . . . . . . . . . . . . . . . . . . . .242 table 162. event router input 16multiplexer (eventrouter_16_in, a ddress 0x400c 706c) bit description . . . . . . . . . . . . . . . . . . . . . . . . .243 table 163. adc start0 input multiplexer (adcstart0_in, address 0x400c 7070) bit description . . . . . .243 table 164. adc start1 input multiplexer (adcstart1_in, address 0x400c 7074) bit description . . . . . .244 table 165. gpio pins available . . . . . . . . . . . . . . . . . . . .245 table 166. gpio clocking and power control . . . . . . . . .245 table 167. register overview: gpio pin interrupts (base address: 0x4008 7000) . . . . . . . . . . . . . . . . . .248 table 168. register overview: gpio group0 interrupt (base address 0x4008 8000) . . . . . . . . . . . . .248 table 169. register overview: gpio group1 interrupt (base address 0x4008 9000) . . . . . . . . . . . . .249 table 170. register overview: gpio port (base address 0x400f 4000) . . . . . . . . . . . . . . . . . . . . . . . . .250 table 171. pin interrupt mode register (isel, address 0x4008 7000) bit description . . . . . . . . . . . . .252 table 172. pin interrupt level (rising edge interrupt enable) register (ienr, address 0x4008 7004) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .252 table 173. pin interrupt level (rising edge interrupt) set register (sienr, address 0x4008 7008) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .253 table 174. pin interrupt level (rising edge interrupt) clear register (pcienr, address 0x4008 700c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .253 table 175. pin interrupt active level (falling edge interrupt enable) register (ienf, address 0x4008 7010) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 table 176. pin interrupt active level (falling edge interrupt) set register (sienf, address 0x4008 7014) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 table 177. pin interrupt active level (falling edge interrupt) clear register (cienf, address 0x4008 7018) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 table 178. pin interrupt rising edge register (rise, address 0x4008 701c) bit description . . . . . . . . . . . . 255 table 179. pin interrupt falling edge register (fall, address 0x4008 7020) bit description . . . . . . . . . . . . . 255 table 180. pin interrupt status register (ist address 0x4008 7024) bit description . . . . . . . . . . . . . . . . . . . 256 table 181. gpio grouped interrupt control register (ctrl, addresses 0x4008 8000 (group0 int) and 0x4008 9000 (group1 int)) bit description 256 table 182. gpio grouped interrupt port polarity registers (port_pol, addresses 0x4008 8020 (port_pol0) to 0x4008 803c (port_pol7) (group0 int) and 0x4008 9020 (port_pol0) to 0x4008 903c (port_pol7) (group1 int)) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 257 table 183. gpio grouped interrupt port n enable registers (port_ena, addresses 0x4008 8040 (port_ena0) to 0x4008 805c (port_ena7) (group0 int) and 0x4008 9040 (port_ena0) to 0x4008 905c (port_ena7) (group1 int)) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 257 table 184. gpio port byte pin registers (b, addresses 0x400f 4000 (b0) to 0x400f 00fc (b255)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 table 185. gpio port word pin registers (w, addresses 0x400f 5000 (w0) to 0x400f 13fc (w255)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 table 186. gpio port direction register (dir, addresses 0x400f 6000 (dir0) to 0x400f 601c (dir7)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 table 187. gpio port mask register (mask, addresses 0x400f 6080 (mask0) to 0x400f 609c (mask7)) bit description . . . . . . . . . . . . . . . . . . . . . . . . 258 table 188. gpio port pin register (pin, addresses 0x400f 6100 (pin0) to 0x400f 611c (pin7)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 table 189. gpio masked port pin register (mpin, addresses 0x400f 6180 (mpin0) to 0x400f 619c (mpin7)) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 259 table 190. gpio port set register (set, addresses 0x400f 6200 (set0) to 0x400f 621c (set7)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 table 191. gpio port clear register (clr, addresses 0x400f 6280 (clr0) to 0x400f 629c (clr7)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 table 192. gpio port toggle register (not, addresses 0x400f 6300 (not0) to 0x400f 632c (not7)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 table 193. pin interrupt registers for edge- and www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1126 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information level-sensitive pins . . . . . . . . . . . . . . . . . . . .262 table 194. gpdma clocking and power control . . . . . . .263 table 195. peripheral connections to the dma controller and matching flow control signals . . . . . . . . . . . . .264 table 196. register overview: gpdma (base address 0x4000 2000) . . . . . . . . . . . . . . . . . . . . . . . .267 table 197. dma interrupt status register (intstat, address 0x4000 2000) bit description . . . . . . . . . . . . .269 table 198. dma interrupt terminal count request status register (inttcstat, address 0x4000 2004) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .269 table 199. dma interrupt terminal count request clear register (inttcclear, address 0x4000 2008) bit description . . . . . . . . . . . . . . . . . . . . . . . . .269 table 200. dma interrupt error status register (interrstat, address 0x4000 200c) bit description . . . . . . . . . . . . . . . . . . . . . . . . .270 table 201. dma interrupt error clear register (interrclr, address 0x4000 2010) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .270 table 202. dma raw interrupt terminal count status register (rawinttcstat, address 0x4000 2014) bit description . . . . . . . . . . . . . . . . . . . .270 table 203. dma raw error interrupt status register (rawinterrstat, address 0x4000 2018) bit description . . . . . . . . . . . . . . . . . . . .271 table 204. dma enabled channel register (enbldchns, address 0x4000 201c) bit description . . . . . .271 table 205. dma software burst request register (softbreq, address 0x4000 2020) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .272 table 206. dma software single request register (softsreq, address 0x4000 2024) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .272 table 207. dma software last burst request register (softlbreq, address 0x4000 2028) bit description . . . . . . . . . . . . . . . . . . . . . . . . .273 table 208. dma software last single request register (softlsreq, address 0x4000 202c) bit description . . . . . . . . . . . . . . . . . . . . . . . . .273 table 209. dma configuration register (config, address 0x4000 2030) bit description . . . . . . . . . . . .273 table 210. dma synchronization register (sync, address 0x4000 2034) bit description . . . . . . . . . . . . .274 table 211. dma channel source address registers (csrcaddr, 0x4000 2100 (c0srcaddr) to 0x4000 21e0 (c7srcaddr)) bit description 275 table 212. dma channel destination address registers (cdestaddr, 0x4000 2104 (c0destaddr) to 0x4000 21e4 (c7destaddr)) bit description . . . . . . . . . .275 table 213. dma channel linked list item registers (clli, 0x4000 2108 (c0lli) to 0x4000 21e8 (c7lli)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .276 table 214. dma channel control registers (ccontrol, 0x4000 210c (c0control) to 0x4000 21ec (c7control)) bit description . . . . . . . . . . .276 table 215. dma channel configuration registers (cconfig, 0x4000 2110 (c0config) to 0x4000 21f0 (c7config)) bit description . . . . . . . 279 table 216. flow control and transfer type bits . . . . . . . . 281 table 217. endian behavior . . . . . . . . . . . . . . . . . . . . . . 283 table 218. dma request signal usage . . . . . . . . . . . . . . 288 table 219. spifi clocking and power control . . . . . . . . . 294 table 220. spifi flash memory map. . . . . . . . . . . . . . . . 295 table 221. spifi pin description. . . . . . . . . . . . . . . . . . . 295 table 222. sdio clocking and power control . . . . . . . . . 296 table 223. sdio pin description . . . . . . . . . . . . . . . . . . . 297 table 224. register overview: sdmmc (base address: 0x4000 4000) . . . . . . . . . . . . . . . . . . . . . . . . . 298 table 225. control register (ctrl, address 0x4000 4000) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 299 table 226. power enable register (pwren, address 0x4000 4004) bit description . . . . . . . . . . . . . 301 table 227. clock divider register (clkdiv, address 0x4000 4008) bit description. . . . . . . . . . . . . . . . . . . . 302 table 228. sd clock source register (clksrc, address 0x4000 400c) bit description . . . . . . . . . . . . . 302 table 229. clock enable register (clkena, address 0x4000 4010) bit description . . . . . . . . . . . . . 303 table 230. time-out register (tmout, address 0x4000 4014) bit description. . . . . . . . . . . . . . . . . . . . 303 table 231. card type register (ctype, address 0x4000 4018) bit description. . . . . . . . . . . . . . . . . . . . 304 table 232. block size register (blksiz, address 0x4000 401c) bit description . . . . . . . . . . . . . . . . . . . 304 table 233. byte count register (bytcnt, address 0x4000 4020) bit description. . . . . . . . . . . . . . . . . . . . 304 table 234. interrupt mask register (int mask, address 0x4000 4024) bit description . . . . . . . . . . . . . 304 table 235. command argument register (cmdarg, address 0x4000 4028) bit description . . . . . . 305 table 236. command register (cmd, address 0x4000 402c) bit description . . . . . . . . . . . . . . . . . . . 306 table 237. response regist er 0 (resp0, address 0x4000 4030) bit description. . . . . . . . . . . . . . . . . . . . 309 table 238. response regist er 1 (resp1, address 0x4000 4034) bit description. . . . . . . . . . . . . . . . . . . . 309 table 239. response regist er 2 (resp2, address 0x4000 4038) bit description. . . . . . . . . . . . . . . . . . . . 309 table 240. response regist er 3 (resp3, address 0x4000 403c) bit description . . . . . . . . . . . . . . . . . . . 309 table 241. masked interrupt status register (mintsts, address 0x4000 4040) bit description . . . . . . 309 table 242. raw interrupt status register (rintsts, address 0x4000 4044) bit description . . . . . . 310 table 243. status register (status, address 0x4000 4048) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 312 table 244. fifo threshold watermark register (fifoth, address 0x4000 404c) bit description . . . . . . 313 table 245. card detect register (cdetect, address 0x4000 4050) bit description . . . . . . . . . . . . . 315 table 246. write protect register (wrtprt, address 0x4000 4054) bit description . . . . . . . . . . . . . 315 table 247. general purpose input/output register (gpio, address 0x4000 4058) bit description . . . . . . 315 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1127 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 248. transferred ciu card byte count register (tcbcnt, address 0x4000 405c) bit description. 315 table 249. transferred host to biu-fifo byte count register (tbbcnt, address 0x4000 4060) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .316 table 250. debounce count register (debnce, address 0x4000 4064) bit description . . . . . . . . . . . . .316 table 251. user id register (usrid, address 0x4000 4068) bit description . . . . . . . . . . . . . . . . . . . . . . . . .316 table 252. version id register (verid, address 0x4000 406c) bit description. . . . . . . . . . . . . . . . . . . .316 table 253. uhs-1 register (uhs_reg, address 0x4000 4074) bit description . . . . . . . . . . . . . . . . . . . .317 table 254. hardware reset (rst_n, address 0x4000 4078) bit description . . . . . . . . . . . . . . . . . . . . . . . . .317 table 255. bus mode register (bmod, address 0x4000 4080) bit description . . . . . . . . . . . . . . . . . . . .317 table 256. poll demand register (pldmnd, address 0x4000 4084) bit description . . . . . . . . . . . . .318 table 257. descriptor list base address register (dbaddr, address 0x4000 4088) bit description 318 table 258. internal dmac status register (idsts, address 0x4000 408c) bit description . . . . . . . . . . . . .319 table 259. internal dmac interrupt enable register (idinten, address 0x4000 4090) bit description . 320 table 260. current host de scriptor address register (dscaddr, address 0x4000 4094) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .320 table 261. current buffer descriptor address register (bufaddr, address 0x4000 4098) bit description 321 table 262. emc clocking and power control . . . . . . . . . .322 table 263. memory bank selection . . . . . . . . . . . . . . . . .324 table 264. emc pin description . . . . . . . . . . . . . . . . . . .325 table 265. register overview: external memory controller (base address 0x4000 5000) . . . . . . . . . . . . .325 table 266. emc control register (control - address 0x4000 5000) bit description . . . . . . . . . . . . .328 table 267. emc status register (status - address 0x4000 5008) bit description . . . . . . . . . . . . .328 table 268. emc configuration register (config - address 0x4000 5008) bit description . . . . . . . . . . . . .329 table 269. dynamic control register (dynamiccontrol - address 0x4000 5020) bit description. . . . . . .329 table 270. dynamic memory refresh timer register (dynamicrefresh - address 0x4000 5024) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .331 table 271. dynamic memory read configuration register (dynamicreadconfig - address 0x4000 5028) bit description . . . . . . . . . . . . .332 table 272. dynamic memory precharge command period register (dynamicrp - address 0x4000 5030) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .332 table 273. dynamic memory active to precharge command period register (dynamicras - address 0x4000 5034) bit description . . . . . . . . . . . . . 333 table 274. dynamic memory self refresh exit time register (dynamicsrex - address 0x4000 5038) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 table 275. dynamic memory last data out to active time register (dynamicapr - address 0x4000 503c) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 333 table 276. dynamic memory data in to active command time register (dynamicdal - address 0x4000 5040) bit description . . . . . . . . . . . . . 334 table 277. dynamic memory write recovery time register (dynamicwr - address 0x4000 5044) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 table 278. dynamic memory active to active command period register (dynamicrc - address 0x4000 5048) bit description . . . . . . . . . . . . . 335 table 279. dynamic memory auto refresh period register (dynamicrfc - address 0x4000 504c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 table 280. dynamic memory exit self refresh register (dynamicxsr - address 0x4000 5050) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 table 281. dynamic memory active bank a to active bank b time register (dynamicrrd - address 0x4000 5054) bit description . . . . . . . . . . . . . 336 table 282. dynamic memory load mode register to active command time (dynamicmrd - address 0x4000 5058) bit description . . . . . . . . . . . . . 336 table 283. static memory extended wait register (staticextendedwait - address 0x4000 5080) bit description . . . . . . . . . . . . . 337 table 284. dynamic memory configuration registers (dynamicconfig, address 0x4000 5100 (dynamicconfig0), 0x4000 5120 (dynamicconfig1), 0x4000 5140 (dynamicconfig2), 0x4000 5160 (dynamicconfig3)) bit description . . . . . . 337 table 285. address mapping . . . . . . . . . . . . . . . . . . . . . 338 table 286. dynamic memory rascas delay registers (dynamicrascas, address 0x4000 5104 (dynamicrascas0), 0x4000 5124 (dynamicrascas1), 0x4000 5144 (dynamicrascas2), 0x4000 5164 (dynamicrascas3)) bit description. . . . . . 340 table 287. static memory configuration registers (staticconfig, address 0x4000 5200 (staticconfig0), 0x4000 5220 (staticconfig1), 0x4000 5240 (staticconfig2), 0x4000 5260 (staticconfig3)) bit description . . . . . . . . 341 table 288. static memory write enable delay registers (staticwaitwen, address 0x4000 5204 (staticwaitwen0), 0x4000 5224 (staticwaitwen1), 0x4000 5244 (staticwaitwen2), 0x4000 5264 (staticwaitwen3)) bit description. . . . . . . 342 table 289. static memory output enable delay registers (staticwaitoen, address 0x4000 5208 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1128 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information (staticwaitoen0), 0x4000 5228 (staticwaitoen1), 0x4000 5248 (staticwaitoen2), 0x4000 5268 (staticwaitoen3)) bit description . . . . . . .343 table 290. static memory read delay registers (staticwaitrd, address 0x4000 520c (staticwaitrd0), 0x4000 522c (staticwaitrd1), 0x4000 524c (staticwaitrd2), 0x4000 526c (staticwaitrd3)) bit description. . . . . . . . .343 table 291. static memory page mode read delay registers (staticwaitpage, address 0x4000 5210 (staticwaitpage0), 0x4000 5230 (staticwaitpage1), 0x4000 5250 (staticwaitpage2), 0x4000 5270 (staticwaitpage3)) bit description . . . . . .344 table 292. static memory write delay registers (staticwaitwr, address 0x4000 5214 (staticwaitwr0), 0x4000 5234 (staticwaitwr1), 0x4000 5254 (staticwaitwr2), 0x4000 5274 (staticwaitwr3)) bit description . . . . . . . .344 table 293. static memory turn round delay registers (staticwaitturn, address 0x4000 5218 (staticwaitturn0), 0x4000 5238 (staticwaitturn1), 0x4000 5258 (staticwaitturn2), 0x4000 5278 (staticwaitturn3)) bit description . . . . . .345 table 294. usb0 clocking and power control . . . . . . . . .354 table 295. usb related acronyms . . . . . . . . . . . . . . . . . .355 table 296. fixed endpoint configuration . . . . . . . . . . . . .356 table 297. usb packet size . . . . . . . . . . . . . . . . . . . . . .357 table 298. usb0 pin description . . . . . . . . . . . . . . . . . . .357 table 299. register access abbreviations . . . . . . . . . . . .358 table 300. register overview: usb0 otg controller (register base address 0x4000 6000) . . . . . . . . . . . . .358 table 301. caplength regi ster (caplength - address 0x4000 6100) bit description . . . . . . . . . . . . .360 table 302. hcsparams register (hcsparams - address 0x4000 6104) bit description . . . . . . . . . . . .361 table 303. hccparams register (hccparams - address 0x4000 6108) bit description . . . . . . . . . . . . .361 table 304. dciversion register (dciversion - address 0x4000 6120) bit description . . . . . . . . . . . . .362 table 305. dccparams (address 0x4000 6124) . . . . .362 table 306. usb command register in device mode (usbcmd_d - address 0x4000 6140) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .362 table 307. usb command register in host mode (usbcmd_h - address 0x4000 6140) bit description - host mode . . . . . . . . . . . . . . . . .364 table 308. frame list size values . . . . . . . . . . . . . . . . . .366 table 309. usb status register in device mode (usbsts_d - address 0x4000 6144) register bit description . 367 table 310. usb status register in host mode (usbsts_h - address 0x4000 6144) register bit description . . 369 table 311. usb interrupt register in device mode (usbintr_d - address 0x4000 6148) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 371 table 312. usb interrupt register in host mode (usbintr_h - address 0x4000 6148) bit description . . . . 372 table 313. usb frame index register in device mode (frindex_d - address 0x4000 614c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 373 table 314. usb frame index register in host (frindex_h - address 0x4000 614c) bit description . . . . . 373 table 315. number of bits used for the frame list index . 373 table 316. usb device address register in device mode (deviceaddr - address 0x4000 6154) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 table 317. usb periodic list base register in host mode (periodiclistbase - address 0x4000 6154) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 375 table 318. usb endpoint list address register in device mode (endpointlistaddr - address 0x4000 6158) bit description . . . . . . . . . . . . . . . . . . . 375 table 319. usb asynchronous list address register in host mode (asynclistaddr- address 0x4000 6158) bit description . . . . . . . . . . . . . . . . . . . . . . . . 375 table 320. usb tt control register in host mode (ttctrl - address 0x4000 615c) bit description . . . . . . 376 table 321. usb burst size register (burstsize - address 0x4000 6160) bit description - device/host mode 376 table 322. usb transfer buffer fill tuning register in host mode (txfilltuning - address 0x4000 6164) bit description . . . . . . . . . . . . . . . . . . . . . . . . 377 table 323. usb binterval register (binterval - address 0x4000 6174) bit description . . . . . . . . . . . . . 378 table 324. usb endpoint nak register (endptnak - address 0x4000 6178) bit description . . . . . . 378 table 325. usb endpoint nak enable register (endptnaken - address 0x4000 617c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 table 326. port status and control register in device mode (portsc1_d - address 0x4000 6184) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 379 table 327. port status and control register in host mode (portsc1_h - address 0x4000 6184) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 382 table 328. port states as described by the pe and susp bits in the portsc1 register . . . . . . . . . . . . . . . . 386 table 329. otg status and control register (otgsc - address 0x4000 61a4) bit description . . . . . 387 table 330. usb mode register in device mode (usbmode_d - address 0x4000 61a8) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 389 table 331. usb mode register in host mode (usbmode_h - address 0x4000 61a8) bit description . . . . 390 table 332. usb endpoint setup status register (endptsetupstat - address 0x4000 61ac) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 table 333. usb endpoint prime register (endptprime - address 0x4000 61b0) bit description . . . . . 392 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1129 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 334. usb endpoint flush register (endptflush - address 0x4000 61b4) bit description . . . . . .392 table 335. usb endpoint status register (endptstat - address 0x4000 61b8) bit description . . . . . .393 table 336. usb endpoint complete register (endptcomplete - address 0x4000 61bc) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .394 table 337. usb endpoint 0 control register (endptctrl0 - address 0x4000 61c0) bit description . . . .394 table 338. usb endpoint 1 to 5 control registers (endptctrl - address 0x4000 61c4 (endptctrl1) to 0x4000 61d4 (endptctrl5)) bit description . . . . . . . . . .395 table 339. handling of directly connected full-speed and low-speed devices . . . . . . . . . . . . . . . . . . . . .401 table 340. split state machine properties . . . . . . . . . . . .403 table 341. endpoint capabilities and characteristics . . . .407 table 342. current dtd pointer . . . . . . . . . . . . . . . . . . .409 table 343. set-up buffer . . . . . . . . . . . . . . . . . . . . . . . . .409 table 344. next dtd pointer . . . . . . . . . . . . . . . . . . . . . .409 table 345. dtd token . . . . . . . . . . . . . . . . . . . . . . . . . .410 table 346. dtd buffer page pointer list . . . . . . . . . . . . . . 411 table 347. device controller endpoint initialization . . . . .417 table 348. device controller sta ll response matrix . . . . .418 table 349. variable length transfer protocol example (zlt = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .420 table 350. variable length transfer protocol example (zlt = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .420 table 351. interrupt/bulk endpoint bus response matrix .421 table 352. control endpoint bus response matrix . . . . . .424 table 353. isochronous endpoint bus response matrix . .426 table 354. device error matrix. . . . . . . . . . . . . . . . . . . . .431 table 355. high-frequency interrupt events. . . . . . . . . . .431 table 356. low-frequency interrupt events . . . . . . . . . . .431 table 357. error interrupt events . . . . . . . . . . . . . . . . . . .432 table 358. usb1 clocking and power control . . . . . . . . .437 table 359. usb1 pin description . . . . . . . . . . . . . . . . . . .438 table 360. register access abbreviations . . . . . . . . . . . .439 table 361. register overview: usb1 host/device controller (register base address 0x4000 7000) . . . . . .439 table 362. caplength regi ster (caplength - address 0x4000 7100) bit description . . . . . . . . . . . . .440 table 363. hcsparams register (hcsparams - address 0x4000 7104) bit description . . . . . . . . . . . .441 table 364. hccparams register (hccparams - address 0x4000 7108) bit description . . . . . . . . . . . . .442 table 365. dciversion register (dciversion - address 0x4000 7120) bit description . . . . . . . . . . . . .442 table 366. dccparams (address 0x4000 7124) . . . . .442 table 367. usb command register in device mode (usbcmd_d - address 0x4000 7140) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .443 table 368. usb command register in host mode (usbcmd_h - address 0x4000 7140) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .444 table 369. frame list size values . . . . . . . . . . . . . . . . . .446 table 370. usb status register in device mode (usbsts_d - address 0x4000 7144) register bit description . 447 table 371. usb status register in host mode (usbsts_h - address 0x4000 7144) register bit description . 449 table 372. usb interrupt register in device mode (usbintr_d - address 0x4000 7148) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 451 table 373. usb interrupt register in host mode (usbintr_h - address 0x4000 7148) bit description . . . . 452 table 374. usb frame index register in device mode (frindex_d - address 0x4000 714c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 table 375. usb frame index register in host mode (frindex_h - address 0x4000 714c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 table 376. number of bits used for the frame list index . 453 table 377. usb device address register in device mode (deviceaddr - address 0x4000 7154) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 table 378. usb periodic list base register in host mode (periodiclistbase - address 0x4000 7154) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 table 379. usb endpoint list address register in device mode (endpointlistaddr - address 0x4000 7158) bit description . . . . . . . . . . . . . . . . . . . 455 table 380. usb asynchronous list address register in host mode (asynclistaddr- address 0x4000 7158) bit description . . . . . . . . . . . . . . . . . . . . . . . . 455 table 381. usb tt control register in host mode (ttctrl - address 0x4000 715c) bit description . . . . . 456 table 382. usb burst size register in device/host mode (burstsize - address 0x4000 7160) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 table 383. usb transfer buffer fill tuning register in host mode (txfilltuning - address 0x4000 7164) bit description . . . . . . . . . . . . . . . . . . . . . . . . 457 table 384. usb ulpi viewport register (ulpiviewport - address 0x4000 7170) bit description . . . . . 458 table 385. usb binterval register (binterval - address 0x4000 7174) bit description in device/host mode 459 table 386. usb endpoint nak register in device mode (endptnak - address 0x4000 7178) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 table 387. usb endpoint nak enable register in device mode (endptnaken - address 0x4000 717c) bit description . . . . . . . . . . . . . . . . . . . . . . . . 461 table 388. port status and control register in device mode (portsc1_d - address 0x4000 7184) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 461 table 389. port status and control register in host mode (portsc1_h - address 0x4000 7184) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 table 390. port states as described by the pe and susp bits in the portsc1 register . . . . . . . . . . . . . . . . 469 table 391. usb mode register in device mode (usbmode_d - address 0x4000 71a8) bit www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1130 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information description . . . . . . . . . . . . . . . . . . . . . . . . . .469 table 392. usb mode register in host mode (usbmode_h - address 0x4000 71a8) bit description . . . .470 table 393. usb endpoint setup status register (endptsetupstat - address 0x4000 71ac) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .471 table 394. usb endpoint prime register (endptprime - address 0x4000 71b0) bit description . . . . .472 table 395. usb endpoint flush register (endptflush - address 0x4000 71b4) bit description . . . . . .472 table 396. usb endpoint status register (endptstat - address 0x4000 71b8) bit description . . . . . .473 table 397. usb endpoint complete register (endptcomplete - address 0x4000 71bc) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .474 table 398. usb endpoint 0 control register (endptctrl0 - address 0x4000 71c0) bit description . . . .474 table 399. usb endpoint 1 to 3 control registers (endptctrl - address 0x4000 71c4 (endptctrl1) to 0x4000 71cc (endptctrl3)) bit description . . . . . . . . . .475 table 400. ethernet clocking and power control . . . . . . .478 table 401. ethernet pin description . . . . . . . . . . . . . . . . .479 table 402. register overview: ethernet mac and dma (base address 0x4001 0000) . . . . . . . . . . . . . . . . . .480 table 403. mac configuration register (mac_config, address 0x4001 0000) bit description . . . . . .481 table 404. mac frame filter register (mac_frame_filter, address 0x4001 0004) bit description . . . . . . . . . . . . . . . . . . . . . . . .484 table 405. mac hash table high register (mac_hashtable_high, address 0x4001 0008) bit description . . . . . . . . . . . . . . . . . . .486 table 406. mac hash table low register (mac_hashtable_low, address 0x4001 0008) bit description . . . . . . . . . . . . . . . . . . .486 table 407. mac mii address register (mac_mii_addr, address 0x4001 0010) bit description . . . . . .487 table 408. csr clock range values. . . . . . . . . . . . . . . . .487 table 409. mii data register (mac_mii_data, address 0x4001 0014) bit description . . . . . . . . . . . .488 table 410. mac flow control register (mac_flow_ctrl, address 0x4001 0018) bit description . . . . . .489 table 411. mac vlan tag register (mac_vlan_tag, address 0x4001 01c) bit description . . . . . .490 table 412. mac debug register (mac_debug, address 0x4001 0024) bit description . . . . . . . . . . . .490 table 413. mac remote wake-up frame filter register (mac_rwake_frflt, address 0x4001 0028) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .492 table 414. mac pmt control and status register (mac_pmt_ctrl_stat, address 0x4001 002c) bit description . . . . . . . . . . . . . . . . . . . . . . . .492 table 415. mac interrupt status register (mac_intr, address 0x4001 0038) bit description . . . . . .493 table 416. mac interrupt mask register (mac_intr_mask, address 0x4001 003c) bit description . . . . .493 table 417. mac address 0 high register (mac_addr0_high, address 0x4001 0040) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 493 table 418. mac address 0 low register (mac_addr0_low, address 0x4001 0044) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 494 table 419. mac ieee1588 time stamp control register (mac_timestp_ctrl, address 0x4001 0700) bit description . . . . . . . . . . . . . . . . . . . . . . . . 494 table 420. time stamp snapshot dependency on register bits 495 table 421. dma bus mode register (dma_bus_mode, address 0x4001 1000) bit description . . . . . 496 table 422. programmable burst length settings . . . . . . 498 table 423. dma transmit poll demand register (dma_trans_poll_demand, address 0x4001 1004) bit description . . . . . . . . . . . . 498 table 424. dma receive poll demand register (dma_rec_poll_demand, address 0x4001 1008) bit description . . . . . . . . . . . . . . . . . . . 499 table 425. dma receive descriptor list address register (dma_rec_des_addr, address 0x4001 100c) bit description . . . . . . . . . . . . . . . . . . . . . . . . 499 table 426. dma transmit descriptor list address register (dma_trans_des_addr, address 0x4001 1010) bit description . . . . . . . . . . . . . . . . . . . 500 table 427. dma status register (dma_stat, address 0x4001 1014) bit description . . . . . . . . . . . . 500 table 428. dma operation mode register (dma_op_mode, address 0x4001 1018) bit description . . . . . 503 table 429. dma interrupt enable register (dma_int_en, address 0x4001 101c) bit description . . . . . 505 table 430. dma missed frame and buffer overflow counter register (dma_mfrm_bufof, address 0x4001 1020) bit description . . . . . . . . . . . . . . . . . . . 508 table 431. dma receive interrupt watchdog timer register (dma_rec_int_wdt, address 0x4001 1024) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 508 table 432. dma current host transmit descriptor register (dma_curhost_trans_des, address 0x4001 1048) bit description . . . . . . . . . . . . 509 table 433. dma current host receive descriptor register (dma_curhost_rec_des, address 0x4001 104c) bit description . . . . . . . . . . . . . . . . . . 509 table 434. dma current host transmit buffer address register (dma_curhost_trans_buf, address 0x4001 1050) bit description . . . . . 509 table 435. dma current host receive buffer address register (dma_curhost_rec_buf, address 0x4001 1054) bit description . . . . . . . . . . . . . . . . . . . 509 table 436. priority scheme for transmit and receive dma . . 513 table 437. transmit descriptor word 0 (tdes0). . . . . . . 529 table 438. transmit descriptor word 1 (tdes1). . . . . . . 532 table 439. transmit descriptor word 2 (tdes2). . . . . . . 532 table 440. transmit descriptor word 3 (tdes3). . . . . . . 533 table 441. transmit descriptor word 6 (tdes6). . . . . . . 533 table 442. transmit descriptor word 7 (tdes7). . . . . . . 533 table 443. receive descriptor fields 0 (rdes0). . . . . . . 535 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1131 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 444. receive descriptor fields 1 (rdes1) . . . . . . .537 table 445. receive descriptor fields 2 (rdes2) . . . . . . .537 table 446. receive descriptor fields 3 (rdes3) . . . . . . .538 table 447. receive descriptor fields 4 (rdes4) . . . . . . .538 table 448. receive descriptor fields 6 (rdes6) . . . . . . .539 table 449. receive descriptor fields 7 (rdes7) . . . . . . .539 table 450. lcd clocking and power control . . . . . . . . . .540 table 451. lcd controller pins . . . . . . . . . . . . . . . . . . . .543 table 452. pins used for single panel stn displays . . . .543 table 453. pins used for dual panel stn displays . . . . .544 table 454. pins used for tft displays . . . . . . . . . . . . . .544 table 455. register overview: lcd controller (base address: 0x4000 8000) . . . . . . . . . . . . . . . . . . . . . . . . .545 table 456. horizontal timing register (timh, address 0x4000 8000) bit description . . . . . . . . . . . . .546 table 457. vertical timing register (timv, address 0x4000 8004) bit description . . . . . . . . . . . . . . . . . . .548 table 458. clock and signal polarity register (pol, address 0x4000 8008) bit description . . . . . . . . . . . .549 table 459. line end control register (le, address 0x4000 800c) bit description. . . . . . . . . . . . . . . . . . . .551 table 460. upper panel frame base register (upbase, address 0x4000 8010) bit description. . . . . .551 table 461. lower panel fram e base register (lpbase, address 0x4000 8014) bit description. . . . . .552 table 462. lcd control register (ctrl, address 0x4000 8018) bit description . . . . . . . . . . . . . . . . . . .552 table 463. interrupt mask register (intmsk, address 0x4000 801c) bit description . . . . . . . . . . . . .554 table 464. raw interrupt status register (intraw, address 0x4000 8020) bit description . . . . . . . . . . . . .554 table 465. masked interrupt status register (intstat, address 0x4000 8024) bit description. . . . . .555 table 466. interrupt clear register (intclr, address 0x4000 8028) bit description . . . . . . . . . . . . .556 table 467. upper panel current address register (upcurr, address 0x4000 802c) bit description . . . . .556 table 468. lower panel current address register (lpcurr, address 0x4000 8030) bit description. . . . . .556 table 469. color palette registers (pal, address 0x4000 8200 (pal0) to 0x4000 83fc (pal255)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .557 table 470. cursor image registers (crsr_img, address 0x4000 8800 (crsr_img0) to 0x4000 8bfc (crsr_img1)) bit description . . . . . . . . . . . .558 table 471. cursor control register (crsr_ctrl, address 0x4000 8c00) bit description . . . . . . . . . . . . .558 table 472. cursor configuration register (crsr_cfg, address 0x4000 8c04) bit description . . . . .559 table 473. cursor palette register 0 (crsr_pal0, address 0x4000 8c08) bit description . . . . . . . . . . . . .559 table 474. cursor palette register 1 (crsr_pal1, address 0x4000 8c0c) bit description . . . . . . . . . . . . .560 table 475. cursor xy position register (crsr_xy, address 0x4000 8c10) bit description . . . . . . . . . . . . .560 table 476. cursor clip position register (crsr_clip, address 0x4000 8c14) bit description . . . . .561 table 477. cursor interrupt mask register (crsr_intmsk, address 0x4000 8c20) bit description . . . . . 561 table 478. cursor interrupt clear register (crsr_intclr, address 0x4000 8c24) bit description . . . . . 562 table 479. cursor raw interrupt status register (crsr_intraw, address 0x4000 8c28) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 562 table 480. cursor masked interrupt status register (crsr_intstat, address 0x4000 8c2c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 562 table 481. fifo bits for little-endian byte, little-endian pixel order. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566 table 482. fifo bits for big-endian byte, big-endian pixel order. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567 table 483. fifo bits for little-endian byte, big-endian pixel order. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568 table 484. rgb mode data formats . . . . . . . . . . . . . . . . 569 table 485. palette data storage for tft modes. . . . . . . 570 table 486. palette data storage for stn color modes. . . 570 table 487. palette data storage for stn monochrome mode. 571 table 488. palette data storage for stn monochrome mode. 572 table 489. addresses for 32 x 32 cursors . . . . . . . . . . . 574 table 490. buffer to pixel mapping for 32 x 32 pixel cursor format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575 table 491. buffer to pixel mapping for 64 x 64 pixel cursor format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575 table 492. pixel encoding. . . . . . . . . . . . . . . . . . . . . . . . 576 table 493. color display driven with 2 2/3 pixel data . . . 577 table 494. lcd panel connections for stn single panel mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583 table 495. lcd panel connections for stn dual panel mode 584 table 496. lcd panel connections for tft panels. . . . . 585 table 497. sct clocking and power control . . . . . . . . . . 587 table 498. sct pin description . . . . . . . . . . . . . . . . . . . 589 table 499. register overview: state configurable timer (base address 0x4000 0000) . . . . . . . . . . . . 590 table 500. sct configuration register (config - address 0x4000 0000) bit description . . . . . . . . . . . . 593 table 501. sct control register (ctrl - address 0x4000 0004) bit description. . . . . . . . . . . . . . . . . . . . 595 table 502. sct limit register (limit - address 0x4000 0008) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 596 table 503. sct halt condition register (halt - address 0x4000 000c) bit description . . . . . . . . . . . . 596 table 504. sct stop condition register (stop - address 0x4000 0010) bit description . . . . . . . . . . . . 597 table 505. sct start condition register (start - address 0x4000 0014) bit description . . . . . . . . . . . . 597 table 506. sct counter register (count - address 0x4000 0040) bit description. . . . . . . . . . . . . . . . . . . . 597 table 507. sct state register (state - address 0x4000 0044) bit description. . . . . . . . . . . . . . . . . . . . 598 table 508. sct input register (input - address 0x4000 0048) bit description. . . . . . . . . . . . . . . . . . . . 599 table 509. sct match/capture registers mode register (regmode - address 0x4000 004c) bit www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1132 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information description . . . . . . . . . . . . . . . . . . . . . . . . . . .600 table 510. sct output register (output - address 0x4000 0050) bit description . . . . . . . . . . . . . . . . . . . .600 table 511. sct bidirectional output control register (outputdirctrl - address 0x4000 0054) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .600 table 512. sct conflict resolution register (res - address 0x4000 0058) bit description . . . . . . . . . . . .602 table 513. sct dma 0 request register (dmareq0 - address 0x4000 005c) bit description . . . . . .605 table 514. sct dma 1 request register (dmareq1 - address 0x4000 0060) bit description. . . . . . .605 table 515. sct flag enable register (even - address 0x4000 00f0) bit description . . . . . . . . . . . . . . . . . . . .605 table 516. sct event flag register (evflag - address 0x4000 00f4) bit description . . . . . . . . . . . . .605 table 517. sct conflict enable register (conen - address 0x4000 00f8) bit description . . . . . . . . . . . . .606 table 518. sct conflict flag register (conflag - address 0x4000 00fc) bit description . . . . . . . . . . . . .606 table 519. sct match registers 0 to 15 (match - address 0x4000 0100 (match0) to 0x4000 4013c (match15)) bit description (regmoden bit = 0) 607 table 520. sct capture registers 0 to 15 (cap - address 0x4000 0100 (cap0) to 0x4000 013c (cap15)) bit description (regmoden bit = 1). . . . . . . .607 table 521. sct match reload registers 0 to 15 (matchrel- address 0x4000 0200 (matchreload0) to 0x4000 023c (matchreload15) bit description (regmoden bit = 0) . . . . . . . . . . . . . . . . . . .607 table 522. sct capture control registers 0 to 15 (capctrl- address 0x4000 0200 (capctrl0) to 0x4000 023c (capctrl15)) bit description (regmoden bit = 1) . . . . . . . . . . . . . . . . . . .608 table 523. sct event state mask registers 0 to 15 (evstatemsk - addresses 0x4000 0300 (evstatemsk0) to 0x4000 0378 (evstatemsk15)) bit description . . . . . . . . .608 table 524. sct event control register 0 to 15 (evctrl - address 0x4000 0304 (evctrl0) to 0x4000 037c (evctrl15)) bit description . . . . . . . . .609 table 525. sct output set register 0 to 15 (outputset - address 0x4000 0500 (outputset0) to 0x4000 0578 (outputset15)) bit description . . . . .610 table 526. sct output set register 0 to 15 (outputcl - address 0x4000 0504 (outputcl0) to 0x4000 057c (outputcl15)) bit description . . . . . .610 table 527. event conditions . . . . . . . . . . . . . . . . . . . . . .613 table 528. alternate address map for dma halfword access 614 table 529. sct configuration example . . . . . . . . . . . . . .619 table 530. timer0/1/2/3 clocking and power control . . . .621 table 531. timer0/1/2/3 pin description . . . . . . . . . . . . .622 table 532. timer/counter function description . . . . . . . .623 table 533. register overview: timer0/1/2/3 (register base addresses 0x4008 4000 (timer0), 0x4008 5000 (timer1), 0x400c 3000 (timer2), 0x400c 4000 (timer3)) . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 table 534. timer interrupt registers ir(ir - addresses 0x4008 4000 (timer0), 0x4008 5000 (timer1), 0x400c 3000 (timer3), 0x400c 4000 (timer4)) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 624 table 535. timer control register tcr (tcr - addresses 0x4008 4004 (timer0), 0x4008 5004 (timer1), 0x400c 3003 (timer2), 0x400c 4004 (timer3)) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 625 table 536. timer counter registers tc (tc - addresses 0x4008 4008 (timer0), 0x4008 5008 (timer1), 0x400c 3008 (timer2), 0x400c 4008 (timer3)) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 625 table 537. timer prescale registers pr (pr - addresses 0x4008 400c (timer0), 0x4008 500c (timer1), 0x400c 300c (timer2), 0x400c 400c (timer3)) bit description . . . . . . . . . . . . . . . . 625 table 538. timer prescale counter registers pc(pc - addresses 0x4008 4010 (timer0), 0x4008 5010 (timer1), 0x400c 3010 (timer2), 0x400c 4010 (timer3)) bit description . . . . . . . . . . . . . . . . 626 table 539. timer match control registers mcr (mcr - addresses 0x4008 4014 (timer0), 0x4008 5014 (timer1), 0x400c 3014 (timer2), 0x400c 4014 (timer3)) bit description . . . . . . . . . . . . . . . 626 table 540. timer match registers mr0 to 3 (mr, addresses 0x4008 4018 (mr0) to 0x4008 4024 (m3) (timer0), 0x4008 5018 (mr0) to 0x4008 5024 (mr3)(timer1), 0x400c 3018 (mr0) to 0x400c 8024 (mr3) (timer2), 0x400c 4018 (mr0) to 0x400c 4024 (mr3)(timer3)) bit description627 table 541. timer capture cont rol registers (ccr - addresses 0x4008 4028 (timer0), 0x4008 5020 (timer1), 0x400c 3028 (timer2), 0x400c 4028 (timer3)) bit description . . . . . . . . . . . . . . . . . . . . . . . . 628 table 542. timer capture registers cr0 to 3 (cr, address 0x4008 402c (cr0) to 0x4008 4038 (cr3) (timer0), 0x4008 502c (cr0) to 0x4008 5038 (cr3) (timer1), 0x400c 302c (cr0) to 0x400c 3038 (cr3) (timer2), 0x400c 402c (cr0) to 0x400c 4038 (cr3) (timer3)) bit description . . 629 table 543. timer external match registers (emr - addresses 0x4008 403c (timer0), 0x4008 503c (timer1), 0x400c 303c (timer2), 0x400c 403c (timer3)) bit description . . . . . . . . . . . . . . . . 630 table 544. external match control . . . . . . . . . . . . . . . . . 631 table 545. timer count control register ctcr(ctcr - addresses 0x4008 4070 (timer0), 0x4008 5070 (timer1), 0x400c 3070 (timer2), 0x400c 4070 (timer3)) bit description . . . . . . . . . . . . . . . 632 table 546. pwm clocking and power control . . . . . . . . . 635 table 547. pin summary . . . . . . . . . . . . . . . . . . . . . . . . . 638 table 548. register overview: motor control pulse width modulator (mcpwm) (base address 0x400a 0000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 table 549. mcpwm control read address (con - 0x400a 0000) bit description . . . . . . . . . . . . . 639 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1133 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 550. mcpwm control set address (con_set - 0x400a 0004) bit description . . . . . . . . . . . . .641 table 551. mcpwm control clear address (con_clr - 0x400a 0008) bit description . . . . . . . . . . . . .641 table 552. mcpwm capture control read address (capcon - 0x400a 000c) bit description . . .642 table 553. mcpwm capture control set address (capcon_set - 0x400a 0010) bit description . . 643 table 554. mcpwm capture control clear register (capcon_clr - address 0x400a 0014) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .644 table 555. mcpwm timer/counter 0 to 2 registers (tc - 0x400a 0018 (tc0), 0x400a 001c (tc1), 0x400a 0020) (tc2)bit description . . . . . . . . .646 table 556. mcpwm limit 0 to 2 registers (lim - 0x400a 0024 (lim0), 0x400a 0028 (lim1), 0x400a 002c (lim2)) bit description . . . . . . .646 table 557. mcpwm match 0 to 2 registers (mat - addresses 0x400a 0030 (mat0), 0x400a 0034 (mat1), 0x400a 0038 (mat2)) bit description . . . . . . .647 table 558. mcpwm dead-time register (dt - address 0x400a 003c) bit description . . . . . . . . . . . . .648 table 559. mcpwm communication pattern register (cp - address 0x400a 0040) bit description . . . . . .648 table 560. mcpwm capture read addresses (cap - 0x400a 0044 (cap0), 0x400a 0048 (cap1), 0x400a 004c 9cap2)) bit description . . . . . .649 table 561. motor control pwm interrupts . . . . . . . . . . . .649 table 562. mcpwm interrupt enable read address (inten - 0x400a 0050) bit description . . . . . . . . . . . . .649 table 563. mcpwm interrupt enable set register (inten_set - address 0x400a 0054) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .650 table 564. pwm interrupt enable clear register (inten_clr - address 0x400a 0058) bit description . . . . .651 table 565. mcpwm interrupt flags read address (intf - 0x400a 0068) bit description . . . . . . . . . . . . .652 table 566. mcpwm interrupt flags set address (intf_set - 0x400a 006c) bit description . . . . . . . . . . . .653 table 567. mcpwm interrupt flags clear address (intf_clr - 0x400a 0070) bit description. . .654 table 568. mcpwm count control read address (cntcon - 0x400a 005c) bit description . . . . . . . . . . . .655 table 569. mcpwm count control set address (cntcon_set - 0x400a 0060) bit description . . 657 table 570. mcpwm count control clear address (cntcon_clr - 0x400a 0064) bit description . . 658 table 571. mcpwm capture clear address (cap_clr - 0x400a 0074) bit description . . . . . . . . . . . . .659 table 572. qei clocking and power control . . . . . . . . . . .666 table 573. qei pin description. . . . . . . . . . . . . . . . . . . . .669 table 574. register overview: qei (base address 0x400c 6000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .669 table 575: qei control register (con - address 0x400c 6000) bit description . . . . . . . . . . . . .671 table 576: qei configuration register (conf - address 0x400c 6008) bit description . . . . . . . . . . . . . 671 table 577: qei interrupt status register (stat - address 0x400c 6004) bit description . . . . . . . . . . . . . 672 table 578. qei position register (pos - address 0x400c 600c) bit description. . . . . . . . . . . . . 673 table 579. qei maximum position register (maxpos - address 0x400c 6010) bit description . . . . . . 673 table 580. qei position compare register 0 (cmpos0 - address 0x400c 6014) bit description . . . . . . 673 table 581. qei position compare register 1 (cmpos1 - address 0x400c 6018) bit description . . . . . . 673 table 582. qei position compare register 2 (cmpos2 - address 0x400c 601c) bit description. . . . . . 673 table 583. qei index count register (inxcnt- address 0x400c 6020) bit description . . . . . . . . . . . . . 674 table 584. qei index compare register 0(inxcmp0 - address 0x400c 6024) bit description . . . . . . 674 table 585. qei timer load register (load - address 0x400c 6028) bit description . . . . . . . . . . . . . 674 table 586. qei timer register (time - address 0x400c 602c) bit description. . . . . . . . . . . . . 674 table 587. qei velocity register (vel - address 0x400c 6030) bit description . . . . . . . . . . . . . 674 table 588. qei velocity capture register (cap - address 0x400c 6034) bit description . . . . . . . . . . . . . 675 table 589. qei velocity compare register (velcomp - address 0x400c 6038) bit description . . . . . . 675 table 590. qei digital filter on phase a input register (filterpha - 0x400c 603c) bit description675 table 591. qei digital filter on phase b input register (filterphb - 0x400c 6040) bit description 675 table 592. qei digital filter on index input register (filterinx - 0x400c 6044) bit description. 675 table 593. qei index acceptance window register (window - 0x400c 6048) bit description . 676 table 594. qei index compare register 1 (inxcmp1 - address 0x400c 604c) bit description. . . . . . 676 table 595. qei index compare register 0 (inxcmp2 - address 0x400c 6050) bit description . . . . . . 676 table 596: qei interrupt enable clear register (iec - address 0x400c 6fd8) bit description . . . . . . . . . . . . 677 table 597: qei interrupt enable set register (ies - address 0x400c 6fdc) bit description . . . . . . . . . . . . 677 table 598: qei interrupt status register (intstat - address 0x400c 6fe0) bit description. . . . . . . . . . . . . 678 table 599: qei interrupt enable register (ie - address 0x400c 6fe4) bit description. . . . . . . . . . . . . 679 table 600: qei interrupt clear register (clr - 0x400c 6fe8) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 679 table 601: qei interrupt set register (set - address 0x400c 6fec) bit description . . . . . . . . . . . . 680 table 602. encoder states . . . . . . . . . . . . . . . . . . . . . . . 681 table 603. encoder state transitions [1] . . . . . . . . . . . . . . 681 table 604. encoder direction . . . . . . . . . . . . . . . . . . . . . 682 table 605. rit clocking and power control . . . . . . . . . . . 684 table 606. register overview: repetitive interrupt timer (rit) (base address 0x400c 0000) . . . . . . . . 685 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1134 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 607. ri compare value register (compval - address 0x400c 0000) bit description . . . . . . . . . . . . .685 table 608. ri mask register (mask - address 0x400c 0004) bit description . . . . . . . . . . . . . . . . . . . . . . . . .685 table 609. ri control register (ctrl - address 0x400c 0008) bit description . . . . . . . . . . . . . . . . . . . .685 table 610. ri counter register (counter - address 0x400c 000c) bit description . . . . . . . . . . . . .686 table 611. alarm timer clocking and power control . . . . .688 table 612. register overview: alarm timer (base address 0x4004 0000) . . . . . . . . . . . . . . . . . . . . . . . . .689 table 613. downcounter register (downcounter - 0x4004 0000) bit description . . . . . . . . . . . . .689 table 614. preset value register (preset - 0x4004 0004) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .689 table 615. interrupt clear enable register (clr_en - 0x4004 0fd8) bit description . . . . . . . . . . . . . . . . . . .689 table 616. interrupt set enable register (set_en - 0x4004 0fdc) bit description . . . . . . . . . . . . . . . . . . .690 table 617. interrupt status register (status - 0x4004 0fe0) bit description . . . . . . . . . . . . . . . . . . . . . . . . .690 table 618. interrupt enable register (enable - 0x4004 0fe4) bit description. . . . . . . . . . . . . . . . . . . .690 table 619. interrupt clear status register (clr_stat - 0x4004 0fe8) bit description . . . . . . . . . . . . .690 table 620. interrupt set status register (set_stat - 0x4004 0fec) bit description . . . . . . . . . . . . . . . . . . .690 table 621. wwdt clocking and power control . . . . . . . .691 table 622. register overview: watchdog timer (base address 0x4008 0000) . . . . . . . . . . . . . . . . . .693 table 623. watchdog mode register (mod - 0x4008 0000) bit description . . . . . . . . . . . . . . . . . . . . . . . . .694 table 624. watchdog operating modes selection . . . . . .695 table 625. watchdog timer constant register (tc - 0x4008 0004) bit description . . . . . . . . . . . . . . . . . . . .695 table 626. watchdog feed register (feed - 0x4008 0008) bit description . . . . . . . . . . . . . . . . . . . . . . . . .696 table 627. watchdog timer value register (tv - 0x4008 000c) bit description. . . . . . . . . . . . . . . . . . . .696 table 628. watchdog timer warning interrupt register (warnint - 0x4008 0014) bit description . . .696 table 629. watchdog timer window register (window - 0x4008 0018) bit description . . . . . . . . . . . . .697 table 630. rtc clocking and power control . . . . . . . . . .699 table 631. rtc pin description . . . . . . . . . . . . . . . . . . . .700 table 632. register overview: rtc (base address 0x4004 6000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .701 table 633. register overview: regfile (base address 0x4004 1000) . . . . . . . . . . . . . . . . . . . . . . . . .701 table 634. interrupt location register (ilr - address 0x4004 6000) bit description . . . . . . . . . . . . .702 table 635. clock control register (ccr - address 0x4004 6008) bit description . . . . . . . . . . . . .702 table 636. counter increment interrupt register (ciir - address 0x4004 600c) bit description . . . . . .703 table 637. alarm mask register (amr - address 0x4004 6010) bit description . . . . . . . . . . . . .703 table 638. consolidated time register 0 (ctime0 - address 0x4004 6014) bit description . . . . . . . . . . . . . 704 table 639. consolidated time register 1 (ctime1 - address 0x4004 6018) bit description . . . . . . . . . . . . . 704 table 640. consolidated time register 2 (ctime2 - address 0x4004 601c) bit description . . . . . . . . . . . . . 705 table 641. time counter relationships and values . . . . . 705 table 642. time counter registers . . . . . . . . . . . . . . . . . 705 table 643. second register (sec - address 0x4004 6020) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 706 table 644. minute register (min - address 0x4004 6024) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 706 table 645. hour register (hrs - address 0x4004 6028) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 706 table 646. days of month register (dom - address 0x4004 602c) bit description . . . . . . . . . . . . . 706 table 647. days of week register (dow - address 0x4004 6030) bit description . . . . . . . . . . . . . 706 table 648. days of year register (doy - address 0x4004 6034) bit description . . . . . . . . . . . . . 707 table 649. month register (month - address 0x4004 6038) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 707 table 650. year register ( year - address 0x4004 603c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 table 651. calibration register (calibration - address 0x4004 6040) bit description . . . . . . . . . . . . . 707 table 652. alarm registers . . . . . . . . . . . . . . . . . . . . . . . 708 table 653. alarm second register (asec - address 0x4004 6060) bit description . . . . . . . . . . . . . 708 table 654. alarm minute register (amin - address 0x4004 6064) bit description . . . . . . . . . . . . . 708 table 655. alarm hour register (ahrs - address 0x4004 6068) bit description . . . . . . . . . . . . . 709 table 656. alarm days of month register (adom - address 0x4004 606c) bit description . . . . . . . . . . . . . 709 table 657. alarm days of week register (adow - address 0x4004 6070) bit description . . . . . . . . . . . . . 709 table 658. alarm days of year register (adoy - address 0x4004 6074) bit description . . . . . . . . . . . . . 709 table 659. alarm month register (amon - address 0x4004 6078) bit description . . . . . . . . . . . . . 709 table 660. alarm year register (ayrs - address 0x4004 607c) bit description . . . . . . . . . . . . . 710 table 661. usart0/2/3 clocking and power control. . . . 712 table 662. usart0/2/3 pin description . . . . . . . . . . . . . 713 table 663. register overview: uart0/2/3 (base address: 0x4008 1000, 0x400c 1000, 0x400c 2000) . 713 table 664. uart receiver buffer registers when dlab = 0, read only (rbr - addresses 0x4008 1000 (uart0), 0x400c 1000 (uart2), 0x400c 2000 (uart3)) bit description . . . . . . . . . . . . . . . . 715 table 665. uart transmitter holding register when dlab = 0, write only(thr - addresses 0x4008 1000 (uart0), 0x400c 1000 (uart2), 0x400c 2000 (uart3)) bit description . . . . . 715 table 666. uart divisor latch lsb register when dlab = 1 (dll - addresses 0x4008 1000 (uart0), 0x400c 1000 (uart2), 0x400c 2000 (uart3)) bit description. . . . . . . . . . . . . . . . . 716 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1135 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 667. uart divisor latch msb register when dlab = 1 (dlm - addresses 0x4008 1004 (uart0), 0x400c 1004 (uart2), 0x400c 2004 (uart3)) bit description . . . . . . . . . . . . . . . . .716 table 668. uart interrupt enable register when dlab = 0 (ier - addresses 0x4008 1004 (uart0), 0x400c 1004 (uart2), 0x400c 2004 (uart3) ) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .716 table 669. uart interrupt identification register, read only (iir - addresses 0x4008 1008 (uart0), 0x400c 1008 (uart2), 0x400c 2008 (uart3)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .717 table 670. uart interrupt handling . . . . . . . . . . . . . . . .718 table 671. uart fifo control register write only (fcr - addresses 0x4008 1008 (uart0), 0x400c 1008 (uart2), 0x400c 2008 (uart3)) bit description. 719 table 672. uart line control register (lcr - addresses 0x4008 100c (uart0), 0x400c 100c (uart2), 0x400c 200c (uart3)) bit description . . . .720 table 673. uart line status register read only (lsr - addresses 0x4008 1014 (uart0), 0x400c 1014 (uart2), 0x400c 2014 (uart3) ) bit description 721 table 674. uart scratch pad register (scr - addresses 0x4008 101c (uart0), 0x400c 101c (uart2), 0x400c 201c (uart3)) bit description . . . . .723 table 675. autobaud control register (acr - addresses 0x4008 1020 (uart0), 0x400c 1020 (uart2), 0x400c 2020 (uart3)) bit description. . . . . .723 table 676. irda control register (icr - address 0x4000 8024) bit description . . . . . . . . . . . . .726 table 677. irda pulse width . . . . . . . . . . . . . . . . . . . . . .727 table 678. uart fractional divider register (fdr - addresses 0x4008 1028 (uart0), 0x400c 1028 (uart2), 0x400c 2028 (uart3)) bit description. 728 table 679. fractional divider setting look-up table . . . . .730 table 680. uart half duplex enable register (hden - addresses 0x4008 1040 (uart0), 0x400c 1040 (uart2), 0x400c 2040 (uart3)) bit description 731 table 681. uart smart card interface control register (scictrl - addresses 0x4008 1048 (uart0), 0x400c 1048 (uart2), 0x400c 2048 (uart3)) bit description . . . . . . . . . . . . . . . . . . . . . . . .731 table 682. uart rs485 control register (rs485ctrl - addresses 0x4008 104c (uart0), 0x400c 104c (uart2), 0x400c 204c (uart3)) bit description 732 table 683. uart rs485 address match register (rs485adrmatch - addresses 0x4008 1050 (uart0), 0x400c 1050 (uart2), 0x400c 2050 (uart3)) bit description . . . . . . . . . . . . . . . . .733 table 684. uart rs485 delay value register (rs485dly - addresses 0x4008 1054 (uart0), 0x400c 1054 (uart2), 0x400c 2054 (uart3)) bit description. 734 table 685. uart synchronous mode control registers (syncctrl - address addresses 0x4008 1058 (uart0), 0x400c 1058 (uart2), 0x400c 2058 (uart3)) bit description. . . . . . . . . . . . . . . . . 734 table 686. uart transmit enable register (ter - addresses 0x4008 1030 (uart0), 0x400c 1030 (uart2), 0x400c 205c (uart3)) bit description 736 table 687. uart1 clocking and power control . . . . . . . . 743 table 688: uart1 pin description . . . . . . . . . . . . . . . . . 744 table 689: register overview: uart1 (base address 0x4008 2000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745 table 690: uart1 receiver buffer register when dlab = 0 (rbr - address 0x4008 2000 ) bit description . . 747 table 691: uart1 transmitter holding register when dlab = 0 (thr - address 0x4008 2000 ) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 747 table 692: uart1 divisor latch lsb register when dlab = 1 (dll - address 0x4008 2000 ) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 748 table 693: uart1 divisor latch msb register when dlab = 1 (dlm - address 0x4008 2004 ) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 748 table 694: uart1 interrupt enable register when dlab = 0 (ier - address 0x4008 2004 ) bit description. 748 table 695: uart1 interrupt identification register (iir - address 0x4008 2008) bit description . . . . . . 749 table 696: uart1 interrupt handling . . . . . . . . . . . . . . . 750 table 697: uart1 fifo control register (fcr - address 0x4008 2008) bit description . . . . . . . . . . . . . 751 table 698: uart1 line control register (lcr - address 0x4008 200c) bit description . . . . . . . . . . . . . 753 table 699: uart1 modem control register (mcr - address 0x4008 2010) bit description . . . . . . . . . . . . . 753 table 700: modem status interrupt generation . . . . . . . . 755 table 701: uart1 line status register (lsr - address 0x4008 2014) bit description . . . . . . . . . . . . . 756 table 702: uart1 modem status register (msr - address 0x4008 2018) bit description . . . . . . . . . . . . . 758 table 703: uart1 scratch pad register (scr - address 0x4008 2014) bit description . . . . . . . . . . . . . 758 table 704: autobaud control register (acr - address 0x4008 2020) bit description . . . . . . . . . . . . . 759 table 705: uart1 fractional divider register (fdr - address 0x4008 2028) bit description . . . . . . 762 table 706. fractional divider setting look-up table . . . . . 764 table 707: uart1 transmit enable register (ter - address 0x4008 2030) bit description . . . . . . . . . . . . . 765 table 708: uart1 rs485 control register (rs485ctrl - address 0x4008 204c) bit description . . . . . . 765 table 709. uart1 rs485 address match register (rs485adrmatch - address 0x4008 2050) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 766 table 710. uart1 rs485 delay value register (rs485dly - address 0x4008 2054) bit description . . . . . . 766 table 711. uart1 fifo level register (fifolvl - address 0x4008 2058) bit description . . . . . . . . . . . . . 768 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1136 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 712. ssp0/1 clocking and power control . . . . . . . .770 table 713. ssp pin description . . . . . . . . . . . . . . . . . . . .771 table 714. register overview: ssp0 (base address 0x4008 3000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .771 table 715. register overview : ssp1 (base address 0x400c 5000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .772 table 716: ssp control regi ster 0 (cr0 - address 0x4008 3000 (ssp0), 0x 400c 5000 (ssp1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .773 table 717: ssp control regi ster 1 (cr1 - address 0x4008 3004 (ssp0), 0x 400c 5004 (ssp1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .774 table 718: ssp data register (dr - address 0x4008 3008 (ssp0), 0x400c 5008 (ssp1)) bit description 774 table 719: ssp status register (sr - address 0x4008 300c (ssp0), 0x400c 500c (ssp1)) bit description775 table 720: ssp clock prescale register (cpsr - address 0x4008 3010 (ssp0), 0x 400c 5010 (ssp1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .775 table 721: ssp interrupt mask se t/clear register (imsc - address 0x4008 3014 (ssp0), 0x400c 5014 (ssp1)) bit description . . . . . . . . . . . . . . . . . .776 table 722: ssp raw interrupt stat us register (ris - address 0x4008 3018 (ssp0), ris - 0x400c 5018 (ssp1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . .776 table 723: ssp masked interrupt status register (mis -address 0x4008 301c (ssp0), 0x400c 501c (ssp1)) bit description . . . . . . . . . . . . . . . . . .777 table 724: ssp interrupt clear register (icr - address 0x4008 3020 (ssp0), icr - 0x400c 5020 (ssp1)) bit description . . . . . . . . . . . . . . . . . .777 table 725: ssp dma control re gister (dmacr - address 0x4008 3024 (ssp0), 0x 400c 5024 (ssp1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .778 table 726. i2s clocking and power control . . . . . . . . . . .785 table 727. pin description . . . . . . . . . . . . . . . . . . . . . . . .788 table 728. register overview: i2s0 (base address 0x400a 2000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .790 table 729. register overview: i2s1 (base address 0x400a 3000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .790 table 730. i2s digital audio output register (dao - address 0x400a 2000 (i2s0) and 0x400a 3000 (i2s1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .791 table 731. i2s digital audio input register (dai - address 0x400a 2004 (i2s0) and 0x400a 3004 (i2s1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .792 table 732. transmit fifo register (txfifo - address 0x400a 2008 (i2s0) and 0x400a 3008 (i2s1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .792 table 733. i2s receive fifo register (rxfifo - address 0x400a 200c (i2s0) and 0x400a 300c (i2s1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .792 table 734. i2s status feedback register (state - address 0x400a 2010 (i2s0) and 0x400a 3010 (i2s1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .793 table 735. i2s dma configuration register 1 (dma1 - address 0x400a 2014 (i2s0) and 0x400a 3014 (i2s1)) bit description . . . . . . . . . . . . . . . . . . .793 table 736. i2s dma configuration register 2 (dma2 - address 0x400a 2018 (i2s0) and 0x400a 3018 (i2s1)) bit description. . . . . . . . . . . . . . . . . . . 794 table 737. i2s interrupt request control register (irq - address 0x400a 201c (i2s0) and 0x400a 301c (i2s1)) bit description. . . . . . . . . . . . . . . . . . . 794 table 738. i2s transmit clock rate register (txrate - address 0x400a 2020 (i2s0) and 0x400a 3020 (i2s1)) bit description. . . . . . . . . . . . . . . . . . . 795 table 739. i2s receive clock rate register (rxrate - address 0x400a 2024 (i2s0) and 0x400a 3024 (i2s1)) bit description. . . . . . . . . . . . . . . . . . . 796 table 740. i2s transmit clock rate register (txbitrate - address 0x400a 2028 (i2s0) and 0x400a 3028 (i2s1)) bit description. . . . . . . . . . . . . . . . . . . 796 table 741. i2s receive clock rate register (rxbitrate - address 0x400a 202c (i2s0) and 0x400a 302c (i2s1)) bit description. . . . . . . . . . . . . . . . . . . 797 table 742. i2s transmit mode control register (txmode - address 0x400a 2030 (i2s0) and 0x400a 3030 (i2s1)) bit description. . . . . . . . . . . . . . . . . . . 797 table 743. i2s receive mode control register (rxmode - address 0x400a 2034 (i2s0) and 0x400a 3034 (i2s1)) bit description. . . . . . . . . . . . . . . . . . . 797 table 744. i2s transmit modes . . . . . . . . . . . . . . . . . . . . 799 table 745. i2s receive modes . . . . . . . . . . . . . . . . . . . . 802 table 746. conditions for fifo level comparison . . . . . . 804 table 747. dma and interrupt request generation . . . . . 804 table 748. status feedback in the state register . . . . . 804 table 749. c_can clocking and power control . . . . . . . 806 table 750. c_can pin description . . . . . . . . . . . . . . . . . 808 table 751. register overview: c_can0 (base address 0x400e 2000). . . . . . . . . . . . . . . . . . . . . . . . . 809 table 752. register overview: c_can1 (base address 0x400a 4000). . . . . . . . . . . . . . . . . . . . . . . . . 810 table 753. can control registers (cntl, address 0x400e 2000 (c_can0) and 0x400a 4000 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812 table 754. can status register (stat, address 0x400e 2004 (c_can0) and 0x400a 4004 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814 table 755. can error counter (ec, address 0x400e 2008 (c_can0) and 0x400a 4008 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 815 table 756. can bit timing register (bt, address 0x400e 200c (c_can0) and 0x400a 400c (c_can1)) bit description . . . . . . . . . . . . . . . 816 table 757. can interrupt register (int, address 0x400e 2010 (c_can0) and 0x400a 4010 (c_can1)) bit description . . . . . . . . . . . . . . . 816 table 758. can test register (test, address 0x400e 2014 (c_can0) and 0x400a 4014 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 817 table 759. can baud rate prescaler extension register (brpe, address 0x400e 2018 (c_can0) and 0x400a 4018 (c_can1)) bit description . . . . 817 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1137 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 760. message interface registers. . . . . . . . . . . . . .819 table 761. structure of a message object in the message ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .819 table 762. can message interface command request registers (if1_cmdreq, address 0x400e 2020 (c_can0) and 0x400a 4020 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .820 table 763. can message interface command request registers (if2_cmdreq, address 0x400e 2080 (c_can0) and 0x400a 4080 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .820 table 764. can message interface command mask registers write direction (if1_cmdmsk, address 0x400e 2024 (c_can0) and 0x400a 4024 (c_can1)) bit description . . . . . . . . . . . . . . .821 table 765. can message interface command mask registers write direction (if2_cmdmsk, address 0x400e 2084 (c_can0) and 0x400a 4080 (c_can1)) bit description . . . . . . . . . . . . . . .822 table 766. can message interface command mask registers read directio n (if1_cmdmsk, address 0x400e 2024 (c_can0) and 0x400a 4024 (c_can1)) bit description. . . . . . . . . . . . . . . .823 table 767. can message interface command mask registers read directio n (if2_cmdmsk, address 0x400e 2084 (c_can0) and 0x400a 4024 (c_can1)) bit description. . . . . . . . . . . . . . . .824 table 768. can message interface command mask 1 registers (if1_msk1, address 0x400e 2028 (c_can0) and 0x400a 4028 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .825 table 769. can message interface command mask 1 registers (if2_msk1, address 0x400e 2088 (c_can0) and 0x400a 4028 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .825 table 770. can message interface command mask 2 registers (if1_msk2, address 0x400e 202c (c_can0) and 0x400a 402c (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .826 table 771. can message interface command mask 2 registers (if2_msk2, 0x400e 208c (c_can0) and 0x400a 402c (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .826 table 772. can message interface command arbitration 1 registers (if1_arb1, address 0x400e 2030 (c_can0) and 0x400a 4030 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .827 table 773. can message interface command arbitration 1 registers (if2_arb1, address 0x400e 2090 (c_can0) and 0x400a 4090 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .827 table 774. can message interface command arbitration 2 registers (if1_arb2, address 0x400e 2034 (c_can0) and 0x400a 4034 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .827 table 775. can message interface command arbitration 2 registers (if2_arb2, address 0x400e 2094 (c_can0) and 0x400a 4094 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 828 table 776. can message interface message control registers (if1_mctrl, address 0x400e 2038 (c_can0) and 0x400a 4038 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 829 table 777. can message interface message control registers (if2_mctrl, address 0x400e 2098 (c_can0) and 0x400a 4098 (c_can1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 831 table 778. can message interface data a1 registers (if1_da1, address 0x400e 203c (c_can0) and 0x400a 403c (c_can1)) bit description . . . . 832 table 779. can message interface data a1 registers (if2_da1, address 0x400e 209c (c_can0) and 0x400a 409c (c_can1)) bit description . . . . 833 table 780. can message interface data a2 registers (if1_da2, address 0x400e 2040 (c_can0) and 0x400a 4040 (c_can1)) bit description . . . . 833 table 781. can message interface data a2 registers (if2_da2, address 0x400e 20a0 (c_can0) and 0x400a 40a0 (c_can1)) bit description . . . . 833 table 782. can message interface data b1 registers (if1_db1, address 0x400e 2044 (c_can0) and 0x400a 4044 (c_can1)) bit description . . . . 833 table 783. can message interface data b1 registers (if2_db1, address 0x400e 20a4 (c_can0) and 0x400a 40a4 (c_can1)) bit description . . . . 833 table 784. can message interface data b2 registers (if1_db2, address 0x400e 2048 (c_can0) and 0x400a 4048 (c_can1)) bit description . . . . 833 table 785. can message interface data b2 registers (if2_db2, address 0x400e 20a8 (c_can0) and 0x400a 40a8 (c_can1)) bit description . . . . 834 table 786. can transmission request 1 register (txreq1, address 0x400e 2100 (c_can0) and 0x400a 4100 (c_can1)) bit description . . . . . . . . . . . 834 table 787. can transmission request 2 register (txreq2, address 0x400e 2104 (c_can0) and 0x400a 4104 (c_can1)) bit description . . . . . . . . . . . 834 table 788. can new data 1 register (nd1, address 0x400e 2120 (c_can0) and 0x400a 4120 (c_can1)) bit description . . . . . . . . . . . . . . . 835 table 789. can new data 2 register (nd2, address 0x400e 2124 (c_can0) and 0x400a 4124 (c_can1)) bit description . . . . . . . . . . . . . . . 835 table 790. can interrupt pending 1 register (ir1, address 0x400e 2140 (c_can0) and 0x400a 4140 (c_can1)) bit description . . . . . . . . . . . . . . . 836 table 791. can interrupt pending 2 register (ir2, addresses 0x400e 2144 (c_can0) and 0x400a 4144 (c_can1)) bit description . . . . . . . . . . . . . . . 836 table 792. can message valid 1 register (msgv1, addresses 0x400e 2160 (c_can0) and 0x400a 4160 (c_can1)) bit description . . . . . . . . . . . 836 table 793. can message valid 2 register (msgv2, address 0x400e 2164 (c_can0) and 0x400a 4164 (c_can1)) bit description . . . . . . . . . . . . . . . 837 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1138 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 794. can clock divider register (clkdiv, address 0x400e 2180 (c_can0) and 0x400a 4180 (c_can1)) bit description. . . . . . . . . . . . . . . .837 table 795. initialization of a transmit object. . . . . . . . . . .846 table 796. initialization of a receive object . . . . . . . . . . .847 table 797. parameters of the c_can bit time. . . . . . . . .851 table 798. i2c0/1 clocking and power control. . . . . . . . .853 table 799. i 2 c-bus pin description. . . . . . . . . . . . . . . . . .855 table 800. register overview: i 2 c0 (base address 0x400a 1000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .855 table 801. register overview: i 2 c1 (base address 0x400e 0000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .856 table 802. i 2 c control set register (conset - address 0x400a 1000 (i2c0) and 0x400e 0000 (i2c1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .858 table 803. i 2 c status register (stat - address 0x400a 1004 (i2c0) and 0x400e 0004 (i2c1)) bit description . . 859 table 804. i 2 c data register (dat - 0x400a 1008 (i2c0) and 0x400e 0008 (i2c1)) bit description . . . . . . . .860 table 805. i 2 c slave address register 0 (adr0 - address 0x400a 100c (i2c0) and 0x400e 000c (i2c1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .860 table 806. i 2 c scl high duty cycle register (sclh - address 0x400a 1010 (i2c0) and 0x400e 0010 (i2c1)) bit description . . . . . . . . . . . . . . . . . . .860 table 807. i 2 c scl low duty cycle register (scll - address 0x400a 1014 (i2c0) and 0x400e 0014 (i2c1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .860 table 808. scll + sclh values for selected i 2 c clock values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .861 table 809. i 2 c control clear register (conclr - address 0x400a 1018 and 0x400e 0018 (i2c1)) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .861 table 810. i 2 c monitor mode control register (mmctrl - address 0x400a 101c (i2c0) and 0x400e 001c (i2c1)) bit description . . . . . . . . . . . . . . . . . . .862 table 811. i 2 c slave address registers (adr - address 0x400a 1020 (adr1) to 0x400a 1028 (adr3) (i2c0) and 0x400e 0020 (adr1) to 0x400e 0028 (adr3) (i2c1)) bit description . . . . . . . . . . . .863 table 812. i 2 c data buffer register (data_buffer - address 0x400a 102c (i2c0) and 0x400e 002c (i2c1)) bit description . . . . . . . . . . . . . . . . . . .864 table 813. i 2 c mask registers (mask - address 0x400a 1030 (mask0) to 0x400a 103c (mask3) (i2c0) and 0x400e 0030 (mask0) to 0x400e 003c (mask3) (i2c1)) bit description . . . . . .865 table 814. conset used to configure master mode . . .865 table 815. conset used to configure slave mode . . . .867 table 816. abbreviations used to describe an i 2 c operation. 873 table 817. conset used to initialize master transmitter mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .873 table 818. master transmitter mode. . . . . . . . . . . . . . . .875 table 819. master receiver mode. . . . . . . . . . . . . . . . . .878 table 820. adr usage in slave receiver mode . . . . . . .880 table 821. conset used to initialize slave receiver mode 880 table 822. slave receiver mode . . . . . . . . . . . . . . . . . 881 table 823. slave transmitter mode . . . . . . . . . . . . . . . . 885 table 824. miscellaneous states . . . . . . . . . . . . . . . . . . 887 table 825. adc0/1 clocking and power control . . . . . . . 898 table 826. adc pin description . . . . . . . . . . . . . . . . . . . 899 table 827. register overview: adc0 (base address 0x400e 3000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899 table 828. register overview: adc1 (base address 0x400e 4000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900 table 829. a/d control register (cr - address 0x400e 3000 (adc0) and 0x400e 4000 (adc1)) bit description 901 table 830. a/d global data register (gdr - address 0x400e 3004 (adc0) and 0x400e 4004 (adc1)) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 903 table 831. a/d interrupt enable register (inten - address 0x400e 300c (adc0) and 0x400e 400c (adc1)) bit description. . . . . . . . . . . . . . . . . . . . . . . . . 904 table 832. a/d data registers (dr - addresses 0x400e 3010 (dr0) to 0x400e 302c (dr7) (adc0); 0x400e 4010 (dr0) to 0x400e 402c (dr7) (adc1)) bit description. . . . . . . . . . . . . . . . . . 904 table 833. a/d status register (stat - address 0x400e 3030 (adc0) and 0x400e 4030 (adc1)) bit description 905 table 834. dac clocking and power control . . . . . . . . . . 906 table 835. dac pin description . . . . . . . . . . . . . . . . . . . 906 table 836. register overview: dac (base address 0x400e 1000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907 table 837: d/a converter register (cr - address 0x400e 1000) bit description. . . . . . . . . . . . . . . . . . . . 907 table 838. d/a control register (ctrl - address 0x400e 1004) bit description . . . . . . . . . . . . . 907 table 839: d/a converter counter value register (cntval - address 0x400e 1008) bit description . . . . . . 908 table 840. flash configuration . . . . . . . . . . . . . . . . . . . . 914 table 841. code read protection options . . . . . . . . . . . 915 table 842. code read protection hardware/software interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . 916 table 843. isp command summary . . . . . . . . . . . . . . . . 917 table 844. isp unlock command . . . . . . . . . . . . . . . . . . 917 table 845. isp set baud rate command . . . . . . . . . . . . 918 table 846. correlation between possible isp baudrates and cclk frequency (in mhz) . . . . . . . . . . . . . . . 918 table 847. isp echo command . . . . . . . . . . . . . . . . . . . 918 table 848. isp write to ram command . . . . . . . . . . . . . 919 table 849. isp read memory command . . . . . . . . . . . . 919 table 850. isp prepare sector(s) for write operation command . . . . . . . . . . . . . . . . . . . . . . . . . . . . 920 table 851. isp copy command . . . . . . . . . . . . . . . . . . . 920 table 852. isp go command . . . . . . . . . . . . . . . . . . . . . 921 table 853. isp erase sector command . . . . . . . . . . . . . 921 table 854. isp blank check sector command . . . . . . . . 922 table 855. isp read part identification command . . . . . 922 table 856. lpc18xx part identification numbers. . . . . . . 922 table 857. isp read boot code version number command 922 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1139 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 858. isp read device serial number command. . .922 table 859. isp compare command. . . . . . . . . . . . . . . . .923 table 860. isp return codes summary . . . . . . . . . . . . .923 table 861. iap command summary . . . . . . . . . . . . . . . .926 table 862. iap prepare sector(s) for write operation command . . . . . . . . . . . . . . . . . . . . . . . . . . . .927 table 863. iap copy ram to flash command . . . . . . . .927 table 864. iap erase sector(s) command . . . . . . . . . . .928 table 865. iap blank check sector(s) command . . . . . . .928 table 866. iap read part identification number command . . 928 table 867. iap read boot code version number command . 929 table 868. iap read device serial number command. . .929 table 869. iap compare command. . . . . . . . . . . . . . . . .929 table 870. re-invoke isp . . . . . . . . . . . . . . . . . . . . . . . .930 table 871. iap status codes summary . . . . . . . . . . . . .930 table 872. register overview: fmc (base address 0x4008 4000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .931 table 873. flash module signature start register (fmsstart - 0x4008 4020) bit description . .932 table 874. flash module signature stop register (fmsstop - 0x4008 4024) bit description . . . . . . . . . . . .932 table 875. fmsw0 register bit description (fmsw0, address: 0x4008 402c) . . . . . . . . . . . . . . . . .932 table 876. fmsw1 register bit description (fmsw1, address: 0x4008 4030) . . . . . . . . . . . . . . . . .932 table 877. fmsw2 register bit description (fmsw2, address: 0x4008 4034) . . . . . . . . . . . . . . . . .933 table 878. fmsw3 register bit description (fmsw3, address: 0x4008 4038) . . . . . . . . . . . . . . . . .933 table 879. flash module status register (fmstat - 0x4008 4fe0) bit description. . . . . . . . . . . . . . . . . . . .933 table 880. flash module status clear register (fmstatclr - 0x0x4008 4fe8) bit description . . . . . . . . . .933 table 881. jtag pin description . . . . . . . . . . . . . . . . . . .936 table 882. serial wire debug pin description . . . . . . . . .936 table 883. parallel trace pin description. . . . . . . . . . . . .936 table 884. nvic pin description . . . . . . . . . . . . . . . . . . .938 table 885. connection of interrupt sources to the nvic .939 table 886. register overview: nvic (base address 0xe000 e000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .941 table 887. interrupt set-enable register 0 register (iser0 - address 0xe000 e100) bit description . . . . .942 table 888. interrupt clear-enable register 0 (icer0 - address 0xe000 e180) bit description . . . . .944 table 889. interrupt set-pending register 0 register (ispr0 - address 0xe000 e200) bit description . . . .947 table 890. interrupt clear-pending register 0 register (icpr0 - address 0xe000 e280) bit description . 949 table 891. interrupt active bit register 0 (iabr0 - address 0xe000 e300) bit description . . . . . . . . . . . .951 table 892. interrupt priority register 0 (ipr0 - address 0xe000 e400) bit description . . . . . . . . . . . . .953 table 893. interrupt priority register 1 (ipr1 - address 0xe000 e404) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . .953 table 894. interrupt priority register 2 (ipr2 - address 0xe000 e408) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . 954 table 895. interrupt priority register 3 (ipr3 - address 0xe000 e40c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 954 table 896. interrupt priority register 4 (ipr4 - address 0xe000 e410) bit description . . . . . . . . . . . . . 955 table 897. interrupt priority register 5 (ipr5 - address 0xe000 e414) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 955 table 898. interrupt priority register 6 (ipr6 - address 0xe000 e418) bit description . . . . . . . . . . . . 955 table 899. interrupt priority register 7 (ipr7 - address 0xe000 e41c) bit description . . . . . . . . . . . . 956 table 900. software trigger interrupt register (stir - address 0xe000 ef00) bit description . . . . . 956 table 901. event router clocking and power control . . . . 957 table 902. event router inputs . . . . . . . . . . . . . . . . . . . . 958 table 903. event router pin description . . . . . . . . . . . . . 958 table 904. register overview: event router (base address 0x4004 4000) . . . . . . . . . . . . . . . . . . . . . . . . . 958 table 905. level configuration register (hilo - address 0x4004 4000) bit description . . . . . . . . . . . . 959 table 906. edge and hilo combined register settings. 961 table 907. edge configuration register (edge - address 0x4004 4004) bit description . . . . . . . . . . . . 961 table 908. interrupt clear enable register (clr_en - address 0x4004 4fd8) bit description . . . . . . 964 table 909. event set enable register (set_en - address 0x4004 4fdc) bit description . . . . . . . . . . . . 965 table 910. interrupt status register (status - address 0x4004 4fe0) bit description . . . . . . . . . . . . . 966 table 911. event enable register (enable - address 0x4004 4fe4) bit description . . . . . . . . . . . . . . . . . . . 967 table 912. interrupt clear status register (clr_stat - address 0x4004 4fe8) bit description . . . . . . 968 table 913. interrupt set status register (set_stat - address 0x4004 4fec) bit description. . . . . . . . . . . . . 969 table 914. creg clocking and power control . . . . . . . . 970 table 915. register overview: configuration registers (base address 0x4004 3000) . . . . . . . . . . . . . . . . . . 971 table 916. irc trim register (irctrm, address 0x4004 3000) bit description . . . . . . . . . . . . . . . . . . . 971 table 917. creg0 register (creg0, address 0x4004 3004) bit description . . . . . . . . . . . . . . . . . . . . . . . . 972 table 918. power mode control register (pmucon, address 0x4004 3008) bit description . . . . . . . . . . . . 972 table 919. memory mapping register (m3memmap, address 0x4004 3100) bit description . . . . . . . . . . . . 973 table 920. creg5 control register (creg5, address 0x4004 3118) bit description . . . . . . . . . . . . 973 table 921. dma muxing register (dmamux, address 0x4004 311c) bit description . . . . . . . . . . . . 973 table 922. etb sram configuration register (etbcfg, address 0x4004 3128) bit description . . . . . 976 table 923. creg6 control register (creg6, address 0x4004 312c) bit description . . . . . . . . . . . . 976 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1140 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 924. part id register (chipid, address 0x4004 3200) bit description . . . . . . . . . . . . . . . . . . . . . . . .977 table 925. cgu clocking and power control . . . . . . . . . .978 table 926. cgu0 base clocks . . . . . . . . . . . . . . . . . . . .979 table 927. clock sources for clock generators with selectable inputs . . . . . . . . . . . . . . . . . . . . . . .980 table 928. clock sources for output stages. . . . . . . . . . .980 table 929. cgu pin description. . . . . . . . . . . . . . . . . . . .982 table 930. register overview: cgu (base address 0x4005 0000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .982 table 931. freq_mon register (freq_mon, address 0x4005 0014) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .984 table 932. xtal_osc_ctrl register (xtal_osc_ctrl, address 0x4005 0018) bit description. . . . . . .985 table 933. pll0_stat register (pll0_stat, address 0x4005 001c) bit description . . . . . . . . . . . . .986 table 934. pll0_ctrl register (pll0_ctrl, address 0x4005 0020) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .986 table 935. pll0_mdiv register (pll0_mdiv, address 0x4005 0024) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .987 table 936. pll0_npdiv register (pll0_np_div, address 0x4005 0028) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .987 table 937. pll1_stat register (pll1_stat, address 0x4005 002c) bit description . . . . . . . . . . . . .988 table 938. pll1_ctrl register (pll1_ctrl, address 0x4005 0030) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .988 table 939. idiva control register (idiva_ctrl, address 0x4005 0034) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .989 table 940. idivb/c/d control registers (idivb_ctrl, address 0x4005 0038; idivc_ctrl, address 0x4005 003c; idivc_ctrl, address 0x4005 0040) bit description . . . . . . . . . . . . . . . . . . .990 table 941. idive control register (idive_ctrl, address 0x4005 0044) bit description . . . . . . . . . . . .991 table 942. output stage 0 control register (outclk_0_ctrl, address 0x4005 0048) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .992 table 943. output stage 1 control register (outclk_1_ctrl, address 0x4005 004c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .993 table 944. output stage 3 to 19 control registers (outclk_2_ctrl to outclk_19_ctrl, address 0x4005 0050 to 0x4005 0094) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .993 table 945. output stage 20 control register (outclk_20_ctrl, addresses 0x4005 0098) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .994 table 946. recommended values for c x1/x2 in oscillation mode (crystal and external components parameters) low frequency mode . . . . . . . . .996 table 947. recommended values for c x1/x2 in oscillation mode (crystal and external components parameters) high frequency mode . . . . . . . . 997 table 948. pll operating modes . . . . . . . . . . . . . . . . . . 998 table 949. directl and directo bit settings in hp0/1_mode register . . . . . . . . . . . . . . . . . . . 999 table 950. system pll divider ratio settings for 12 mhz . . . 1000 table 951. ccu clocking and power control . . . . . . . . . 1005 table 952. ccu1 branch clocks . . . . . . . . . . . . . . . . . . 1005 table 953. ccu2 branch clocks . . . . . . . . . . . . . . . . . . 1007 table 954. register overview: ccu1 (base address 0x4005 1000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1008 table 955. register overview: ccu2 (base address 0x4005 2000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1010 table 956. ccu1/2 power mode register (ccu1_pm, address 0x4005 1000 and ccu2_pm, address 0x4005 2000) bit description . . . . . . . . . . . . 1011 table 957. ccu1 base clock status register (ccu1_base_stat, address 0x4005 1004) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 1012 table 958. ccu2 base clock status register (ccu2_base_stat, address 0x4005 2004) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 1012 table 959. ccu1 branch clock configuration register (clk_xxx_cfg, addresses 0x4005 1100, 0x4005 1104,..., 0x4005 1a00) bit description . . 1014 table 960. ccu2 branch clock configuration register (clk_xxx_cfg, addresses 0x4005 2100, 0x4005 2200,..., 0x4005 2800) bit description . . 1014 table 961. ccu1 branch clock status register (clk_xxx_stat, addresses 0x4005 1104, 0x4005 110c,..., 0x4005 1a04) bit description . . 1015 table 962. ccu2 branch clock status register (clk_xxx_stat, addresses 0x4005 2104, 0x4005 2204,..., 0x4005 2804) bit description . . 1015 table 963. pin description . . . . . . . . . . . . . . . . . . . . . . 1015 table 964. scu clocking and power control . . . . . . . . . 1040 table 965. register overview: system control unit (scu) (base address 0x4008 6000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041 table 966. pin configuration for pins p0_n to pf_n and clk0 to clk3 registers (s fspy_x, address 0x4008 6000 to 0x4008 6c0c) bit description . . . . 1047 table 967. pin configuration for pins dp1/dm1 register (sfsusb, address 0x4008 6c80) bit description 1047 table 968. pin configuration for open-drain i 2 c-bus pins register (sfsi2c0, address 0x4008 6c84) bit description . . . . . . . . . . . . . . . . . . . . . . . . . 1048 table 969. emc clock delay register (emcclkdelay, address 0x4008 6d00) bit description . . . . 1048 table 970. emc control delay register (emcctrldelay, address 0x4008 6d04) bit description . . . . 1049 table 971. emc chip select delay register (emccsdelay, address 0x4008 6d08) bit description . . . . 1050 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1141 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information table 972. emc data out delay register (emcdoutdelay, address 0x4008 6d0c) bit description . . . .1050 table 973. emc dqm delay register (emcfbclkdelay, address 0x4008 6d10) bit description . . . .1051 table 974. emc address delay register 0 (emcaddrdelay0, address 0x4008 6d14) bit description . . . . . . . . . . . . . . . . . . . . . . . . .1051 table 975. emc address delay register 1 (emcaddrdelay1, address 0x4008 6d18) bit description . . . . . . . . . . . . . . . . . . . . . . . . .1052 table 976. emc address delay register 2 (emcaddrdelay2, address 0x4008 6d1c) bit description . . . . . . . . . . . . . . . . . . . . . . . . .1053 table 977. emc data in delay register 3 (emcdindelay, address 0x4008 6d24) bit description . . . .1053 table 978. gpio clocking and power control . . . . . . . .1054 table 979. gpio pin description . . . . . . . . . . . . . . . . . .1054 table 980. register overview: gpio (register base address: 0x400f 0000) . . . . . . . . . . . . . . . . . . . . . . .1055 table 981. gpio port direction register (dir0 to dir4 - addresses 0x400f 0000 to 0x400f 0080) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .1056 table 982. gpio port direction control byte and halfword accessible register view . . . . . . . . . . . . . . . .1057 table 983. gpio port mask register (mask0 to mask4 - addresses 0x400f 0010 to 0x400f 0090) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .1057 table 984. gpio port mask byte and half-word accessible register description . . . . . . . . . . . . . . . . . . . .1058 table 985. gpio port pin value register (pin0 to pin0 - addresses 0x400f 0014 to 0x400f 0094) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .1059 table 986. gpio port pin value byte and half-word accessible register description . . . . . . . . . . .1059 table 987. gpio port output set register (set0 to set4 - addresses 0x400f 0018 to 0x400f 0098) bit description . . . . . . . . . . . . . . . . . . . . . . . . . .1060 table 988. gpio port output set byte and half-word accessible register description . . . . . . . . . . .1060 table 989. gpio port output clear register (clr0 to clr4 - 0x400f 001c to 0x400f 009c) bit description . . . 1061 table 990. gpio port output clear byte and half-word accessible register description . . . . . . . . . . .1061 table 991. i2s clocking and power control . . . . . . . . . .1062 table 992. pin description . . . . . . . . . . . . . . . . . . . . . . .1064 table 993. register overview: i2s (base address 0x400a 2000) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1066 table 994. i2s digital audio output register (dao - address 0x400a 2000) bit description . . . . . . . . . . . .1067 table 995. i2s digital audio input register (dai - address 0x400a 2004) bit description . . . . . . . . . . . .1067 table 996. transmit fifo register (txfifo - address 0x400a 2008) bit description . . . . . . . . . . . .1068 table 997. i2s receive fifo register (rxfifo - address 0x400a 200c) bit description . . . . . . . . . . . .1068 table 998. i2s status feedback register (state - address 0x400a 2010) bit description . . . . . . . . . . . .1068 table 999. i2s dma configuration register 1 (dma1 - address 0x400a 2014) bit description . . . . . 1069 table 1000. i2s dma configuration register 2 (dma2 - address 0x400a 2018) bit description . . . . . 1069 table 1001. i2s interrupt request control register (irq - address 0x400a 201c) bit description . . . . . 1069 table 1002. i2s transmit clock rate register (txrate - address 0x400a 2020) bit description . . . . . 1070 table 1003. i2s receive clock rate register (rxrate - address 0x400a 2024) bit description . . . . . 1071 table 1004. i2s transmit clock rate register (txbitrate - address 0x400a 2028) bit description . . . . . 1071 table 1005. i2s receive clock rate register (rxbitrate - address 0x400a 202c) bit description . . . . . 1072 table 1006. i2s transmit mode control register (txmode - address 0x400a 2030) bit description . . . . . 1072 table 1007. i2s receive mode control register (rxmode - address 0x400a 2034) bit description . . . . . 1072 table 1008. i2s transmit modes . . . . . . . . . . . . . . . . . . 1074 table 1009. i2s receive modes . . . . . . . . . . . . . . . . . . 1076 table 1010. conditions for fifo level comparison . . . . 1079 table 1011. dma and interrupt request generation . . . 1079 table 1012. status feedback in the state register . . . 1079 table 1013. c_can clocking and power control . . . . . 1080 table 1014. c_can pin description . . . . . . . . . . . . . . . 1082 table 1015. register overview: c_can0 (base address 0x400e 2000). . . . . . . . . . . . . . . . . . . . . . . . 1083 table 1016. can control registers (cntl, address 0x400e 2000) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1085 table 1017. can status register (stat, address 0x400e 2004) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1086 table 1018. can error counter (ec, address 0x400e 2008) bit description . . . . . . . . . . . . . . . . . . . . . . . 1087 table 1019. can bit timing register (bt, address 0x400e 200c) bit description. . . . . . . . . . . . 1088 table 1020. can interrupt register (int, address 0x400e 2010) bit description . . . . . . . . . . . . 1088 table 1021. can test register (test, address 0x400e 2014) bit description. . . . . . . . . . . . . . . . . . . . . . . . 1089 table 1022. can baud rate prescaler extension register (brpe, address 0x400e 2018) bit description. . . 1089 table 1023. message interface registers . . . . . . . . . . . 1091 table 1024. structure of a message object in the message ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091 table 1025. can message interface command request registers (if1_cmdreq, address 0x400e 2020 and if2_cmdreq, address 0x400e 2080) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . 1092 table 1026. can message interface command mask registers write direction (if1_cmdmsk, address 0x400e 2024 and if2_cmdmsk, address 0x400e 2084) bit description . . . . . . . . . . . 1092 table 1027. can message interface command mask registers read direction (if1_cmdmsk, address 0x400e 2024 and if2_cmdmsk, address www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1142 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 0x400e 2084) bit description . . . . . . . . . . . .1093 table 1028. can message interface command mask 1 registers (if1_msk1, address 0x400e 2028 and if2_msk1, address 0x400e 2088) bit description 1095 table 1029. can message interface command mask 2 registers (if1_msk2, address 0x400e 202c and if2_msk2, 0x400e 208c) bit description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1095 table 1030. can message interface command arbitration 1 registers (if1_arb1, address 0x400e 2030 and if2_arb1, address 0x400e 2090) bit description 1095 table 1031. can message interface command arbitration 2 registers (if1_arb2, address 0x400e 2034 and if2_arb2, address 0x400e 2094) bit description 1096 table 1032. can message interface message control registers (if1_mctrl, address 0x400e 2038 and if2_mctrl, address 0x400e 2098) bit description . . . . . . . . . . . . . . . . . . . . . . . . .1097 table 1033. can message interface data a1 registers (if1_da1, address 0x400e 203c and if2_da1, address 0x400e 209c) bit description . . . . .1098 table 1034. can message interface data a2 registers (if1_da2, address 0x400e 2040 and if2_da2, address 0x400e 20a0) bit description . . . . .1099 table 1035. can message interface data b1 registers (if1_db1, address 0x400e 2044 and if2_db1, address 0x400e 20a4) bit description . . . . .1099 table 1036. can message interface data b2 registers (if1_db2, address 0x400e 2048 and if2_db2, address 0x400e 20a8) bit description . . . . .1099 table 1037. can transmission request 1 register (txreq1, address 0x400e 2100) bit description . . . . .1099 table 1038. can transmission request 2 register (txreq2, address 0x400e 2104) bit description . . . . . 1100 table 1039. can new data 1 register (nd1, address 0x400e 2120) bit description . . . . . . . . . . . . 1100 table 1040. can new data 2 register (nd2, address 0x400e 2124) bit description . . . . . . . . . . . . 1101 table 1041. can interrupt pending 1 register (ir1, address 0x400e 2140) bit description . . . . . . . . . . . . 1101 table 1042. can interrupt pending 2 register (ir2, addresses 0x400e 2144) bit description . . . 1101 table 1043. can message valid 1 register (msgv1, addresses 0x400e 2160) bit description . . . 1102 table 1044. can message valid 2 register (msgv2, address 0x400e 2164) bit description . . . . . . . . . . . . 1102 table 1045. can clock divider register (clkdiv, address 0x400e 2180) bit description . . . . . . . . . . . . 1103 table 1046. initialization of a transmit object. . . . . . . . . 1110 table 1047. initialization of a receive object . . . . . . . . . 1111 table 1048. parameters of the c_can bit time. . . . . . . 1116 table 1049. abbreviations . . . . . . . . . . . . . . . . . . . . . . 1119 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1143 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 43.4 figures fig 1. lpc18xx block diagram (flashless parts) . . . . . .10 fig 2. lpc18xx ahb multilayer matrix connections (flashless parts) . . . . . . . . . . . . . . . . . . . . . . . . . . 11 fig 3. lpc185x/3x/2x/1x block diagram (parts with on-chip flash) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12 fig 4. ahb multilayer matrix master and slave connections 13 fig 5. system memory map - flashless parts lpc1850/30/20/10 (see figure 6 for detailed addresses of all peripherals) . . . . . . . . . . . . . . . .17 fig 6. memory map with peripherals - flashless parts lpc1850/30/20/10 (see figure 5 for detailed addresses of memory blocks) . . . . . . . . . . . . . . .18 fig 7. system memory map - parts with on-chip flash (overview) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 fig 8. memory mapping - parts with on-chip flash (peripherals). . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 fig 9. boot process . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 fig 10. cmac generation . . . . . . . . . . . . . . . . . . . . . . . .28 fig 11. uart boot process . . . . . . . . . . . . . . . . . . . . . . .29 fig 12. spifi boot process . . . . . . . . . . . . . . . . . . . . . . .30 fig 13. emc boot process . . . . . . . . . . . . . . . . . . . . . . . .30 fig 14. spi boot process . . . . . . . . . . . . . . . . . . . . . . . . .31 fig 15. boot process timing . . . . . . . . . . . . . . . . . . . . . . .32 fig 16. aes engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 fig 17. cgu and ccu0/1 block diagram. . . . . . . . . . . . .67 fig 18. cgu block diagram . . . . . . . . . . . . . . . . . . . . . . .70 fig 19. pll0 block diagram . . . . . . . . . . . . . . . . . . . . . . .91 fig 20. pll1 block diagram . . . . . . . . . . . . . . . . . . . . . . .95 fig 21. rgu block diagram . . . . . . . . . . . . . . . . . . . . . . 111 fig 22. rgu reset structure . . . . . . . . . . . . . . . . . . . . . 114 fig 23. gima input stages . . . . . . . . . . . . . . . . . . . . . . .223 fig 24. cross connections between gima, sct, and timer0/1/2/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . .224 fig 25. cross connections between gima, adc, and event router . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .225 fig 26. dma controller block diagram . . . . . . . . . . . . . .282 fig 27. lli example . . . . . . . . . . . . . . . . . . . . . . . . . . . .292 fig 28. sd/mmc block diagram . . . . . . . . . . . . . . . . . . .297 fig 29. emc block diagram . . . . . . . . . . . . . . . . . . . . . .324 fig 30. emc block diagram . . . . . . . . . . . . . . . . . . . . . .346 fig 31. 32 bit bank external memory interfaces ( bits mw = 10) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351 fig 32. 16 bit bank external memory interfaces (bits mw = 01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351 fig 33. 8 bit bank external memory interface (bits mw = 00) 352 fig 34. typical memory configuration diagram . . . . . . .353 fig 35. high-speed usb otg block diagram . . . . . . . .355 fig 36. usb controller modes . . . . . . . . . . . . . . . . . . . .360 fig 37. endpoint queue head organization . . . . . . . . . .406 fig 38. endpoint queue head data structure . . . . . . . . .408 fig 39. device state diagram . . . . . . . . . . . . . . . . . . . . .414 fig 40. endpoint queue head diagram. . . . . . . . . . . . . .426 fig 41. software link pointers. . . . . . . . . . . . . . . . . . . . .428 fig 42. device power state diagram . . . . . . . . . . . . . . .433 fig 43. host/otg power state diagram . . . . . . . . . . . . 435 fig 44. interrupt generation. . . . . . . . . . . . . . . . . . . . . . 507 fig 45. wake-up frame filter register . . . . . . . . . . . . . . . 510 fig 46. descriptor ring and chain structure . . . . . . . . . . 515 fig 47. txdma operation in default mode. . . . . . . . . . . 519 fig 48. txdma operation in osf mode . . . . . . . . . . . . 521 fig 49. receive dma operation . . . . . . . . . . . . . . . . . . 524 fig 50. transmitter descriptor fields - enhanced format 528 fig 51. transmit descriptor fetch (read) for enhanced format 529 fig 52. receive descriptor fields - alternate (enhanced format). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534 fig 53. lcd controller block diagram . . . . . . . . . . . . . . 564 fig 54. cursor movement . . . . . . . . . . . . . . . . . . . . . . . 572 fig 55. cursor clipping . . . . . . . . . . . . . . . . . . . . . . . . . 573 fig 56. cursor image format . . . . . . . . . . . . . . . . . . . . . 574 fig 57. power-up and power-down sequences. . . . . . . 580 fig 58. horizontal timing for stn displays . . . . . . . . . . 581 fig 59. vertical timing for stn displays . . . . . . . . . . . . 582 fig 60. horizontal timing for tft displays. . . . . . . . . . . 582 fig 61. vertical timing for tft displays . . . . . . . . . . . . . 583 fig 62. sct block diagram . . . . . . . . . . . . . . . . . . . . . . 588 fig 63. sct counter and select logic . . . . . . . . . . . . . . 589 fig 64. match logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611 fig 65. capture logic . . . . . . . . . . . . . . . . . . . . . . . . . . . 611 fig 66. event selection . . . . . . . . . . . . . . . . . . . . . . . . . 612 fig 67. output slice i . . . . . . . . . . . . . . . . . . . . . . . . . . . 612 fig 68. sct interrupt generation. . . . . . . . . . . . . . . . . . 612 fig 69. sct configuration example. . . . . . . . . . . . . . . . 619 fig 70. a timer cycle in whic h pr=2, mrx=6, and both interrupt and reset on match are enabled. . . . . 633 fig 71. a timer cycle in which pr=2, mrx=6, and both interrupt and stop on match are enabled . . . . . 633 fig 72. timer block diagram . . . . . . . . . . . . . . . . . . . . . 634 fig 73. mcpwm block diagram . . . . . . . . . . . . . . . . . . 637 fig 74. edge-aligned pwm waveform without dead time, pola = 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660 fig 75. center-aligned pwm waveform without dead time, pola = 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661 fig 76. edge-aligned pwm waveform with dead time, pola = 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661 fig 77. center-aligned waveform with dead time, pola = 0 662 fig 78. three-phase dc mode sample waveforms. . . . 664 fig 79. three-phase ac mode sample waveforms, edge aligned pwm mode. . . . . . . . . . . . . . . . . . . . . . 665 fig 80. encoder interface block diagram. . . . . . . . . . . . 668 fig 81. quadrature encoder basic operation . . . . . . . . 682 fig 82. ri timer block diagram . . . . . . . . . . . . . . . . . . . 687 fig 83. watchdog block diagram. . . . . . . . . . . . . . . . . . 697 fig 84. early watchdog feed with windowed mode enabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698 fig 85. correct watchdog feed with windowed mode enabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698 fig 86. watchdog warning interrupt . . . . . . . . . . . . . . . 698 fig 87. rtc functional block diagram . . . . . . . . . . . . . . 700 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1144 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information fig 88. auto-baud a) mode 0 and b) mode 1 waveform 726 fig 89. algorithm for setting uart dividers. . . . . . . . . .729 fig 90. usart serial interface protocol. . . . . . . . . . . . .736 fig 91. transmission of data in synchronous slave mode . . 737 fig 92. typical smart card application . . . . . . . . . . . . . .740 fig 93. smart card t = 0 waveform . . . . . . . . . . . . . . . .741 fig 94. uart block diagram . . . . . . . . . . . . . . . . . . . . .742 fig 95. auto-rts functional timing . . . . . . . . . . . . . . .755 fig 96. auto-cts functional timing . . . . . . . . . . . . . . .756 fig 97. auto-baud a) mode 0 and b) mode 1 waveform 761 fig 98. algorithm for setting uart dividers. . . . . . . . . .763 fig 99. uart1 block diagram . . . . . . . . . . . . . . . . . . . .769 fig 100. texas instruments synchronous serial frame format: a) single and b) continuous/back-to-back two frames transfer. . . . . . . . . . . . . . . . . . . . .778 fig 101. spi frame format with cpol=0 and cpha=0 (a) single and b) continuous transfer) . . . . . . . . . .779 fig 102. spi frame format with cpol=0 and cpha=1 . .780 fig 103. spi frame format with cpol = 1 and cpha = 0 (a) single and b) continuous transfer) . . . . . . . . . .781 fig 104. spi frame format with cpol = 1 and cpha = 1. . 782 fig 105. microwire frame format (single transfer) . . . . . .783 fig 106. microwire frame format (continuous transfers) .784 fig 107. microwire frame format setup and hold details .784 fig 108. i2s connections . . . . . . . . . . . . . . . . . . . . . . . . .787 fig 109. simple i2s configurations and bus timing . . . . .789 fig 110. typical transmitter master mode, with or without mclk output . . . . . . . . . . . . . . . . . . . . . . . . . . .800 fig 111. transmitter master mode sharing the receiver reference clock . . . . . . . . . . . . . . . . . . . . . . . . .800 fig 112. 4-wire transmitter master mode sharing the receiver bit clock and ws . . . . . . . . . . . . . . . . . . . . . . . .801 fig 113. typical transmitter slave mode . . . . . . . . . . . . .801 fig 114. transmitter slave mode sharing the receiver reference clock . . . . . . . . . . . . . . . . . . . . . . . . .801 fig 115. 4-wire transmitter slave mode sharing the receiver bit clock and ws . . . . . . . . . . . . . . . . . . . . . . . .801 fig 116. typical receiver master mode, with or without mclk output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .803 fig 117. receiver master mode sharing the transmitter reference clock . . . . . . . . . . . . . . . . . . . . . . . . .803 fig 118. 4-wire receiver master mode sharing the transmitter bit clock and ws . . . . . . . . . . . . . . . . . . . . . . . .803 fig 119. typical receiver slave mode . . . . . . . . . . . . . . .803 fig 120. receiver slave mode sharing the transmitter reference clock . . . . . . . . . . . . . . . . . . . . . . . . .804 fig 121. 4-wire receiver slave mode sharing the transmitter bit clock and ws . . . . . . . . . . . . . . . . . . . . . . . .804 fig 122. fifo contents for various i 2 s modes . . . . . . . .805 fig 123. c_can block diagram . . . . . . . . . . . . . . . . . . . .807 fig 124. block diagram of a message object transfer . .818 fig 125. can core in silent mode . . . . . . . . . . . . . . . . . .840 fig 126. can core in loop-back mode . . . . . . . . . . . . . .840 fig 127. can core in loop-back mode combined with silent mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .841 fig 128. block diagram of a message object transfer . .843 fig 129. reading a message from the fifo buffer to the message buffer . . . . . . . . . . . . . . . . . . . . . . . . . 849 fig 130. bit timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852 fig 131. i 2 c-bus configuration . . . . . . . . . . . . . . . . . . . . 854 fig 132. format in the master transmitter mode . . . . . . 866 fig 133. format of master receiver mode . . . . . . . . . . . 866 fig 134. a master receiver switches to master transmitter after sending repeated start . . . . . . . . . . . . 867 fig 135. format of slave receiver mode . . . . . . . . . . . . 867 fig 136. format of slave transmitter mode . . . . . . . . . . 868 fig 137. i 2 c serial interface block diagram . . . . . . . . . . . 869 fig 138. arbitration procedure . . . . . . . . . . . . . . . . . . . . 871 fig 139. serial clock synchronization . . . . . . . . . . . . . . . 871 fig 140. format and states in the master transmitter mode 876 fig 141. format and states in the master receiver mode . . 879 fig 142. format and states in the slave receiver mode 883 fig 143. format and states in the slave transmitter mode . 886 fig 144. simultaneous repeated start conditions from two masters. . . . . . . . . . . . . . . . . . . . . . . . . . . . 888 fig 145. forced access to a busy i 2 c-bus. . . . . . . . . . . 888 fig 146. recovering from a bus obstruction caused by a low level on sda . . . . . . . . . . . . . . . . . . . . . . 889 fig 147. dac control with dma interrupt and timer . . . . 909 fig 148. boot process flowchart . . . . . . . . . . . . . . . . . . . 913 fig 149. iap parameter passing . . . . . . . . . . . . . . . . . . . 926 fig 150. algorithm for generating a 128 bit signature. . . 934 fig 151. cgu and ccu0/1 block diagram . . . . . . . . . . . 978 fig 152. cgu block diagram . . . . . . . . . . . . . . . . . . . . . 981 fig 153. oscillator modes and models: a) slave mode of operation, b) oscillati on mode of operation, c) external crystal model used for c x1 / x2 evaluation. . 996 fig 154. pll0 block diagram . . . . . . . . . . . . . . . . . . . . . 998 fig 155. pll1 block diagram . . . . . . . . . . . . . . . . . . . . 1001 fig 156. simple i2s configurations and bus timing. . . . 1065 fig 157. typical transmitter master mode, with or without mclk output . . . . . . . . . . . . . . . . . . . . . . . . . . 1075 fig 158. transmitter master mode sharing the receiver reference clock . . . . . . . . . . . . . . . . . . . . . . . . 1075 fig 159. 4-wire transmitter master mode sharing the receiver bit clock and ws . . . . . . . . . . . . . . . . . . . . . . . 1075 fig 160. typical transmitter slave mode . . . . . . . . . . . . 1075 fig 161. transmitter slave mode sharing the receiver reference clock . . . . . . . . . . . . . . . . . . . . . . . . 1076 fig 162. 4-wire transmitter slave mode sharing the receiver bit clock and ws . . . . . . . . . . . . . . . . . . . . . . . 1076 fig 163. typical receiver master mode, with or without mclk output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077 fig 164. receiver master mode sharing the transmitter reference clock . . . . . . . . . . . . . . . . . . . . . . . . 1077 fig 165. 4-wire receiver master mode sharing the transmitter bit clock and ws . . . . . . . . . . . . . . . . . . . . . . . 1078 fig 166. typical receiver slave mode . . . . . . . . . . . . . . 1078 fig 167. receiver slave mode sharing the transmitter reference clock . . . . . . . . . . . . . . . . . . . . . . . . 1078 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1145 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information fig 168. 4-wire receiver slave mode sharing the transmitter bit clock and ws . . . . . . . . . . . . . . . . . . . . . . .1078 fig 169. fifo contents for various i 2 s modes . . . . . . .1080 fig 170. c_can block diagram . . . . . . . . . . . . . . . . . . .1082 fig 171. block diagram of a message object transfer .1090 fig 172. can core in silent mode . . . . . . . . . . . . . . . . . 1105 fig 173. can core in loop-back mode . . . . . . . . . . . . . 1106 fig 174. can core in loop-back mode combined with silent mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1106 fig 175. block diagram of a message object transfer . 1108 fig 176. reading a message from the fifo buffer to the message buffer . . . . . . . . . . . . . . . . . . . . . . . . 1114 fig 177. bit timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1117 fig 178. sct/general purpose timers cross connections . . . 1117 fig 179. input muxing for sct and general purpose timers . 1118 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1146 of 1164 continued >> nxp semiconductors UM10430 chapter 43: supplementary information 43.5 contents chapter 1: introductory information 1.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 ordering information (flashless parts lpc1850/30/20/10) . . . . . . . . . . . . . . . . . . . . . . . 7 1.4 ordering information (parts with on-chip flash). 8 1.5 block diagram (flashless parts lpc1850/30/20/10). . . . . . . . . . . . . . . . . . . . . . 10 1.6 block diagram (parts with on-chip flash) . . . 12 chapter 2: lpc18xx memory mapping 2.1 how to read this chapter . . . . . . . . . . . . . . . . . 14 2.2 basic configuration . . . . . . . . . . . . . . . . . . . . . 14 2.3 memory configuration . . . . . . . . . . . . . . . . . . . 14 2.3.1 on-chip static ram . . . . . . . . . . . . . . . . . . . . 14 2.3.2 on-chip flash . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.3.3 bit banding . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.4 general description . . . . . . . . . . . . . . . . . . . . 16 2.5 memory map (flashless parts lpc1850/30/20/10) 17 2.6 memory map (parts with on-chip flash) . . . . 19 chapter 3: lpc18xx boot rom 3.1 how to read this chapter . . . . . . . . . . . . . . . . . 22 3.2 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.3 functional description . . . . . . . . . . . . . . . . . . 22 3.3.1 aes capable devices . . . . . . . . . . . . . . . . . . . 24 3.3.2 boot process. . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.3.3 boot image format . . . . . . . . . . . . . . . . . . . . . 26 3.3.4 boot image creation . . . . . . . . . . . . . . . . . . . . 27 3.3.4.1 cmac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.3.4.2 uart boot mode . . . . . . . . . . . . . . . . . . . . . . 28 3.3.4.3 spifi boot mode . . . . . . . . . . . . . . . . . . . . . . 29 3.3.4.4 emc boot modes . . . . . . . . . . . . . . . . . . . . . . 30 3.3.4.5 spi boot mode . . . . . . . . . . . . . . . . . . . . . . . . 31 3.3.5 boot process timimg . . . . . . . . . . . . . . . . . . . 31 3.3.6 isp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 chapter 4: lpc18xx security features 4.1 how to read this chapter . . . . . . . . . . . . . . . . . 33 4.2 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.3 general description . . . . . . . . . . . . . . . . . . . . . 33 4.4 aes api calls. . . . . . . . . . . . . . . . . . . . . . . . . . 34 4.4.1 security api . . . . . . . . . . . . . . . . . . . . . . . . . . 34 4.4.2 otp memory . . . . . . . . . . . . . . . . . . . . . . . . . 35 chapter 5: lpc18xx nvic 5.1 how to read this chapter . . . . . . . . . . . . . . . . . 36 5.2 basic configuration . . . . . . . . . . . . . . . . . . . . . 36 5.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.4 general description . . . . . . . . . . . . . . . . . . . . . 36 5.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 36 5.6 interrupt sources. . . . . . . . . . . . . . . . . . . . . . . 37 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.7 register description . . . . . . . . . . . . . . . . . . . . 38 chapter 6: lpc18xx event router 6.1 how to read this chapter . . . . . . . . . . . . . . . . . 40 6.2 basic configuration . . . . . . . . . . . . . . . . . . . . . 40 6.3 general description . . . . . . . . . . . . . . . . . . . . . 40 6.4 event router inputs . . . . . . . . . . . . . . . . . . . . . 41 6.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . . 41 6.6 register description . . . . . . . . . . . . . . . . . . . . 42 6.6.1 level configuration register . . . . . . . . . . . . . . 42 6.6.2 edge configuration register . . . . . . . . . . . . . . 44 6.6.3 interrupt clear enable register . . . . . . . . . . . . 47 6.6.4 event set enable register . . . . . . . . . . . . . . . . 48 6.6.5 event status register . . . . . . . . . . . . . . . . . . . 49 6.6.6 event enable register . . . . . . . . . . . . . . . . . . . 50 6.6.7 clear status register. . . . . . . . . . . . . . . . . . . . 51 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1147 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 6.6.8 set status register. . . . . . . . . . . . . . . . . . . . . . 52 chapter 7: lpc18xx configuration registers (creg) 7.1 how to read this chapter . . . . . . . . . . . . . . . . . 54 7.2 basic configuration . . . . . . . . . . . . . . . . . . . . . 54 7.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 7.4 register description . . . . . . . . . . . . . . . . . . . . 55 7.4.1 irc trim register . . . . . . . . . . . . . . . . . . . . . . . 55 7.4.2 creg0 control register . . . . . . . . . . . . . . . . . 56 7.4.3 power mode control register. . . . . . . . . . . . . . 56 7.4.4 arm cortex-m3 memory mapping register . . 57 7.4.5 creg5 control register . . . . . . . . . . . . . . . . . 57 7.4.6 dma muxing register . . . . . . . . . . . . . . . . . . . 57 7.4.7 etb sram configuration register . . . . . . . . . 60 7.4.8 creg6 control register . . . . . . . . . . . . . . . . . 60 7.4.9 part id register. . . . . . . . . . . . . . . . . . . . . . . . 61 chapter 8: lpc18xx power management controller (pmc) 8.1 how to read this chapter . . . . . . . . . . . . . . . . . 62 8.2 general description . . . . . . . . . . . . . . . . . . . . . 62 8.2.1 active mode . . . . . . . . . . . . . . . . . . . . . . . . . . 62 8.2.2 sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . 62 8.2.3 deep-sleep mode . . . . . . . . . . . . . . . . . . . . . . 63 8.2.4 power-down mode . . . . . . . . . . . . . . . . . . . . . 63 8.2.5 deep power-down . . . . . . . . . . . . . . . . . . . . . 63 8.3 register description . . . . . . . . . . . . . . . . . . . . 64 8.3.1 hardware sleep event enable register pd0_sleep0_hw_ena . . . . . . . . . . . . . . . . 64 8.3.2 sleep power mode register pd0_sleep0_mode 64 8.4 functional description . . . . . . . . . . . . . . . . . . 65 8.4.1 run-time programming . . . . . . . . . . . . . . . . . 65 8.4.2 power api . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 chapter 9: lpc18xx clock generation unit (cgu) 9.1 how to read this chapter . . . . . . . . . . . . . . . . . 66 9.2 basic configuration . . . . . . . . . . . . . . . . . . . . . 66 9.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 9.4 general description . . . . . . . . . . . . . . . . . . . . . 66 9.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . . 71 9.6 register description . . . . . . . . . . . . . . . . . . . . 71 9.6.1 frequency monitor register . . . . . . . . . . . . . . 73 9.6.2 crystal oscillator control register . . . . . . . . . . 74 9.6.3 pll0 (for usb) registers . . . . . . . . . . . . . . . . 75 9.6.3.1 pll0 (for usb) status register . . . . . . . . . . . . 75 9.6.3.2 pll0 (for usb) control register. . . . . . . . . . . . 75 9.6.3.3 pll0 (for usb) m-divider register. . . . . . . . . . 76 9.6.3.4 pll0 (for usb) np-divider register. . . . . . . . . 77 9.6.4 pll0 (for audio) registers . . . . . . . . . . . . . . . . 77 9.6.4.1 pll0 (for audio) status register . . . . . . . . . . . 77 9.6.4.2 pll0 (for audio) control register . . . . . . . . . . . 77 9.6.4.3 pll0 (for audio) m-divider register . . . . . . . . . 79 9.6.4.4 pll0 (for audio) np-divider register . . . . . . . . 79 9.6.4.5 pll0 (for audio) fractional divider register . . . 79 9.6.5 pll1 registers . . . . . . . . . . . . . . . . . . . . . . . . 79 9.6.5.1 pll1 status register . . . . . . . . . . . . . . . . . . . . 79 9.6.5.2 pll1 control register . . . . . . . . . . . . . . . . . . . 80 9.6.6 integer divider register a . . . . . . . . . . . . . . . . 81 9.6.7 integer divider register b, c, d . . . . . . . . . . . . 82 9.6.8 integer divider register e . . . . . . . . . . . . . . . . 83 9.6.9 output stage 0 control register . . . . . . . . . . . . 84 9.6.10 output stage 1 control register . . . . . . . . . . . . 84 9.6.11 output stage 3 control register . . . . . . . . . . . . 85 9.6.12 output stage 4 to 19 control registers. . . . . . . 86 9.6.13 output stage 20 register . . . . . . . . . . . . . . . . . 87 9.6.14 output stage 25 register . . . . . . . . . . . . . . . . . 88 9.6.15 output stage 26 to 27 register . . . . . . . . . . . . 89 9.7 functional description . . . . . . . . . . . . . . . . . . 90 9.7.1 32 khz oscillator. . . . . . . . . . . . . . . . . . . . . . . 90 9.7.2 irc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 9.7.3 crystal oscillator. . . . . . . . . . . . . . . . . . . . . . . 90 9.7.4 pll0 (for usb and audio) . . . . . . . . . . . . . . . 90 9.7.4.1 features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 9.7.4.2 pll0 description . . . . . . . . . . . . . . . . . . . . . . 91 9.7.4.3 use of pll0 operating modes . . . . . . . . . . . . 92 9.7.4.3.1 normal mode . . . . . . . . . . . . . . . . . . . . . . . . . 92 9.7.4.3.2 mode 1a: normal operating mode without post-divider and without pre-divider . . . . . . . . 92 9.7.4.3.3 mode 1b: normal operating mode with post-divider and without pre-divider . . . . . . . . 93 9.7.4.3.4 mode 1c: normal operating mode without post-divider and with pre-divider . . . . . . . . . . 93 9.7.4.3.5 mode 1d: normal operating mode with post-divider and with pre-divider . . . . . . . . . . 93 9.7.4.3.6 mode 3: power down mode (pd) . . . . . . . . . . 93 9.7.4.4 settings for usb0 . . . . . . . . . . . . . . . . . . . . . 93 9.7.4.5 usage notes. . . . . . . . . . . . . . . . . . . . . . . . . . 94 9.7.5 fractional divider for the pll0 (for audio) . . . 94 9.7.6 pll1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 9.7.6.1 features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 9.7.6.2 pll1 description . . . . . . . . . . . . . . . . . . . . . . 95 9.7.6.3 lock detector . . . . . . . . . . . . . . . . . . . . . . . . . 95 9.7.6.4 power-down control . . . . . . . . . . . . . . . . . . . . 95 9.7.6.5 selectable feedback divider clock . . . . . . . . . 96 9.7.6.6 direct output mode. . . . . . . . . . . . . . . . . . . . . 96 9.7.6.7 divider ratio programming . . . . . . . . . . . . . . . 96 pre-divider . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 post-divider . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 feedback divider . . . . . . . . . . . . . . . . . . . . . . . 96 changing the divider values. . . . . . . . . . . . . . . 96 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1148 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 9.7.6.8 frequency selection . . . . . . . . . . . . . . . . . . . . 96 integer mode . . . . . . . . . . . . . . . . . . . . . . . . . .96 non-integer mode . . . . . . . . . . . . . . . . . . . . . . .97 direct mode . . . . . . . . . . . . . . . . . . . . . . . . . . .97 power-down mode . . . . . . . . . . . . . . . . . . . . . .97 9.8 example cgu configurations . . . . . . . . . . . . 98 9.8.1 programming the cgu for deep-sleep and power-down modes . . . . . . . . . . . . . . . . . . . . 98 9.8.2 programming the cgu for using i2s at peripheral clock rate of 30 mhz . . . . . . . . . . . . . . . . . . . 98 chapter 10: lpc18xx clock control unit (ccu) 10.1 how to read this chapter . . . . . . . . . . . . . . . . . 99 10.2 basic configuration . . . . . . . . . . . . . . . . . . . . . 99 10.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 10.4 general description . . . . . . . . . . . . . . . . . . . . . 99 10.5 register description . . . . . . . . . . . . . . . . . . . 102 10.5.1 power mode register . . . . . . . . . . . . . . . . . . 105 10.5.2 base clock status register . . . . . . . . . . . . . . 106 10.5.3 ccu1/2 branch clock configuration registers 107 10.5.4 ccu1/2 branch clock status registers . . . . . 109 10.6 functional description . . . . . . . . . . . . . . . . . . 110 chapter 11: lpc18xx reset generation unit (rgu) 11.1 how to read this chapter . . . . . . . . . . . . . . . . 111 11.2 basic configuration . . . . . . . . . . . . . . . . . . . . 111 11.3 general description . . . . . . . . . . . . . . . . . . . . 111 11.3.1 reset hierarchy . . . . . . . . . . . . . . . . . . . . . . 114 11.4 register overview . . . . . . . . . . . . . . . . . . . . . 115 11.4.1 rgu reset control register . . . . . . . . . . . . . . 117 11.4.2 rgu reset status register . . . . . . . . . . . . . . . 120 11.4.3 rgu reset active status register. . . . . . . . . . 126 11.4.4 reset external status registers . . . . . . . . . . . 131 11.4.4.1 reset external status register 0 for core_rst . 131 11.4.4.2 reset external status register 1 for periph_rst 131 11.4.4.3 reset external status register 2 for master_rst 132 11.4.4.4 reset external status register 4 for wwdt_rst 132 11.4.4.5 reset external status register 5 for creg_rst . 132 11.4.4.6 reset external status registers for peripheral_reset . . . . . . . . . . . . . . . . 133 11.4.4.7 reset external status registers for master_reset . . . . . . . . . . . . . . . . . . . . 133 chapter 12: lpc18xx pin configuration 12.1 how to read this chapter . . . . . . . . . . . . . . . . 134 12.2 pin description . . . . . . . . . . . . . . . . . . . . . . . 134 chapter 13: lpc18xx system control unit (scu) 13.1 how to read this chapter . . . . . . . . . . . . . . . . 185 13.2 basic configuration . . . . . . . . . . . . . . . . . . . . 185 13.3 general description . . . . . . . . . . . . . . . . . . . . 185 13.3.1 digital pin function . . . . . . . . . . . . . . . . . . . . 185 13.3.2 digital pin mode . . . . . . . . . . . . . . . . . . . . . . 185 13.3.3 i 2 c0-bus pins . . . . . . . . . . . . . . . . . . . . . . . . 186 13.3.4 usb1 dp1/dm1 pins . . . . . . . . . . . . . . . . . . 186 13.3.5 emc signal delay control . . . . . . . . . . . . . . . 186 13.3.6 pin multiplexing . . . . . . . . . . . . . . . . . . . . . . 187 13.4 register description . . . . . . . . . . . . . . . . . . . 198 13.4.1 pin configuration registers for normal drive pins. . 204 13.4.2 pin configuration registers for high drive pins 205 13.4.3 adc0 function select register . . . . . . . . . . . . 206 13.4.4 adc1 function select register . . . . . . . . . . . . 208 13.4.5 analog function select register . . . . . . . . . . . 209 13.4.6 pin configuration register for usb1 pins dp1/dm1 210 13.4.7 pin configuration register for open-drain i 2 c-bus pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 13.4.8 emc clock delay register . . . . . . . . . . . . . . . . 211 13.4.9 emc control delay register. . . . . . . . . . . . . . . 211 13.4.10 emc chip select delay register . . . . . . . . . . 212 13.4.11 emc data out delay register . . . . . . . . . . . . 213 13.4.12 emc feedback clock delay register . . . . . . . 213 13.4.13 emc address delay register 0 . . . . . . . . . . . 214 13.4.14 emc address delay register 1 . . . . . . . . . . . 214 13.4.15 emc address delay register 2 . . . . . . . . . . . 215 13.4.16 emc data in delay register . . . . . . . . . . . . . 216 13.4.17 pin interrupt select register 0 . . . . . . . . . . . . 216 13.4.18 pin interrupt select register 1 . . . . . . . . . . . . 218 chapter 14: lpc18xx global input multiplexer array (gima) 14.1 how to read this chapter . . . . . . . . . . . . . . . . 220 14.2 basic configuration . . . . . . . . . . . . . . . . . . . . 220 14.3 general description . . . . . . . . . . . . . . . . . . . . 220 14.3.1 gima cross connections. . . . . . . . . . . . . . . . 224 14.4 register description . . . . . . . . . . . . . . . . . . . 225 14.4.1 timer 0 cap0_0 capture input multiplexer (cap0_0_in) . . . . . . . . . . . . . . . . . . . . . . . . 227 14.4.2 timer 0 cap0_1 capture input multiplexer (cap0_1_in) . . . . . . . . . . . . . . . . . . . . . . . . 227 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1149 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 14.4.3 timer 0 cap0_2 capture input multiplexer (cap0_2_in) . . . . . . . . . . . . . . . . . . . . . . . . 228 14.4.4 timer 0 cap0_3 capture input multiplexer (cap0_3_in) . . . . . . . . . . . . . . . . . . . . . . . . 228 14.4.5 timer 1 cap1_0 capture input multiplexer (cap1_0_in) . . . . . . . . . . . . . . . . . . . . . . . . 229 14.4.6 timer 1 cap1_1 capture input multiplexer (cap1_1_in) . . . . . . . . . . . . . . . . . . . . . . . . 230 14.4.7 timer 1 cap1_2 capture input multiplexer (cap1_2_in) . . . . . . . . . . . . . . . . . . . . . . . . 230 14.4.8 timer 1 cap1_3 capture input multiplexer (cap1_3_in) . . . . . . . . . . . . . . . . . . . . . . . . 231 14.4.9 timer 2 cap2_0 capture input multiplexer (cap2_0_in) . . . . . . . . . . . . . . . . . . . . . . . . 231 14.4.10 timer 2 cap2_1 capture input multiplexer (cap2_1_in) . . . . . . . . . . . . . . . . . . . . . . . . 232 14.4.11 timer 2 cap2_2 capture input multiplexer (cap2_2_in) . . . . . . . . . . . . . . . . . . . . . . . . 233 14.4.12 timer 2 cap2_3 capture input multiplexer (cap2_3_in) . . . . . . . . . . . . . . . . . . . . . . . . 233 14.4.13 timer 3 cap3_0 capture input multiplexer (cap3_0_in) . . . . . . . . . . . . . . . . . . . . . . . . 234 14.4.14 timer 3 cap3_1 capture input multiplexer (cap3_1_in) . . . . . . . . . . . . . . . . . . . . . . . . 234 14.4.15 timer 3 cap3_2 capture input multiplexer (cap3_2_in) . . . . . . . . . . . . . . . . . . . . . . . . 235 14.4.16 timer 3 cap3_3 capture input multiplexer (cap3_3_in) . . . . . . . . . . . . . . . . . . . . . . . . 236 14.4.17 sct ctin_0 capture input multiplexer (ctin_0_in). . . . . . . . . . . . . . . . . . . . . . . . . 236 14.4.18 sct ctin_1 capture input multiplexer (ctin_1_in). . . . . . . . . . . . . . . . . . . . . . . . . 237 14.4.19 sct ctin_2 capture input multiplexer (ctin_2_in). . . . . . . . . . . . . . . . . . . . . . . . . 237 14.4.20 sct ctin_3 capture input multiplexer (ctin_3_in). . . . . . . . . . . . . . . . . . . . . . . . . 238 14.4.21 sct ctin_4 capture input multiplexer (ctin_4_in). . . . . . . . . . . . . . . . . . . . . . . . . 238 14.4.22 sct ctin_5 capture input multiplexer (ctin_5_in). . . . . . . . . . . . . . . . . . . . . . . . . 239 14.4.23 sct ctin_6 capture input multiplexer (ctin_6_in). . . . . . . . . . . . . . . . . . . . . . . . . 240 14.4.24 sct ctin_7 capture input multiplexer (ctin_7_in). . . . . . . . . . . . . . . . . . . . . . . . . 240 14.4.25 vadc trigger input multiplexer (vadc_trigger_in) . . . . . . . . . . . . . . . . . 241 14.4.26 event router input 13 multiplexer (eventrouter_13_in) . . . . . . . . . . . . . . 241 14.4.27 event router input 14 multiplexer (eventrouter_14_in) . . . . . . . . . . . . . . 242 14.4.28 event router input 16 multiplexer (eventrouter_16_in) . . . . . . . . . . . . . . 243 14.4.29 adc start0 input multiplexer (adcstart0_in) . 243 14.4.30 adc start1 input multiplexer (adcstart1_in) . 244 chapter 15: lpc18xx gpio 15.1 how to read this chapter . . . . . . . . . . . . . . . . 245 15.2 basic configuration . . . . . . . . . . . . . . . . . . . . 245 15.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 15.3.1 gpio pin interrupt features. . . . . . . . . . . . . . 246 15.3.2 gpio group interrupt features . . . . . . . . . . . 246 15.3.3 gpio port features . . . . . . . . . . . . . . . . . . . . 246 15.4 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 246 15.4.1 gpio pin interrupts . . . . . . . . . . . . . . . . . . . . 246 15.4.2 gpio group interrupt . . . . . . . . . . . . . . . . . . 246 15.4.3 gpio port . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 15.5 register description . . . . . . . . . . . . . . . . . . . 248 15.5.1 gpio pin interrupts register description . . . . 252 15.5.1.1 pin interrupt mode register . . . . . . . . . . . . . . 252 15.5.1.2 pin interrupt level (rising edge interrupt) enable register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252 15.5.1.3 pin interrupt level (rising edge interrupt) set register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 15.5.1.4 pin interrupt level (rising edge interrupt) clear register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 15.5.1.5 pin interrupt active level (falling edge interrupt enable) register. . . . . . . . . . . . . . . . . . . . . . . 253 15.5.1.6 pin interrupt active level (falling edge interrupt) set register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 15.5.1.7 pin interrupt active level (falling edge interrupt) clear register . . . . . . . . . . . . . . . . . . . . . . . . . 254 15.5.1.8 pin interrupt rising edge register. . . . . . . . . . 255 15.5.1.9 pin interrupt falling edge register . . . . . . . . . 255 15.5.1.10 pin interrupt status register . . . . . . . . . . . . . 256 15.5.2 gpio group0/group1 interrupt register description . . . . . . . . . . . . . . . . . . . . . . . . . . 256 15.5.2.1 grouped interrupt control register . . . . . . . . 256 15.5.2.2 gpio grouped interrupt port polarity registers . . . 256 15.5.2.3 gpio grouped interrupt port enable registers 257 15.5.3 gpio port register description . . . . . . . . . . . 257 15.5.3.1 gpio port byte pin registers . . . . . . . . . . . . 257 15.5.3.2 gpio port word pin registers . . . . . . . . . . . . 258 15.5.3.3 gpio port direction registers . . . . . . . . . . . . 258 15.5.3.4 gpio port mask registers . . . . . . . . . . . . . . 258 15.5.3.5 gpio port pin registers . . . . . . . . . . . . . . . . 259 15.5.3.6 gpio masked port pin registers. . . . . . . . . . 259 15.5.3.7 gpio port set registers . . . . . . . . . . . . . . . . 259 15.5.3.8 gpio port clear registers . . . . . . . . . . . . . . . 260 15.5.3.9 gpio port toggle registers . . . . . . . . . . . . . . 260 15.6 functional description . . . . . . . . . . . . . . . . . 260 15.6.1 reading pin state . . . . . . . . . . . . . . . . . . . . . 260 15.6.2 gpio output . . . . . . . . . . . . . . . . . . . . . . . . . 260 15.6.3 masked i/o. . . . . . . . . . . . . . . . . . . . . . . . . . 261 15.6.4 gpio interrupts . . . . . . . . . . . . . . . . . . . . . . 261 15.6.4.1 pin interrupts . . . . . . . . . . . . . . . . . . . . . . . . 262 15.6.4.2 group interrupts . . . . . . . . . . . . . . . . . . . . . . 262 15.6.5 recommended practices . . . . . . . . . . . . . . . 262 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1150 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information chapter 16: lpc18xx general purpose dma (gpdma) controller 16.1 how to read this chapter . . . . . . . . . . . . . . . . 263 16.2 basic configuration . . . . . . . . . . . . . . . . . . . . 263 16.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 16.4 general description . . . . . . . . . . . . . . . . . . . . 264 16.5 dma system connections . . . . . . . . . . . . . . . 264 16.5.1 dma request signals . . . . . . . . . . . . . . . . . . 266 16.5.2 dma response signals . . . . . . . . . . . . . . . . . 266 16.6 register description . . . . . . . . . . . . . . . . . . . 267 16.6.1 dma interrupt status register . . . . . . . . . . . 268 16.6.2 dma interrupt terminal count request status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 16.6.3 dma interrupt terminal count request clear register . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269 16.6.4 dma interrupt error status register . . . . . . 269 16.6.5 dma interrupt error clear register . . . . . . . 270 16.6.6 dma raw interrupt terminal count status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 16.6.7 dma raw error interrupt status register . . 271 16.6.8 dma enabled channel register . . . . . . . . . 271 16.6.9 dma software burst request register . . . . 271 16.6.10 dma software single request register . . . 272 16.6.11 dma software last burst request register 272 16.6.12 dma software last single request register 273 16.6.13 dma configuration register . . . . . . . . . . . . 273 16.6.14 dma synchronization register . . . . . . . . . . 274 16.6.15 dma channel registers . . . . . . . . . . . . . . . . 274 16.6.16 dma channel source address registers . . 274 16.6.17 dma channel destination address registers 275 16.6.18 dma channel linked list item registers . . . 275 16.6.19 dma channel control registers . . . . . . . . . . . 276 16.6.19.1 protection and access information . . . . . . . . 278 16.6.20 channel configuration registers . . . . . . . . . 278 16.6.20.1 lock control . . . . . . . . . . . . . . . . . . . . . . . . . 281 16.6.20.2 flow control and transfer type . . . . . . . . . . . 281 16.7 functional description . . . . . . . . . . . . . . . . . 282 16.7.1 dma controller functional description . . . . . . 282 16.7.1.1 ahb slave interface . . . . . . . . . . . . . . . . . . . 282 16.7.1.2 control logic and register bank . . . . . . . . . . 282 16.7.1.3 dma request and response interface . . . . . 282 16.7.1.4 channel logic and channel register bank. . . 282 16.7.1.5 interrupt request. . . . . . . . . . . . . . . . . . . . . . 282 16.7.1.6 ahb master interface. . . . . . . . . . . . . . . . . . 283 16.7.1.6.1 bus and transfer widths . . . . . . . . . . . . . . . . 283 16.7.1.6.2 endian behavior. . . . . . . . . . . . . . . . . . . . . . 283 16.7.1.6.3 error conditions . . . . . . . . . . . . . . . . . . . . . . 285 16.7.1.7 channel hardware . . . . . . . . . . . . . . . . . . . . 285 16.7.1.8 dma request priority . . . . . . . . . . . . . . . . . . 285 16.7.1.9 interrupt generation . . . . . . . . . . . . . . . . . . . 285 16.8 using the dma controller . . . . . . . . . . . . . . . 286 16.8.1 programming the dma controller. . . . . . . . . 286 16.8.1.1 enabling the dma controller . . . . . . . . . . . . 286 16.8.1.2 disabling the dma controller . . . . . . . . . . . . 286 16.8.1.3 enabling a dma channel . . . . . . . . . . . . . . . 286 16.8.1.4 disabling a dma channel. . . . . . . . . . . . . . . 286 disabling a dma channel and losing data in the fifo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 disabling the dma channel without losing data in the fifo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 16.8.1.5 setting up a new dma transfer . . . . . . . . . . 286 16.8.1.6 halting a dma channel . . . . . . . . . . . . . . . . 287 16.8.1.7 programming a dma channel . . . . . . . . . . . 287 16.8.2 flow control . . . . . . . . . . . . . . . . . . . . . . . . . 287 16.8.2.1 peripheral-to-memory or memory-to-peripheral dma flow . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 16.8.2.2 peripheral-to-peripheral dma flow. . . . . . . . 288 16.8.2.3 memory-to-memory dma flow . . . . . . . . . . . 289 16.8.3 interrupt requests . . . . . . . . . . . . . . . . . . . . . 290 16.8.3.1 hardware interrupt sequence flow . . . . . . . . 290 16.8.4 address generation . . . . . . . . . . . . . . . . . . . 290 16.8.4.1 word-aligned transfers across a boundary . 290 16.8.5 scatter/gather . . . . . . . . . . . . . . . . . . . . . . . 291 16.8.5.1 linked list items . . . . . . . . . . . . . . . . . . . . . . 291 16.8.5.1.1 programming the dma controller for scatter/gather dma . . . . . . . . . . . . . . . . . . . 291 16.8.5.1.2 example of scatter/gather dma. . . . . . . . . . 292 chapter 17: lpc18xx spi flash interface (spifi) 17.1 how to read this chapter . . . . . . . . . . . . . . . . 294 17.2 basic configuration . . . . . . . . . . . . . . . . . . . . 294 17.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 17.4 general description . . . . . . . . . . . . . . . . . . . 294 17.5 pin description . . . . . . . . . . . . . . . . . . . . . . . 295 17.6 spifi api calls . . . . . . . . . . . . . . . . . . . . . . . . 295 chapter 18: lpc18xx sd/mmc interface 18.1 how to read this chapter . . . . . . . . . . . . . . . . 296 18.2 basic configuration . . . . . . . . . . . . . . . . . . . . 296 18.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 18.4 general description . . . . . . . . . . . . . . . . . . . . 296 18.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 297 18.6 register description . . . . . . . . . . . . . . . . . . . 298 18.6.1 control register (ctrl) . . . . . . . . . . . . . . . . 299 18.6.2 power enable register (pwren) . . . . . . . . 301 18.6.3 clock divider register (clkdiv) . . . . . . . . . 302 18.6.4 sd clock source register (clksrc) . . . . . 302 18.6.5 clock enable register (clkena) . . . . . . . . 303 18.6.6 time-out register (tmout) . . . . . . . . . . . . 303 18.6.7 card type register (ctype). . . . . . . . . . . . 304 18.6.8 block size register (blksiz) . . . . . . . . . . . 304 18.6.9 byte count register (bytcnt) . . . . . . . . . . 304 18.6.10 interrupt mask register (intmask) . . . . . . 304 18.6.11 command argument register (cmdarg) . 305 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1151 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 18.6.12 command register (cmd) . . . . . . . . . . . . . . 306 18.6.13 response register 0 (resp0) . . . . . . . . . . . 309 18.6.14 response register 1 (resp1) . . . . . . . . . . . 309 18.6.15 response register 2 (resp2) . . . . . . . . . . . 309 18.6.16 response register 3 (resp3) . . . . . . . . . . . 309 18.6.17 masked interrupt status register (mintsts) 309 18.6.18 raw interrupt status register (rintsts) . . 310 18.6.19 status register (status) . . . . . . . . . . . . . . 312 18.6.20 fifo threshold watermark register (fifoth) . . 313 18.6.21 card detect register (cdetect) . . . . . . . . 315 18.6.22 write protect register (wrtprt) . . . . . . . . 315 18.6.23 general purpose input/output register (gpio) . . 315 18.6.24 transferred ciu card byte count register (tcbcnt). . . . . . . . . . . . . . . . . . . . . . . . . . . 315 18.6.25 transferred host to biu-fifo byte count register (tbbcnt). . . . . . . . . . . . . . . . . . . . 316 18.6.26 debounce count register (debnce) . . . . . 316 18.6.27 user id register (usrid) . . . . . . . . . . . . . . 316 18.6.28 version id register (verid) . . . . . . . . . . . . 316 18.6.29 uhs-1 register (uhs_reg) . . . . . . . . . . . . 317 18.6.30 hardware reset (rst_n) . . . . . . . . . . . . . . 317 18.6.31 bus mode register (bmod) . . . . . . . . . . . . 317 18.6.32 poll demand register (pldmnd) . . . . . . . . 318 18.6.33 descriptor list base address register (dbaddr) 318 18.6.34 internal dmac status register (idsts) . . . 319 18.6.35 internal dmac interrupt enable register (idinten) . . . . . . . . . . . . . . . . . . . . . . . . . . 320 18.6.36 current host descr iptor address register (dscaddr). . . . . . . . . . . . . . . . . . . . . . . . . 320 18.6.37 current buffer descriptor address register (bufaddr) . . . . . . . . . . . . . . . . . . . . . . . . . 321 chapter 19: lpc18xx external memory controller (emc) 19.1 how to read this chapter . . . . . . . . . . . . . . . . 322 19.2 basic configuration . . . . . . . . . . . . . . . . . . . . 322 19.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 19.4 general description . . . . . . . . . . . . . . . . . . . . 323 19.5 memory bank select . . . . . . . . . . . . . . . . . . . 324 19.6 pin description . . . . . . . . . . . . . . . . . . . . . . . . 325 19.7 register description . . . . . . . . . . . . . . . . . . . 325 19.7.1 emc control register . . . . . . . . . . . . . . . . . . 327 19.7.2 emc status register . . . . . . . . . . . . . . . . . . . 328 19.7.3 emc configuration register . . . . . . . . . . . . . 329 19.7.4 dynamic memory control register . . . . . . . . 329 19.7.5 dynamic memory refresh timer register . . . 331 19.7.6 dynamic memory read configuration register . . 331 19.7.7 dynamic memory precharge command period register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 19.7.8 dynamic memory acti ve to precharge command period register . . . . . . . . . . . . . . . . . . . . . . . 332 19.7.9 dynamic memory self refresh exit time register 333 19.7.10 dynamic memory last data out to active time register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 19.7.11 dynamic memory data in to active command time register . . . . . . . . . . . . . . . . . . . . . . . . 334 19.7.12 dynamic memory write recovery time register . 334 19.7.13 dynamic memory active to active command period register . . . . . . . . . . . . . . . . . . . . . . . 334 19.7.14 dynamic memory auto-refresh period register . . 335 19.7.15 dynamic memory exit self refresh register 335 19.7.16 dynamic memory active bank a to active bank b time register . . . . . . . . . . . . . . . . . . . . . . . . 336 19.7.17 dynamic memory load mode register to active command time . . . . . . . . . . . . . . . . . . . . . . 336 19.7.18 static memory extended wait register . . . . 336 19.7.19 dynamic memory configuration registers . . 337 19.7.20 dynamic memory ras & cas delay registers . . 340 19.7.21 static memory configuration registers . . . . . 340 19.7.22 static memory write enable delay registers 342 19.7.23 static memory output enable delay registers . . 343 19.7.24 static memory read delay registers . . . . . . 343 19.7.25 static memory page mode read delay registers 343 19.7.26 static memory write delay registers . . . . . . 344 19.7.27 static memory turn round delay registers 344 19.8 functional description . . . . . . . . . . . . . . . . . 346 19.8.1 ahb slave register interface . . . . . . . . . . . . 346 19.8.2 ahb slave memory interface . . . . . . . . . . . . 347 19.8.2.1 memory transaction endianness . . . . . . . . . 347 19.8.2.2 memory transaction size . . . . . . . . . . . . . . . 347 19.8.2.3 write protected memory areas. . . . . . . . . . . 347 19.8.3 pad interface . . . . . . . . . . . . . . . . . . . . . . . . 347 19.8.4 data buffers . . . . . . . . . . . . . . . . . . . . . . . . . 347 19.8.4.1 write buffers. . . . . . . . . . . . . . . . . . . . . . . . . 347 19.8.4.2 read buffers . . . . . . . . . . . . . . . . . . . . . . . . 348 19.9 low-power operation . . . . . . . . . . . . . . . . . . 348 19.9.1 low-power sdram deep-sleep mode . . . . 349 19.9.2 low-power sdram partial array refresh . . . 349 19.10 external static memory interface. . . . . . . . . 350 19.10.1 32-bit wide memory bank connection . . . . . 350 19.10.2 16-bit wide memory bank connection . . . . . 351 19.10.3 8-bit wide memory bank connection . . . . . . 352 19.10.4 memory configuration example . . . . . . . . . . 353 chapter 20: lpc18xx usb0 host/device/otg controller 20.1 how to read this chapter . . . . . . . . . . . . . . . . 354 20.2 basic configuration. . . . . . . . . . . . . . . . . . . . 354 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1152 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 20.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 20.4 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 355 20.4.1 block diagram . . . . . . . . . . . . . . . . . . . . . . . . 355 20.4.2 about usb on-the-go. . . . . . . . . . . . . . . . . 355 20.4.3 usb acronyms and abbreviations . . . . . . . . 355 20.4.4 transmit and receive buffers . . . . . . . . . . . . 356 20.4.5 fixed endpoint configuration. . . . . . . . . . . . . 356 20.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 357 20.6 register description . . . . . . . . . . . . . . . . . . . 358 20.6.1 use of registers . . . . . . . . . . . . . . . . . . . . . . 359 20.6.2 device/host capability registers . . . . . . . . . . 360 20.6.3 usb command register (usbcmd). . . . . . . 362 20.6.3.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 362 20.6.3.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 364 20.6.4 usb status register (u sbsts). . . . . . . . . . . 366 20.6.4.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 367 20.6.4.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 369 20.6.5 usb interrupt register (usbintr) . . . . . . . . 371 20.6.5.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 371 20.6.5.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 372 20.6.6 frame index register (frindex) . . . . . . . . . 373 20.6.6.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 373 20.6.6.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 373 20.6.7 device address (deviceaddr - device) and periodic list base (p eriodiclistbase- host) registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 20.6.7.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 374 20.6.7.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 374 20.6.8 endpoint list address register (endpointlistaddr - device) and asynchronous list address (asynclistaddr - host) registers . . . . . . . . . . . . . . . . . . . . . . . 375 20.6.8.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 375 20.6.8.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 375 20.6.9 tt control register (ttctrl). . . . . . . . . . . . 375 20.6.9.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 375 20.6.9.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 376 20.6.10 burst size register (burstsize). . . . . . . . . 376 20.6.11 transfer buffer fill tuning register (txfilltuning) . . . . . . . . . . . . . . . . . . . . . 376 20.6.11.1 device controller . . . . . . . . . . . . . . . . . . . . . . 376 20.6.11.2 host controller . . . . . . . . . . . . . . . . . . . . . . . 376 20.6.12 binterval register . . . . . . . . . . . . . . . . . . . 377 20.6.13 usb endpoint nak re gister (endptnak). . 378 20.6.13.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 378 20.6.13.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 378 20.6.14 usb endpoint nak enable . . . . . . . . . . register (endptnaken). . . . . . . . . . . . . . . . . . . . . . 378 20.6.14.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 378 20.6.14.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 379 20.6.15 port status and control register (portsc1) 379 20.6.15.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 379 20.6.15.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 382 20.6.16 otg status and control register (otgsc) . 386 20.6.17 usb mode register (usbmode) . . . . . . . . . 389 20.6.17.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 389 20.6.17.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 390 20.6.18 usb endpoint setup status register (endpsetupstat) . . . . . . . . . . . . . . . . . . 391 20.6.19 usb endpoint prime register (endptprime) . . 391 20.6.20 usb endpoint flush register (endptflush) . . 392 20.6.21 usb endpoint status register (endptstat) 393 20.6.22 usb endpoint complete register (endptcomplete). . . . . . . . . . . . . . . . . . 393 20.6.23 usb endpoint 0 control register (endptctrl0) 394 20.6.24 endpoint 1 to 5 control registers . . . . . . . . . 395 20.7 functional description . . . . . . . . . . . . . . . . . 397 20.7.1 otg core . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 20.7.2 host data structures. . . . . . . . . . . . . . . . . . . 397 20.7.3 host operational model . . . . . . . . . . . . . . . . 397 20.7.4 atx_rgen module . . . . . . . . . . . . . . . . . . . 397 20.7.5 atx transceiver . . . . . . . . . . . . . . . . . . . . . . 398 20.7.6 modes of operation . . . . . . . . . . . . . . . . . . . 398 20.7.7 sof/vf indicator . . . . . . . . . . . . . . . . . . . . . 398 20.7.8 hardware assist . . . . . . . . . . . . . . . . . . . . . . 398 20.7.8.1 auto reset. . . . . . . . . . . . . . . . . . . . . . . . . . . 399 20.7.8.2 data pulse . . . . . . . . . . . . . . . . . . . . . . . . . . 399 20.7.8.3 b-disconnect to a-connect (transition to the a-peripheral state) . . . . . . . . . . . . . . . . . . . . 399 20.8 deviations from ehci standard . . . . . . . . . . 400 20.8.1 embedded transaction translator function . 400 20.8.1.1 capability registers . . . . . . . . . . . . . . . . . . . 400 20.8.1.2 operational registers . . . . . . . . . . . . . . . . . . 401 20.8.1.3 discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 20.8.1.4 data structures. . . . . . . . . . . . . . . . . . . . . . . 401 20.8.1.5 operational model . . . . . . . . . . . . . . . . . . . . 402 20.8.1.5.1 micro-frame pipeline . . . . . . . . . . . . . . . . . . 402 20.8.1.6 split state machines . . . . . . . . . . . . . . . . . . . 402 20.8.1.7 asynchronous transaction scheduling and buffer management . . . . . . . . . . . . . . . . . . . . . . . . 403 20.8.1.8 periodic transaction scheduling and buffer management . . . . . . . . . . . . . . . . . . . . . . . . 403 20.8.1.9 multiple transaction translators . . . . . . . . . 404 20.8.2 device operation . . . . . . . . . . . . . . . . . . . . . 404 20.8.2.1 usbmode register . . . . . . . . . . . . . . . . . . . 404 20.8.2.2 non-zero fields the register file. . . . . . . . . . 404 20.8.2.3 sof interrupt . . . . . . . . . . . . . . . . . . . . . . . . 404 20.8.3 miscellaneous variations from ehci . . . . . . 404 20.8.3.1 discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 20.8.3.1.1 port reset . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 20.8.3.1.2 port speed detection . . . . . . . . . . . . . . . . . . 405 20.9 device data structures . . . . . . . . . . . . . . . . . 405 20.9.1 endpoint queue head (dqh) . . . . . . . . . . . . 406 20.9.1.1 endpoint capabilities and characteristics . . . 406 20.9.1.2 transfer overlay . . . . . . . . . . . . . . . . . . . . . . 408 20.9.1.3 current dtd pointer . . . . . . . . . . . . . . . . . . . 408 20.9.1.4 set-up buffer . . . . . . . . . . . . . . . . . . . . . . . . 409 20.9.2 endpoint transfer descriptor (dtd). . . . . . . . 409 20.9.2.1 determining the number of packets for isochronous in endpoints . . . . . . . . . . . . . . . 411 example 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 412 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1153 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 20.10 device operational model . . . . . . . . . . . . . . . 412 20.10.1 device controller initialization . . . . . . . . . . . . 412 20.10.2 port state and control . . . . . . . . . . . . . . . . . . 413 20.10.3 bus reset . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 20.10.4 suspend/resume . . . . . . . . . . . . . . . . . . . . . 416 20.10.4.1 suspend . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 20.10.4.1.1 operational model . . . . . . . . . . . . . . . . . . . 416 20.10.4.2 resume . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 20.10.5 managing endpoints . . . . . . . . . . . . . . . . . . . 417 20.10.5.1 endpoint initialization . . . . . . . . . . . . . . . . . . 417 20.10.5.2 stalling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418 20.10.5.3 data toggle . . . . . . . . . . . . . . . . . . . . . . . . . . 418 20.10.5.3.1 data toggle reset . . . . . . . . . . . . . . . . . . . . 418 20.10.5.3.2 data toggle inhibit. . . . . . . . . . . . . . . . . . . . 418 20.10.6 operational model for packet transfers. . . . . 419 20.10.6.1 priming transmit endpoints . . . . . . . . . . . . . . 419 20.10.6.2 priming receive endpoints . . . . . . . . . . . . . . 420 20.10.7 interrupt/bulk endpoint operational model . . 420 20.10.7.1 interrupt/bulk endpoint bus response matrix. 421 20.10.8 control endpoint operational model . . . . . . . 421 20.10.8.1 setup phase . . . . . . . . . . . . . . . . . . . . . . . . . 421 20.10.8.1.1 setup packet handling using setup lockout mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . 422 20.10.8.1.2 setup packet handling using trip wire mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . 422 20.10.8.2 data phase . . . . . . . . . . . . . . . . . . . . . . . . . . 423 20.10.8.3 status phase . . . . . . . . . . . . . . . . . . . . . . . . . 423 20.10.8.4 control endpoint bus response matrix . . . . . 423 20.10.9 isochronous endpoint operational model . . . 424 tx packet retired . . . . . . . . . . . . . . . . . . . . . . 425 rx packet retired . . . . . . . . . . . . . . . . . . . . . . 425 20.10.9.1 isochronous pipe synchronization . . . . . . . . 425 20.10.9.2 isochronous endpoint bus response matrix . 426 20.10.10 managing queue heads . . . . . . . . . . . . . . . . 426 20.10.10.1 queue head initialization . . . . . . . . . . . . . . 427 20.10.10.2 operational model for setup transfers . . . . 427 20.10.11 managing transfers with transfer descriptors 428 20.10.11.1 software link pointers . . . . . . . . . . . . . . . . . 428 20.10.11.2 building a transfer descriptor . . . . . . . . . . . 428 20.10.11.3 executing a transfer descriptor . . . . . . . . . . 429 link list is empty. . . . . . . . . . . . . . . . . . . . . . . 429 link list is not empty. . . . . . . . . . . . . . . . . . . . 429 20.10.11.4 transfer completion . . . . . . . . . . . . . . . . . . 429 20.10.11.5 flushing/de-priming an endpoint . . . . . . . . 430 20.10.11.6 device error matrix . . . . . . . . . . . . . . . . . . . 430 20.10.12 servicing interrupts . . . . . . . . . . . . . . . . . . . 431 20.10.12.1 high-frequency interrupts . . . . . . . . . . . . . . 431 20.10.12.2 low-frequency interrupts . . . . . . . . . . . . . . 431 20.10.12.3 error interrupts . . . . . . . . . . . . . . . . . . . . . . 431 20.11 usb power optimization. . . . . . . . . . . . . . . . 432 20.11.1 usb power states . . . . . . . . . . . . . . . . . . . . 432 20.11.2 device power states. . . . . . . . . . . . . . . . . . . 433 20.11.3 host power states . . . . . . . . . . . . . . . . . . . . 435 20.11.4 susp_ctrl module. . . . . . . . . . . . . . . . . . . 436 chapter 21: lpc18xx usb1 host/device controller 21.1 how to read this chapter . . . . . . . . . . . . . . . . 437 21.2 basic configuration . . . . . . . . . . . . . . . . . . . . 437 21.2.1 full-speed mode without external phy . . . . 437 21.2.2 high-speed mode with ulpi interface . . . . . 437 21.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 21.4 general description . . . . . . . . . . . . . . . . . . . . 438 21.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 438 21.6 register description . . . . . . . . . . . . . . . . . . . 439 21.6.1 device/host capability registers . . . . . . . . . . 440 21.6.2 usb command register (usbcmd). . . . . . . 442 21.6.2.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 443 21.6.2.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 444 21.6.3 usb status register (u sbsts). . . . . . . . . . . 446 21.6.3.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 447 21.6.3.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 449 21.6.4 usb interrupt register (usbintr) . . . . . . . . 451 21.6.4.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 451 21.6.4.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 452 21.6.5 frame index register (frindex) . . . . . . . . . 453 21.6.5.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 453 21.6.5.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 453 21.6.6 device address (deviceaddr) and periodic list base (periodiclistbase) registers. . . . . 454 21.6.6.1 device mode. . . . . . . . . . . . . . . . . . . . . . . . . 454 21.6.6.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 454 21.6.7 endpoint list address register (endpointlistaddr) and asynchronous list address (asynclistaddr) registers . . . . 455 21.6.7.1 device mode . . . . . . . . . . . . . . . . . . . . . . . . 455 21.6.7.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 455 21.6.8 tt control register (ttctrl) . . . . . . . . . . . 455 21.6.8.1 device mode . . . . . . . . . . . . . . . . . . . . . . . . 455 21.6.8.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 456 21.6.9 burst size register (burstsize) . . . . . . . . 456 21.6.10 transfer buffer fill tuning register (txfilltuning) . . . . . . . . . . . . . . . . . . . . . 456 21.6.10.1 device controller . . . . . . . . . . . . . . . . . . . . . 456 21.6.10.2 host controller . . . . . . . . . . . . . . . . . . . . . . . 456 21.6.11 usb ulpi viewport register (ulpiviewport). . 457 21.6.12 binterval register . . . . . . . . . . . . . . . . . . 459 21.6.13 usb endpoint nak re gister (endptnak) . 459 21.6.13.1 device mode . . . . . . . . . . . . . . . . . . . . . . . . 459 21.6.13.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 460 21.6.14 usb endpoint nak enable . . . . . . . . . . register (endptnaken) . . . . . . . . . . . . . . . . . . . . . 460 21.6.14.1 device mode . . . . . . . . . . . . . . . . . . . . . . . . 460 21.6.14.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 461 21.6.15 port status and control register (portsc1) 461 21.6.15.1 device mode . . . . . . . . . . . . . . . . . . . . . . . . 461 21.6.15.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 464 21.6.16 usb mode register (usbmode) . . . . . . . . . 469 21.6.16.1 device mode . . . . . . . . . . . . . . . . . . . . . . . . 469 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1154 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 21.6.16.2 host mode . . . . . . . . . . . . . . . . . . . . . . . . . . 470 21.6.17 usb endpoint setup status register (endpsetupstat). . . . . . . . . . . . . . . . . . . 471 21.6.18 usb endpoint prime register (endptprime). . . 471 21.6.19 usb endpoint flush register (endptflush) . . . 472 21.6.20 usb endpoint status register (endptstat) 473 21.6.21 usb endpoint complete register (endptcomplete). . . . . . . . . . . . . . . . . . 473 21.6.22 usb endpoint 0 control register (endptctrl0) 474 21.6.23 endpoint 1 to 3 control registers . . . . . . . . . 475 21.7 functional description . . . . . . . . . . . . . . . . . 477 chapter 22: lpc18xx ethernet 22.1 how to read this chapter . . . . . . . . . . . . . . . . 478 22.2 basic configuration . . . . . . . . . . . . . . . . . . . . 478 22.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478 22.4 general description . . . . . . . . . . . . . . . . . . . . 479 22.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 479 22.6 register description . . . . . . . . . . . . . . . . . . . 480 22.6.1 mac configuration register . . . . . . . . . . . . . 481 22.6.2 mac frame filter register . . . . . . . . . . . . . . . 484 22.6.3 mac hash table high register. . . . . . . . . . . . 485 22.6.4 mac hash table . . . . . . . . . . . . . low register 486 22.6.5 mac mii address register. . . . . . . . . . . . . . . 486 22.6.6 mac mii data register . . . . . . . . . . . . . . . . . 488 22.6.7 mac flow control register . . . . . . . . . . . . . . 488 22.6.8 mac vlan tag register . . . . . . . . . . . . . . . . 490 22.6.9 mac debug register . . . . . . . . . . . . . . . . . . . 490 22.6.10 mac remote wake-up frame filter register. . 491 22.6.11 mac pmt control and status register. . . . . . 492 22.6.12 mac interrupt status register . . . . . . . . . . . . 492 22.6.13 mac interrupt mask register. . . . . . . . . . . . . 493 22.6.14 mac address 0 high register . . . . . . . . . . . . 493 22.6.15 mac address 0 low register . . . . . . . . . . . . . 493 22.6.16 mac i eee1588 time stamp control register . 494 22.6.17 dma bus mode register . . . . . . . . . . . . . . . . 496 22.6.18 dma transmit poll demand register . . . . . . . 498 22.6.19 dma receive poll demand register . . . . . . . 499 22.6.20 dma receive descriptor list address register 499 22.6.21 dma transmit descriptor list address register 499 22.6.22 dma status register . . . . . . . . . . . . . . . . . . . 500 22.6.23 dma operation mode register . . . . . . . . . . . 502 22.6.24 dma interrupt enable register . . . . . . . . . . . 505 22.6.25 dma missed frame and buffer overflow counter register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508 22.6.26 dma receive interrupt watchdog timer register . . 508 22.6.27 dma current host transmit descriptor register . . . 508 22.6.28 dma current host receive descriptor register 509 22.6.29 dma current host transmit buffer address register 509 22.6.30 dma current host receive buffer address register 509 22.7 functional description . . . . . . . . . . . . . . . . . 509 22.7.1 power management block . . . . . . . . . . . . . . 510 22.7.1.1 remote wake-up frame registers. . . . . . . . . 510 filter i byte mask . . . . . . . . . . . . . . . . . . . . . . 510 filter i command . . . . . . . . . . . . . . . . . . . . . . 511 filter i offset . . . . . . . . . . . . . . . . . . . . . . . . . . 511 filter i crc-16 . . . . . . . . . . . . . . . . . . . . . . . . 511 22.7.1.2 remote wake-up detection . . . . . . . . . . . . . . 511 22.7.1.3 magic packet detection . . . . . . . . . . . . . . . . 512 22.7.1.4 system considerations during power-down . 512 22.7.2 dma arbiter functions . . . . . . . . . . . . . . . . . 513 22.7.3 ipc receive checksum offload engine . . . . 514 22.8 dma controller description . . . . . . . . . . . . . 514 22.8.1 initialization . . . . . . . . . . . . . . . . . . . . . . . . . 515 22.8.1.1 host bus burst access . . . . . . . . . . . . . . . . . 516 22.8.1.2 host data buffer alignment . . . . . . . . . . . . . . 516 example: buffer read . . . . . . . . . . . . . . . . . . . 517 example: buffer write. . . . . . . . . . . . . . . . . . . 517 22.8.1.3 buffer size calculations . . . . . . . . . . . . . . . . 517 22.8.1.4 dma arbiter for mac-dma and mac-ahb cores 517 22.8.2 transmission . . . . . . . . . . . . . . . . . . . . . . . . 518 22.8.2.1 txdma operation: default (non-osf) mode 518 22.8.2.2 txdma operation: osf mode . . . . . . . . . . . 519 22.8.2.3 transmit frame processing. . . . . . . . . . . . . . 522 22.8.2.4 transmit polling suspended . . . . . . . . . . . . . 522 22.8.2.5 reception. . . . . . . . . . . . . . . . . . . . . . . . . . . 523 22.8.2.6 receive descriptor acquisition . . . . . . . . . . . 525 22.8.2.7 receive frame processing . . . . . . . . . . . . . . 525 22.8.2.8 receive process suspended . . . . . . . . . . . . 526 22.8.2.9 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 526 22.8.2.10 error response to dma . . . . . . . . . . . . . . . . 527 22.9 ethernet descriptors (enhanced format). . . 527 22.9.1 transmit descriptor . . . . . . . . . . . . . . . . . . . 527 22.9.2 receive descriptor . . . . . . . . . . . . . . . . . . . . 533 chapter 23: lpc18xx lcd 23.1 how to read this chapter . . . . . . . . . . . . . . . . 540 23.2 basic configuration . . . . . . . . . . . . . . . . . . . . 540 23.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 23.4 general description . . . . . . . . . . . . . . . . . . . . 541 23.4.1 programmable parameters . . . . . . . . . . . . . . 541 23.4.2 hardware cursor support . . . . . . . . . . . . . . . 541 23.4.3 types of lcd panels supported. . . . . . . . . . 542 23.4.3.1 tft panels. . . . . . . . . . . . . . . . . . . . . . . . . . 542 23.4.3.2 color stn panels. . . . . . . . . . . . . . . . . . . . . 542 23.4.3.3 monochrome stn panels . . . . . . . . . . . . . . 542 23.5 pin description . . . . . . . . . . . . . . . . . . . . . . . 543 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1155 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 23.5.1 signal usage . . . . . . . . . . . . . . . . . . . . . . . . . 543 23.5.1.1 signals used for single panel stn displays . 543 23.5.1.2 signals used for dual panel stn displays . . 544 23.5.1.3 signals used for tft displays . . . . . . . . . . . 544 23.6 register description . . . . . . . . . . . . . . . . . . . 545 23.6.1 horizontal timing register . . . . . . . . . . . . . . 546 23.6.1.1 horizontal timing restrictions. . . . . . . . . . . . . 547 23.6.2 vertical timing register . . . . . . . . . . . . . . . . 547 23.6.3 clock and signal polarity register . . . . . . . . 548 23.6.4 line end control register . . . . . . . . . . . . . . . 550 23.6.5 upper panel frame base address register . 551 23.6.6 lower panel frame base address register . 551 23.6.7 lcd control register . . . . . . . . . . . . . . . . . . 552 23.6.8 interrupt mask register . . . . . . . . . . . . . . . . . 554 23.6.9 raw interrupt status register . . . . . . . . . . . . 554 23.6.10 masked interrupt status register . . . . . . . . . 555 23.6.11 interrupt clear register . . . . . . . . . . . . . . . . . 555 23.6.12 upper panel current address register . . . . . 556 23.6.13 lower panel current address register . . . . . 556 23.6.14 color palette registers . . . . . . . . . . . . . . . . . 557 23.6.15 cursor image registers . . . . . . . . . . . . . . . . 557 23.6.16 cursor control register . . . . . . . . . . . . . . . . . 558 23.6.17 cursor configuration register . . . . . . . . . . . . 558 23.6.18 cursor palette register 0 . . . . . . . . . . . . . . . 559 23.6.19 cursor palette register 1 . . . . . . . . . . . . . . . 559 23.6.20 cursor xy position register . . . . . . . . . . . . . 560 23.6.21 cursor clip position register . . . . . . . . . . . . 560 23.6.22 cursor interrupt mask register . . . . . . . . . . . 561 23.6.23 cursor interrupt clear register . . . . . . . . . . . 561 23.6.24 cursor raw interrupt status register . . . . . . 562 23.6.25 cursor masked interrupt status register . . . 562 23.7 lcd controller functional description. . . . . 563 23.7.1 ahb interfaces . . . . . . . . . . . . . . . . . . . . . . . 564 23.7.1.1 amba ahb slave interface . . . . . . . . . . . . . 564 23.7.1.2 amba ahb master interface . . . . . . . . . . . . 564 23.7.2 dual dma fifos and associated control logic . . 565 23.7.3 pixel serializer . . . . . . . . . . . . . . . . . . . . . . . 565 23.7.4 ram palette . . . . . . . . . . . . . . . . . . . . . . . . . 569 23.7.5 hardware cursor . . . . . . . . . . . . . . . . . . . . . 571 23.7.5.1 cursor operation . . . . . . . . . . . . . . . . . . . . . 571 23.7.5.2 cursor sizes . . . . . . . . . . . . . . . . . . . . . . . . . 572 23.7.5.3 cursor movement . . . . . . . . . . . . . . . . . . . . 572 23.7.5.4 cursor xy positioning . . . . . . . . . . . . . . . . . 572 23.7.5.5 cursor clipping . . . . . . . . . . . . . . . . . . . . . . . 573 23.7.5.6 cursor image format . . . . . . . . . . . . . . . . . . 574 23.7.6 gray scaler. . . . . . . . . . . . . . . . . . . . . . . . . . 576 23.7.7 upper and lower panel formatters . . . . . . . . 576 23.7.8 panel clock generator . . . . . . . . . . . . . . . . . 577 23.7.9 timing controller. . . . . . . . . . . . . . . . . . . . . . 577 23.7.10 stn and tft data select . . . . . . . . . . . . . . . 577 23.7.10.1 stn displays . . . . . . . . . . . . . . . . . . . . . . . . 577 23.7.10.2 tft displays . . . . . . . . . . . . . . . . . . . . . . . . 577 23.7.11 interrupt generation . . . . . . . . . . . . . . . . . . . 577 23.7.11.1 master bus error interrupt . . . . . . . . . . . . . . 578 23.7.11.2 vertical compare interrupt . . . . . . . . . . . . . . 578 23.7.11.2.1 next base address update interrupt . . . . . . 578 23.7.11.2.2 fifo underflow interrupt . . . . . . . . . . . . . . 578 23.7.12 lcd power-up and power-down sequence . 578 23.8 lcd timing diagrams . . . . . . . . . . . . . . . . . . 581 23.9 lcd panel signal usage . . . . . . . . . . . . . . . . 583 chapter 24: lpc18xx state configurable timer (sct) 24.1 how to read this chapter . . . . . . . . . . . . . . . . 587 24.2 basic configuration . . . . . . . . . . . . . . . . . . . . 587 24.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587 24.4 general description . . . . . . . . . . . . . . . . . . . . 588 24.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 589 24.6 register description . . . . . . . . . . . . . . . . . . . 589 24.6.1 sct configuration register . . . . . . . . . . . . . . 593 24.6.2 sct control register . . . . . . . . . . . . . . . . . . . 594 24.6.3 sct limit register . . . . . . . . . . . . . . . . . . . . . 595 24.6.4 sct halt condition register . . . . . . . . . . . . . . 596 24.6.5 sct stop condition register . . . . . . . . . . . . . 596 24.6.6 sct start condition register . . . . . . . . . . . . . 597 24.6.7 sct counter register . . . . . . . . . . . . . . . . . . 597 24.6.8 sct state register. . . . . . . . . . . . . . . . . . . . . 598 24.6.9 sct input register. . . . . . . . . . . . . . . . . . . . . 598 24.6.10 sct match/capture registers mode register . 599 24.6.11 sct output register . . . . . . . . . . . . . . . . . . . 600 24.6.12 sct bidirectional output control register. . . . 600 24.6.13 sct conflict resolution register. . . . . . . . . . . 602 24.6.14 sct dma request 0 and 1 registers. . . . . . . 604 24.6.15 sct flag enable register . . . . . . . . . . . . . . . . 605 24.6.16 sct event flag register . . . . . . . . . . . . . . . . . 605 24.6.17 sct conflict enable register . . . . . . . . . . . . . 606 24.6.18 sct conflict flag register . . . . . . . . . . . . . . . 606 24.6.19 sct match registers 0 to 15 (regmoden bit = 0) 606 24.6.20 sct capture registers 0 to 15 (regmoden bit = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607 24.6.21 sct match reload registers 0 to 15 (regmoden bit = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607 24.6.22 sct capture control registers 0 to 15 (regmoden bit = 1) . . . . . . . . . . . . . . . . . . 608 24.6.23 sct event state mask registers 0 to 15 . . . . 608 24.6.24 sct event control registers 0 to 15 . . . . . . . 608 24.6.25 sct output set registers 0 to 15 . . . . . . . . . 610 24.6.26 sct output clear registers 0 to 15 . . . . . . . . 610 24.7 functional description . . . . . . . . . . . . . . . . . . 611 24.7.1 match logic. . . . . . . . . . . . . . . . . . . . . . . . . . . 611 24.7.2 capture logic . . . . . . . . . . . . . . . . . . . . . . . . . 611 24.7.3 event selection. . . . . . . . . . . . . . . . . . . . . . . . 611 24.7.4 output generation . . . . . . . . . . . . . . . . . . . . 612 24.7.5 interrupt generation . . . . . . . . . . . . . . . . . . . 612 24.7.6 clearing the prescaler . . . . . . . . . . . . . . . . . 613 24.7.7 match vs. i/o events . . . . . . . . . . . . . . . . . . 613 24.7.8 dma operation . . . . . . . . . . . . . . . . . . . . . . . 614 24.7.9 alternate addressing for match/capture registers 614 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1156 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 24.7.10 sct operation . . . . . . . . . . . . . . . . . . . . . . . 615 24.7.10.1 configure the sct . . . . . . . . . . . . . . . . . . . . 615 24.7.10.1.1 configure the counter . . . . . . . . . . . . . . . . . 615 24.7.10.1.2 configure the match and capture registers 615 24.7.10.1.3 configure events and event responses . . . 616 24.7.10.1.4 configure multiple states . . . . . . . . . . . . . . 617 24.7.10.1.5 miscellaneous options . . . . . . . . . . . . . . . 617 24.7.10.2 operate the sct . . . . . . . . . . . . . . . . . . . . . 617 24.7.10.3 configure the sct without using states. . . . 618 24.7.10.4 example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 chapter 25: lpc18xx timer0/1/2/3 25.1 how to read this chapter . . . . . . . . . . . . . . . . 621 25.2 basic configuration . . . . . . . . . . . . . . . . . . . . 621 25.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621 25.4 general description . . . . . . . . . . . . . . . . . . . . 622 25.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 622 25.6 dma connections. . . . . . . . . . . . . . . . . . . . . . 623 25.7 register description . . . . . . . . . . . . . . . . . . . 623 25.7.1 timer interrupt registers . . . . . . . . . . . . . . . . 624 25.7.2 timer control registers . . . . . . . . . . . . . . . . . 625 25.7.3 timer counter . . . . . . . . . . . . . . . . . registers 625 25.7.4 timer prescale registers . . . . . . . . . . . . . . . 625 25.7.5 timer prescale counter registers . . . . . . . . . 626 25.7.6 timer match control registers. . . . . . . . . . . . 626 25.7.7 timer match registers (mr0 - mr3). . . . . . . 627 25.7.8 timer capture control registers . . . . . . . . . . 628 25.7.9 timer capture registers (cr0 - cr3) . . . . . . 629 25.7.10 timer external match registers . . . . . . . . . . 629 25.7.11 timer count control registers . . . . . . . . . . . . 631 25.7.12 dma operation . . . . . . . . . . . . . . . . . . . . . . . 632 25.8 example timer operation . . . . . . . . . . . . . . . 633 25.9 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 633 chapter 26: lpc18xx motor control pwm (motoconpwm) 26.1 how to read this chapter . . . . . . . . . . . . . . . . 635 26.2 basic configuration . . . . . . . . . . . . . . . . . . . . 635 26.3 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 635 26.4 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635 26.5 general description . . . . . . . . . . . . . . . . . . . . 635 26.5.1 block diagram . . . . . . . . . . . . . . . . . . . . . . . 637 26.6 pin description . . . . . . . . . . . . . . . . . . . . . . . . 637 26.7 register description . . . . . . . . . . . . . . . . . . . 638 26.7.1 mcpwm control register . . . . . . . . . . . . . . . 639 26.7.1.1 mcpwm control read address . . . . . . . . . . 639 26.7.1.2 mcpwm control set address . . . . . . . . . . . 641 26.7.1.3 mcpwm control clear address . . . . . . . . . . 641 26.7.2 pwm capture control register . . . . . . . . . . . 642 26.7.2.1 mcpwm capture control read address . . . 642 26.7.2.2 mcpwm capture control set address . . . . 643 26.7.2.3 mcpwm capture control clear address . . . 644 26.7.3 mcpwm timer/counter 0-2 registers . . . . . 646 26.7.4 mcpwm limit 0-2 registers . . . . . . . . . . . . . 646 26.7.5 mcpwm match 0-2 registers . . . . . . . . . . . . 647 26.7.5.1 match register in edge-aligned mode. . . . . . 647 26.7.5.2 match register in center-aligned mode . . . . 647 26.7.5.3 0 and 100% duty cycle . . . . . . . . . . . . . . . . . 647 26.7.6 mcpwm dead-time register . . . . . . . . . . . . 647 26.7.7 mcpwm communication pattern register . . 648 26.7.8 mcpwm capture read addresses . . . . . . . 649 26.7.9 mcpwm interrupt registers . . . . . . . . . . . . . 649 7.9.1 mcpwm interrupt enable read address . . . 649 26.7.9.2 mcpwm interrupt enable set address . . . . 650 26.7.9.3 mcpwm interrupt enable clear address . . 651 26.7.9.4 mcpwm interrupt flags read address . . . . 652 26.7.9.5 mcpwm interrupt flags set address . . . . . 653 26.7.9.6 mcpwm interrupt flags clear address . . . . 654 26.7.10 mcpwm count control register . . . . . . . . . 655 26.7.10.1 mcpwm count control read address . . . . 655 26.7.10.2 mcpwm count control set address . . . . . . 656 26.7.10.3 mcpwm count control clear address . . . . 657 26.7.11 mcpwm capture clear address . . . . . . . . . 659 26.8 functional description . . . . . . . . . . . . . . . . . 660 26.8.1 pulse-width modulation . . . . . . . . . . . . . . . . 660 edge-aligned pwm without dead-time. . . . . . 660 center-aligned pwm without dead-time . . . . 660 dead-time counter . . . . . . . . . . . . . . . . . . . . . 661 26.8.2 shadow registers and simultaneous updates 662 26.8.3 fast abort (abort). . . . . . . . . . . . . . . . . . . 662 26.8.4 capture events. . . . . . . . . . . . . . . . . . . . . . . 662 26.8.5 external event counting (counter mode) . . . 663 26.8.6 three-phase dc mode . . . . . . . . . . . . . . . . 663 26.8.7 three phase ac mode. . . . . . . . . . . . . . . . . 664 26.8.8 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 665 chapter 27: lpc18xx quadrature encoder interface (qei) 27.1 how to read this chapter . . . . . . . . . . . . . . . . 666 27.2 basic configuration . . . . . . . . . . . . . . . . . . . . 666 27.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666 27.4 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 667 27.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 669 27.6 register description . . . . . . . . . . . . . . . . . . . 669 27.6.1 control registers . . . . . . . . . . . . . . . . . . . . . . 671 27.6.1.1 qei control register . . . . . . . . . . . . . . . . . . . 671 27.6.1.2 qei configuration register . . . . . . . . . . . . . 671 27.6.1.3 qei status register . . . . . . . . . . . . . . . . . . . 672 27.6.2 position, index and timer registers. . . . . . . . 673 27.6.2.1 qei position register . . . . . . . . . . . . . . . . . . 673 27.6.2.2 qei maximum position register . . . . . . . . . 673 27.6.2.3 qei position compare register 0 . . . . . . . . 673 27.6.2.4 qei position compare register 1 . . . . . . . . 673 27.6.2.5 qei position compare register 2 . . . . . . . . 673 27.6.2.6 qei index count register . . . . . . . . . . . . . . 674 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1157 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 27.6.2.7 qei index compare register 0 . . . . . . . . . . . 674 27.6.2.8 qei timer reload register . . . . . . . . . . . . . . 674 27.6.2.9 qei timer register . . . . . . . . . . . . . . . . . . . . 674 27.6.2.10 qei velocity register . . . . . . . . . . . . . . . . . . 674 27.6.2.11 qei velocity capture register . . . . . . . . . . . 675 27.6.2.12 qei velocity compare register . . . . . . . . . . 675 27.6.2.13 qei digital filter on phase a input register . . 675 27.6.2.14 qei digital filter on phase b input register . . 675 27.6.2.15 qei digital filter on index input register . . . . 675 27.6.2.16 qei index acceptance window register . . . . 676 27.6.2.17 qei index compare register 1 . . . . . . . . . . . 676 27.6.2.18 qei index compare register 2 . . . . . . . . . . . 676 27.6.3 interrupt registers . . . . . . . . . . . . . . . . . . . . . 677 27.6.3.1 qei interrupt enable clear register . . . . . . . 677 27.6.3.2 qei interrupt enable set register . . . . . . . . 677 27.6.3.3 qei interrupt status register . . . . . . . . . . . . 678 27.6.3.4 qei interrupt enable register . . . . . . . . . . . 679 27.6.3.5 qei interrupt clear register . . . . . . . . . . . . . 679 27.6.3.6 qei interrupt set register . . . . . . . . . . . . . . 680 27.7 functional description . . . . . . . . . . . . . . . . . 680 27.7.1 input signals. . . . . . . . . . . . . . . . . . . . . . . . . 681 27.7.1.1 quadrature input signals . . . . . . . . . . . . . . . 681 27.7.1.2 digital input filtering . . . . . . . . . . . . . . . . . . . 682 27.7.2 position capture . . . . . . . . . . . . . . . . . . . . . . 682 27.7.3 velocity capture . . . . . . . . . . . . . . . . . . . . . . 682 27.7.4 velocity compare . . . . . . . . . . . . . . . . . . . . . 683 chapter 28: lpc18xx repetitive interrupt timer (rit) 28.1 how to read this chapter . . . . . . . . . . . . . . . . 684 28.2 basic configuration . . . . . . . . . . . . . . . . . . . . 684 28.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684 28.4 general description . . . . . . . . . . . . . . . . . . . . 684 28.5 register description . . . . . . . . . . . . . . . . . . . 685 28.5.1 ri compare value register . . . . . . . . . . . . . 685 28.5.2 ri mask register . . . . . . . . . . . . . . . . . . . . . 685 28.5.3 ri control register . . . . . . . . . . . . . . . . . . . . 685 28.5.4 ri counter register . . . . . . . . . . . . . . . . . . . 686 28.6 ri timer operation . . . . . . . . . . . . . . . . . . . . . 686 chapter 29: lpc18xx alarm timer 29.1 how to read this chapter . . . . . . . . . . . . . . . . 688 29.2 basic configuration . . . . . . . . . . . . . . . . . . . . 688 29.3 general description . . . . . . . . . . . . . . . . . . . . 688 29.4 register description . . . . . . . . . . . . . . . . . . . 689 29.4.1 downcounter register . . . . . . . . . . . . . . . . . . 689 29.4.2 preset value register. . . . . . . . . . . . . . . . . . . 689 29.4.3 interrupt clear enable register . . . . . . . . . . . 689 29.4.4 interrupt set enable register . . . . . . . . . . . . . 690 29.4.5 interrupt status register . . . . . . . . . . . . . . . . 690 29.4.6 interrupt enable register. . . . . . . . . . . . . . . . 690 29.4.7 clear status register. . . . . . . . . . . . . . . . . . . 690 29.4.8 set status register . . . . . . . . . . . . . . . . . . . . 690 chapter 30: lpc18xx windowed watchdog timer (wwdt) 30.1 how to read this chapter . . . . . . . . . . . . . . . . 691 30.2 basic configuration . . . . . . . . . . . . . . . . . . . . 691 30.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691 30.4 applications . . . . . . . . . . . . . . . . . . . . . . . . . . 692 30.5 description . . . . . . . . . . . . . . . . . . . . . . . . . . . 692 30.5.1 wwdt behavior in debug mode. . . . . . . . . . 692 30.6 clocking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693 30.7 register description . . . . . . . . . . . . . . . . . . . 693 30.7.1 watchdog mode register . . . . . . . . . . . . . . . 693 30.7.2 watchdog timer constant register . . . . . . . . 695 30.7.3 watchdog feed register . . . . . . . . . . . . . . . . 695 30.7.4 watchdog timer value register . . . . . . . . . . 696 30.7.5 watchdog timer warning interrupt register . 696 30.7.6 watchdog timer window register . . . . . . . . . 696 30.8 block diagram . . . . . . . . . . . . . . . . . . . . . . . . 697 30.9 watchdog timing examples . . . . . . . . . . . . . 697 chapter 31: lpc18xx real-time clock (rtc) 31.1 how to read this chapter . . . . . . . . . . . . . . . . 699 31.2 basic configuration . . . . . . . . . . . . . . . . . . . . 699 31.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699 31.4 general description . . . . . . . . . . . . . . . . . . . . 699 31.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 700 31.6 register description . . . . . . . . . . . . . . . . . . . 701 31.6.1 interrupt location register . . . . . . . . . . . . . 702 31.6.2 clock control register . . . . . . . . . . . . . . . . . 702 31.6.3 counter increment interrupt register . . . . . 703 31.6.4 alarm mask register . . . . . . . . . . . . . . . . . . 703 31.6.5 consolidated time registers . . . . . . . . . . . . . 704 31.6.5.1 consolidated time register 0 . . . . . . . . . . . 704 31.6.5.2 consolidated time register 1 . . . . . . . . . . . 704 31.6.5.3 consolidated time register 2 . . . . . . . . . . . 705 31.6.6 time counter group . . . . . . . . . . . . . . . . . . 705 31.6.6.1 leap year calculation . . . . . . . . . . . . . . . . . . 707 31.6.6.2 calibration register . . . . . . . . . . . . . . . . . . . 707 31.6.7 alarm register group . . . . . . . . . . . . . . . . . . 708 31.7 functional description . . . . . . . . . . . . . . . . . 710 31.7.1 calibration procedure. . . . . . . . . . . . . . . . . . 710 backward calibration . . . . . . . . . . . . . . . . . . . 710 forward calibration . . . . . . . . . . . . . . . . . . . . 710 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1158 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information chapter 32: lpc18xx usart0_2_3 32.1 how to read this chapter . . . . . . . . . . . . . . . . 712 32.2 basic configuration . . . . . . . . . . . . . . . . . . . . 712 32.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712 32.4 pin description . . . . . . . . . . . . . . . . . . . . . . . . 713 32.5 register description . . . . . . . . . . . . . . . . . . . 713 32.5.1 uart receiver buffer register . . . . . . . . . . 715 32.5.2 uart transmitter holding register . . . . . . 715 32.5.3 uart divisor latch lsb and msb registers . . . 715 32.5.4 uart interrupt enable register . . . . . . . . . . 716 32.5.5 uart interrupt identification register . . . . . 717 32.5.6 uart fifo control register . . . . . . . . . . . . 719 32.5.6.1 dma operation . . . . . . . . . . . . . . . . . . . . . . . 720 uart receiver dma . . . . . . . . . . . . . . . . . . . .720 uart transmitter dma . . . . . . . . . . . . . . . . . .720 32.5.7 uart line control register . . . . . . . . . . . . . 720 32.5.8 uart line status register . . . . . . . . . . . . . 721 32.5.9 uart scratch pad register . . . . . . . . . . . . 723 32.5.10 uart auto-baud control register . . . . . . . . 723 32.5.10.1 auto-baud . . . . . . . . . . . . . . . . . . . . . . . . . . . 724 32.5.10.2 auto-baud modes . . . . . . . . . . . . . . . . . . . . . 725 32.5.11 irda control register (uart3) . . . . . . . . . . 726 32.5.12 uart fractional divider register (u0fdr - 0x4000 8028) . . . . . . . . . . . . . . . . . . . . . . . . 727 32.5.12.1 baud rate calculation . . . . . . . . . . . . . . . . . . 728 32.5.12.1.1 example 1: uart_pclk = 14.7456 mhz, br = 9600 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730 32.5.12.1.2 example 2: uart_pclk = 12 mhz, br = 115200 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730 32.5.13 uart half-duplex enable register . . . . . . . . 730 32.5.14 uart smart card interface control register . 731 32.5.15 uart rs485 control register . . . . . . . . . . . 732 32.5.16 uart rs485 address match register . . . . . 733 32.5.17 uart1 rs485 delay value register. . . . . . . 734 32.5.18 uart synchronous mode control register . 734 32.5.19 uart transmit enable register . . . . . . . . . 736 32.6 functional description . . . . . . . . . . . . . . . . . 736 32.6.1 asynchronous mode . . . . . . . . . . . . . . . . . . 736 32.6.2 synchronous mode . . . . . . . . . . . . . . . . . . . 736 32.6.2.1 synchronous slave mode. . . . . . . . . . . . . . . 737 reception. . . . . . . . . . . . . . . . . . . . . . . . . . . . 737 transmission . . . . . . . . . . . . . . . . . . . . . . . . . 737 32.6.2.2 synchronous master mode . . . . . . . . . . . . . 738 32.6.3 rs-485/eia-485 modes of operation . . . . . . 738 rs-485/eia-485 normal multidrop mode (nmm) 738 rs-485/eia-485 auto address detection (aad) mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 rs-485/eia-485 auto direction control. . . . . 739 rs485/eia-485 driver delay time. . . . . . . . . . 739 rs485/eia-485 output inversion . . . . . . . . . . 739 32.6.4 smart card mode . . . . . . . . . . . . . . . . . . . . . 739 32.6.4.1 smart card set-up procedure . . . . . . . . . . . . 740 32.7 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 741 chapter 33: lpc18xx uart1 33.1 how to read this chapter . . . . . . . . . . . . . . . . 743 33.2 basic configuration . . . . . . . . . . . . . . . . . . . . 743 33.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743 33.4 pin description . . . . . . . . . . . . . . . . . . . . . . . . 744 33.5 register description . . . . . . . . . . . . . . . . . . . 745 33.5.1 uart1 receiver buffer register (when dlab = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . 747 33.5.2 uart1 transmitter holding register (when dlab = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . 747 33.5.3 uart1 divisor latch lsb and msb registers (when dlab = 1) . . . . . . . . . . . . . . . . . . . . . 747 33.5.4 uart1 interrupt enable register (when dlab = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . 748 33.5.5 uart1 interrupt identification register . . . . 749 33.5.6 uart1 fifo control register . . . . . . . . . . . 751 33.5.6.1 dma operation . . . . . . . . . . . . . . . . . . . . . . . 752 uart receiver dma . . . . . . . . . . . . . . . . . . . .752 uart transmitter dma . . . . . . . . . . . . . . . . . .752 33.5.7 uart1 line control register . . . . . . . . . . . 752 33.5.8 uart1 modem control register . . . . . . . . . 753 33.5.9 auto-flow control . . . . . . . . . . . . . . . . . . . . . . 754 33.5.9.1 auto-rts . . . . . . . . . . . . . . . . . . . . . . . . . . . 754 33.5.9.2 auto-cts . . . . . . . . . . . . . . . . . . . . . . . . . . . 755 33.5.10 uart1 line status register . . . . . . . . . . . . 756 33.5.11 uart1 modem status register . . . . . . . . . . 757 33.5.12 uart1 scratch pad register . . . . . . . . . . . 758 33.5.13 uart1 auto-baud control register . . . . . . 758 33.5.14 auto-baud . . . . . . . . . . . . . . . . . . . . . . . . . . 759 33.5.15 auto-baud modes. . . . . . . . . . . . . . . . . . . . . 760 33.5.16 uart1 fractional divider register . . . . . . . 761 33.5.16.1 baud rate calculation . . . . . . . . . . . . . . . . . . 762 33.5.16.1.1 example 1: pclk = 14.7456 mhz, br = 9600 . 764 33.5.16.1.2 example 2: pclk = 12 mhz, br = 115200 764 33.5.17 uart1 transmit enable register . . . . . . . . 764 33.5.18 uart1 rs485 control register . . . . . . . . . . 765 33.5.19 uart1 rs-485 address match register . . . 766 33.5.20 uart1 rs-485 delay value register . . . . . 766 33.5.21 rs-485/eia-485 modes of operation . . . . . . 766 rs-485/eia-485 normal multidrop mode (nmm) 766 rs-485/eia-485 auto address detection (aad) mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767 rs-485/eia-485 auto direction control. . . . . 767 rs485/eia-485 driver delay time. . . . . . . . . . 767 rs485/eia-485 output inversion . . . . . . . . . . 768 33.5.22 uart1 fifo level register . . . . . . . . . . . . . 768 33.6 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . 768 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1159 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information chapter 34: lpc18xx ssp0/1 34.1 how to read this chapter . . . . . . . . . . . . . . . . 770 34.2 basic configuration . . . . . . . . . . . . . . . . . . . . 770 34.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770 34.4 general description . . . . . . . . . . . . . . . . . . . . 770 34.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 771 34.6 register description . . . . . . . . . . . . . . . . . . . 771 34.6.1 sspcontr ol register 0 . . . . . . . . . . . . . . . . 772 34.6.2 ssp control register 1 . . . . . . . . . . . . . . . . 773 34.6.3 ssp data r egister . . . . . . . . . . . . . . . . . . . . 774 34.6.4 ssp status register . . . . . . . . . . . . . . . . . . 775 34.6.5 ssp clock presca le register . . . . . . . . . . . 775 34.6.6 ssp interrupt mask set/cl ear register . . . . 775 34.6.7 ssp raw interrup t status register . . . . . . . 776 34.6.8 ssp masked interrupt stat us register . . . . 776 34.6.9 ssp interrupt clear register . . . . . . . . . . . . 777 34.6.10 ssp dma control register . . . . . . . . . . . . . 777 34.7 functional description . . . . . . . . . . . . . . . . . 778 34.7.1 texas instruments synchronous serial frame format. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778 34.7.2 spi frame format . . . . . . . . . . . . . . . . . . . . . 779 34.7.2.1 clock polarity (cpol) and phase (cpha) control 779 34.7.2.2 spi format with cpol=0,cpha=0. . . . . . . . 779 34.7.2.3 spi format with cpol=0,cpha=1. . . . . . . . 780 34.7.2.4 spi format with cpol = 1,cpha = 0. . . . . . 781 34.7.2.5 spi format with cpol = 1,cpha = 1. . . . . . 782 34.7.3 national semiconductor microwire frame format . 783 34.7.3.1 setup and hold time requirements on cs with respect to sk in microwire mode . . . . . . . . . 784 chapter 35: lpc18xx i2s interface 35.1 how to read this chapter . . . . . . . . . . . . . . . . 785 35.2 basic configuration . . . . . . . . . . . . . . . . . . . . 785 35.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785 35.4 general description . . . . . . . . . . . . . . . . . . . . 786 35.4.1 i2s connection schemes . . . . . . . . . . . . . . . 786 35.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 788 35.6 register description . . . . . . . . . . . . . . . . . . . 790 35.6.1 i2s digital audio output register . . . . . . . . . 791 35.6.2 i2s digital audio input register . . . . . . . . . . . 792 35.6.3 i2s transmit fifo register . . . . . . . . . . . . . 792 35.6.4 receive fifo register . . . . . . . . . . . . . . . . . 792 35.6.5 i2s status feedback register . . . . . . . . . . . . 793 35.6.6 i2s dma configuration register 1 . . . . . . . . 793 35.6.7 i2s dma configuration register 2 . . . . . . . 794 35.6.8 i2s interrupt request control register . . . . . 794 35.6.9 i2s transmit clock rate register . . . . . . . . 795 35.6.9.1 notes on fractional rate generators . . . . . . . 795 35.6.10 i2s receive clock rate register . . . . . . . . . 796 35.6.11 i2s transmit clock bit rate register . . . . . . 796 35.6.12 i2s receive clock bit rate register . . . . . . 797 35.6.13 i2s transmit mode control register . . . . . . 797 35.6.14 i2s receive mode control register . . . . . . . 797 35.7 functional description . . . . . . . . . . . . . . . . . 798 35.7.1 i 2 s transmit and receive interfaces . . . . . . . 798 35.7.2 i 2 s operating modes . . . . . . . . . . . . . . . . . . 799 35.7.3 fifo controller . . . . . . . . . . . . . . . . . . . . . . . 804 chapter 36: lpc18xx c_can 36.1 how to read this chapter . . . . . . . . . . . . . . . . 806 36.2 basic configuration . . . . . . . . . . . . . . . . . . . . 806 36.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806 36.4 general description . . . . . . . . . . . . . . . . . . . . 807 36.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 808 36.6 register description . . . . . . . . . . . . . . . . . . . 809 register values at reset . . . . . . . . . . . . . . . . .809 timing of read/write operations . . . . . . . . . . .809 36.6.1 can protocol registers . . . . . . . . . . . . . . . . . 812 36.6.1.1 can control register . . . . . . . . . . . . . . . . . . . 812 36.6.1.2 can status register . . . . . . . . . . . . . . . . . . . 814 36.6.1.3 can error counter . . . . . . . . . . . . . . . . . . . . 815 36.6.1.4 can bit timing register . . . . . . . . . . . . . . . . . 816 36.6.1.5 can interrupt register . . . . . . . . . . . . . . . . . 816 36.6.1.6 can test register . . . . . . . . . . . . . . . . . . . . . 817 36.6.1.7 can baud rate prescaler extension register 817 36.6.2 message interface registers . . . . . . . . . . . . . 818 36.6.2.1 message objects . . . . . . . . . . . . . . . . . . . . . 819 36.6.2.2 can message interface command request registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819 36.6.2.3 can message interface command mask registers 821 transfer direction write . . . . . . . . . . . . . . . . . 821 transfer direction read . . . . . . . . . . . . . . . . . 823 36.6.2.4 if1 and if2 message buffer registers . . . . . 825 36.6.2.4.1 can message interface command mask 1 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825 36.6.2.4.2 can message interface command mask 2 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 826 36.6.2.4.3 can message interface command arbitration 1 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 827 36.6.2.4.4 can message interface command arbitration 2 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 827 36.6.2.4.5 can message interface message control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 829 36.6.2.4.6 can message interface data a1 registers . 832 36.6.2.4.7 can message interface data a2 registers. . 833 36.6.2.4.8 can message interface data b1 registers . 833 36.6.2.4.9 can message interface data b2 registers . 833 36.6.3 message handler registers. . . . . . . . . . . . . . 834 36.6.3.1 can transmission request 1 register . . . . . . 834 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1160 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 36.6.3.2 can transmission request 2 register . . . . . . 834 36.6.3.3 can new data 1 register. . . . . . . . . . . . . . . . 835 36.6.3.4 can new data 2 register . . . . . . . . . . . . . . . 835 36.6.3.5 can interrupt pending 1 register . . . . . . . . . 835 36.6.3.6 can interrupt pending 2 register . . . . . . . . . 836 36.6.3.7 can message valid 1 register . . . . . . . . . . . 836 36.6.3.8 can message valid 2 register . . . . . . . . . . . 836 36.6.4 can timing register . . . . . . . . . . . . . . . . . . . 837 36.6.4.1 can clock divider register . . . . . . . . . . . . . . 837 36.7 functional description . . . . . . . . . . . . . . . . . 837 36.7.1 c_can controller state after reset . . . . . . . . 837 36.7.2 c_can operating modes . . . . . . . . . . . . . . . 838 36.7.2.1 software initialization . . . . . . . . . . . . . . . . . . 838 36.7.2.2 can message transfer . . . . . . . . . . . . . . . . . 838 36.7.2.3 disabled automatic retransmission (dar) . 839 36.7.2.4 test modes . . . . . . . . . . . . . . . . . . . . . . . . . . 839 36.7.2.4.1 silent mode . . . . . . . . . . . . . . . . . . . . . . . . . 839 36.7.2.4.2 loop-back mode. . . . . . . . . . . . . . . . . . . . . . 840 36.7.2.4.3 loop-back mode combined with silent mode 840 36.7.2.4.4 basic mode. . . . . . . . . . . . . . . . . . . . . . . . . . 841 36.7.2.4.5 software control of pin can_txd . . . . . . . . 841 36.7.3 can message handler . . . . . . . . . . . . . . . . 842 36.7.3.1 management of message objects . . . . . . . . 843 36.7.3.2 data transfer between ifx registers and the message ram . . . . . . . . . . . . . . . . . . . . . . . 844 36.7.3.3 transmission of messages between the shift registers in the can core and the message buffer 844 36.7.3.4 acceptance filtering of received messages . 844 36.7.3.4.1 reception of a data frame . . . . . . . . . . . . . . 845 36.7.3.4.2 reception of a remote frame . . . . . . . . . . . . 845 36.7.3.5 receive/transmit priority . . . . . . . . . . . . . . . 845 36.7.3.6 configuration of a transmit object . . . . . . . . 845 36.7.3.7 updating a transmit object . . . . . . . . . . . . . . 846 36.7.3.8 configuration of a receive object . . . . . . . . . 846 36.7.3.9 handling of received messages. . . . . . . . . . 847 36.7.3.10 configuration of a fifo buffer . . . . . . . . . . . 848 36.7.3.10.1 reception of messages with fifo buffers. 848 36.7.3.10.2 reading from a fifo buffer . . . . . . . . . . . . 848 36.7.4 interrupt handling . . . . . . . . . . . . . . . . . . . . . 849 36.7.5 bit timing . . . . . . . . . . . . . . . . . . . . . . . . . . . 850 36.7.5.1 bit time and bit rate . . . . . . . . . . . . . . . . . . . 851 chapter 37: lpc18xx i2c-bus interface 37.1 how to read this chapter . . . . . . . . . . . . . . . . 853 37.2 basic configuration . . . . . . . . . . . . . . . . . . . . 853 37.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853 37.4 applications . . . . . . . . . . . . . . . . . . . . . . . . . . 854 37.5 general description . . . . . . . . . . . . . . . . . . . . 854 37.5.1 i 2 c fast-mode plus . . . . . . . . . . . . . . . . . . . 855 37.6 pin description . . . . . . . . . . . . . . . . . . . . . . . . 855 37.7 register description . . . . . . . . . . . . . . . . . . . 855 37.7.1 i 2 c control set register. . . . . . . . . . . . . . . . . 857 37.7.2 i 2 c status register. . . . . . . . . . . . . . . . . . . . . 859 37.7.3 i 2 c data register . . . . . . . . . . . . . . . . . . . . . 859 37.7.4 i 2 c slave address register 0 . . . . . . . . . . . . 860 37.7.5 i 2 c scl high and low dut y cycle registers 860 37.7.5.1 selecting the appropriate i 2 c data rate and duty cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860 37.7.6 i 2 c control clear register . . . . . . . . . . . . . . 861 37.7.7 i 2 c monitor mode control register. . . . . . . . . 862 37.7.7.1 interrupt in monitor mode . . . . . . . . . . . . . . . 863 37.7.7.2 loss of arbitration in monitor mode . . . . . . . 863 37.7.8 i 2 c slave address registers . . . . . . . . . . . . . 863 37.7.9 i 2 c data buffer register . . . . . . . . . . . . . . . . . 864 37.7.10 i 2 c mask registers . . . . . . . . . . . . . . . . . . . . 864 37.8 i 2 c operating modes . . . . . . . . . . . . . . . . . . . 865 37.8.1 master transmitter mode . . . . . . . . . . . . . . . 865 37.8.2 master receiver mode . . . . . . . . . . . . . . . . . 866 37.8.3 slave receiver mode . . . . . . . . . . . . . . . . . . 867 37.8.4 slave transmitter mode . . . . . . . . . . . . . . . . 868 37.9 i 2 c implementation and operation . . . . . . . . 868 37.9.1 input filters and output stages. . . . . . . . . . . . 869 37.9.2 address registers, adr0 to adr3 . . . . . . . 870 37.9.3 address mask register s, mask0 to mask3. 870 37.9.4 comparator. . . . . . . . . . . . . . . . . . . . . . . . . . 870 37.9.5 shift register, dat. . . . . . . . . . . . . . . . . . . . . 870 37.9.6 arbitration and synchronization logic . . . . . . 870 37.9.7 serial clock generator . . . . . . . . . . . . . . . . . 871 37.9.8 timing and control . . . . . . . . . . . . . . . . . . . . 872 37.9.9 control register, conset and conclr . . 872 37.9.10 status decoder and status register. . . . . . . . 872 37.10 details of i 2 c operating modes . . . . . . . . . . 872 37.10.1 master transmitter mode . . . . . . . . . . . . . . . 873 37.10.2 master receiver mode. . . . . . . . . . . . . . . . . 877 37.10.3 slave receiver mode. . . . . . . . . . . . . . . . . . 880 37.10.4 slave transmitter mode . . . . . . . . . . . . . . . . 884 37.10.5 miscellaneous states . . . . . . . . . . . . . . . . . . 886 37.10.5.1 stat = 0xf8 . . . . . . . . . . . . . . . . . . . . . . . . 886 37.10.5.2 stat = 0x00 . . . . . . . . . . . . . . . . . . . . . . . . 886 37.10.6 some special cases . . . . . . . . . . . . . . . . . . . 887 37.10.6.1 simultaneous repeated start conditions from two masters . . . . . . . . . . . . . . . . . . . . . . . . . 887 37.10.6.2 data transfer after loss of arbitration . . . . . . 888 37.10.6.3 forced access to the i 2 c-bus. . . . . . . . . . . . 888 37.10.6.4 i 2 c-bus obstructed by a low level on scl or sda 889 37.10.6.5 bus error . . . . . . . . . . . . . . . . . . . . . . . . . . . 889 37.10.7 i 2 c state service routines . . . . . . . . . . . . . . . 889 37.10.8 initialization . . . . . . . . . . . . . . . . . . . . . . . . . 890 37.10.9 i 2 c interrupt service . . . . . . . . . . . . . . . . . . . 890 37.10.10 the state service routines . . . . . . . . . . . . . . 890 37.10.11 adapting state services to an application. . . 890 37.11 software example . . . . . . . . . . . . . . . . . . . . . 890 37.11.1 initialization routine . . . . . . . . . . . . . . . . . . . 890 37.11.2 start master transmit function . . . . . . . . . . . 890 37.11.3 start master receive function . . . . . . . . . . . 891 37.11.4 i 2 c interrupt routine . . . . . . . . . . . . . . . . . . . 891 37.11.5 non mode specific states. . . . . . . . . . . . . . . 891 37.11.5.1 state: 0x00 . . . . . . . . . . . . . . . . . . . . . . . . . . 891 37.11.5.2 master states . . . . . . . . . . . . . . . . . . . . . . . . 891 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1161 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 37.11.5.3 state: 0x08 . . . . . . . . . . . . . . . . . . . . . . . . . . 891 37.11.5.4 state: 0x10 . . . . . . . . . . . . . . . . . . . . . . . . . . 892 37.11.6 master transmitter states . . . . . . . . . . . . . . . 892 37.11.6.1 state: 0x18 . . . . . . . . . . . . . . . . . . . . . . . . . . 892 37.11.6.2 state: 0x20 . . . . . . . . . . . . . . . . . . . . . . . . . . 892 37.11.6.3 state: 0x28 . . . . . . . . . . . . . . . . . . . . . . . . . . 892 37.11.6.4 state: 0x30 . . . . . . . . . . . . . . . . . . . . . . . . . . 893 37.11.6.5 state: 0x38 . . . . . . . . . . . . . . . . . . . . . . . . . . 893 37.11.7 master receive states . . . . . . . . . . . . . . . . . 893 37.11.7.1 state: 0x40 . . . . . . . . . . . . . . . . . . . . . . . . . . 893 37.11.7.2 state: 0x48 . . . . . . . . . . . . . . . . . . . . . . . . . . 893 37.11.7.3 state: 0x50 . . . . . . . . . . . . . . . . . . . . . . . . . . 893 37.11.7.4 state: 0x58 . . . . . . . . . . . . . . . . . . . . . . . . . . 894 37.11.8 slave receiver states . . . . . . . . . . . . . . . . . . 894 37.11.8.1 state: 0x60 . . . . . . . . . . . . . . . . . . . . . . . . . . 894 37.11.8.2 state: 0x68 . . . . . . . . . . . . . . . . . . . . . . . . . . 894 37.11.8.3 state: 0x70 . . . . . . . . . . . . . . . . . . . . . . . . . . 894 37.11.8.4 state: 0x78 . . . . . . . . . . . . . . . . . . . . . . . . . . 895 37.11.8.5 state: 0x80 . . . . . . . . . . . . . . . . . . . . . . . . . . 895 37.11.8.6 state: 0x88 . . . . . . . . . . . . . . . . . . . . . . . . . . 895 37.11.8.7 state: 0x90 . . . . . . . . . . . . . . . . . . . . . . . . . . 895 37.11.8.8 state: 0x98 . . . . . . . . . . . . . . . . . . . . . . . . . . 896 37.11.8.9 state: 0xa0. . . . . . . . . . . . . . . . . . . . . . . . . . 896 37.11.9 slave transmitter states . . . . . . . . . . . . . . . 896 37.11.9.1 state: 0xa8. . . . . . . . . . . . . . . . . . . . . . . . . . 896 37.11.9.2 state: 0xb0. . . . . . . . . . . . . . . . . . . . . . . . . . 896 37.11.9.3 state: 0xb8. . . . . . . . . . . . . . . . . . . . . . . . . . 896 37.11.9.4 state: 0xc0 . . . . . . . . . . . . . . . . . . . . . . . . . 897 37.11.9.5 state: 0xc8 . . . . . . . . . . . . . . . . . . . . . . . . . 897 chapter 38: lpc18xx 10-bit adc0/1 38.1 how to read this chapter . . . . . . . . . . . . . . . . 898 38.2 basic configuration . . . . . . . . . . . . . . . . . . . . 898 38.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898 38.4 general description . . . . . . . . . . . . . . . . . . . . 899 38.5 pin description . . . . . . . . . . . . . . . . . . . . . . . . 899 38.6 register description . . . . . . . . . . . . . . . . . . . 899 38.6.1 a/d control register . . . . . . . . . . . . . . . . . . . 901 38.6.2 a/d global data register . . . . . . . . . . . . . . . 903 38.6.3 a/d interrupt enable register . . . . . . . . . . . 903 38.6.4 a/d data registers . . . . . . . . . . . . . . . . . . . 904 38.6.5 a/d status register . . . . . . . . . . . . . . . . . . . . 904 38.7 operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905 38.7.1 hardware-triggered conversion . . . . . . . . . . 905 38.7.2 interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . 905 38.7.3 dma control . . . . . . . . . . . . . . . . . . . . . . . . . 905 chapter 39: lpc18xx dac 39.1 how to read this chapter . . . . . . . . . . . . . . . . 906 39.2 basic configuration . . . . . . . . . . . . . . . . . . . . 906 39.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906 39.4 pin description . . . . . . . . . . . . . . . . . . . . . . . . 906 39.5 register description . . . . . . . . . . . . . . . . . . . 907 39.5.1 d/a converter register . . . . . . . . . . . . . . . . . 907 39.5.2 d/a converter control register . . . . . . . . . . 907 39.5.3 d/a converter counter value register . . . . . 908 39.6 functional description . . . . . . . . . . . . . . . . . 908 39.6.1 dma counter . . . . . . . . . . . . . . . . . . . . . . . . 908 39.6.2 double buffering. . . . . . . . . . . . . . . . . . . . . . 908 chapter 40: lpc18xx flash programming interface 40.1 how to read this chapter . . . . . . . . . . . . . . . . 910 40.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 910 40.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910 40.4 description . . . . . . . . . . . . . . . . . . . . . . . . . . . 910 40.4.1 memory map after any reset. . . . . . . . . . . . . 911 40.4.1.1 criterion for valid user code . . . . . . . . . . . . 911 40.4.2 communication protocol . . . . . . . . . . . . . . . . 911 40.4.2.1 isp command format . . . . . . . . . . . . . . . . . . 912 40.4.2.2 isp response format . . . . . . . . . . . . . . . . . . . 912 40.4.2.3 isp data format. . . . . . . . . . . . . . . . . . . . . . . 912 40.4.2.4 isp flow control. . . . . . . . . . . . . . . . . . . . . . . 912 40.4.2.5 isp command abort . . . . . . . . . . . . . . . . . . . 912 40.4.2.6 interrupts during iap. . . . . . . . . . . . . . . . . . . 912 40.4.2.7 ram used by isp command handler . . . . . . 912 40.4.2.8 ram used by iap command handler . . . . . . 912 40.5 boot process flowchart . . . . . . . . . . . . . . . . . 913 40.6 sector numbers . . . . . . . . . . . . . . . . . . . . . . . 914 40.7 code read protection (crp) . . . . . . . . . . . . 915 40.8 isp commands . . . . . . . . . . . . . . . . . . . . . . . . 917 40.8.1 unlock . . . . . . . . . . . . . . . . . 917 40.8.2 set baud rate . . . . 918 40.8.3 echo . . . . . . . . . . . . . . . . . . . . . . . 918 40.8.4 write to ram 918 40.8.5 read memory
. . . 919 40.8.6 prepare sector(s) for write operation . . . . . . . . . . 920 40.8.7 copy ram to flash . . . . . . . . . . . . . . . . 920 40.8.8 go
. . . . . . . . . . . . . . . . 921 40.8.9 erase sector(s) . . . . . . . . . . . . . . . . . . . . . . 921 40.8.10 blank check sector(s) . . . . . . . . . . . . . . . . . . . . . . 922 40.8.11 read part identification number . . . . . . . . . 922 40.8.12 read boot code version number. . . . . . . . . 922 40.8.13 read device serial number . . . . . . . . . . . . . 922 40.8.14 compare 923 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1162 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 40.8.15 isp return codes. . . . . . . . . . . . . . . . . . . . . 923 40.9 iap commands . . . . . . . . . . . . . . . . . . . . . . . . 925 40.9.1 prepare sector(s) for write operation . . . . . . 926 40.9.2 copy ram to flash . . . . . . . . . . . . . . . . . . . 927 40.9.3 erase sector(s). . . . . . . . . . . . . . . . . . . . . . . 928 40.9.4 blank check sector(s) . . . . . . . . . . . . . . . . . . 928 40.9.5 read part identification number . . . . . . . . . . 928 40.9.6 read boot code version number . . . . . . . . . 929 40.9.7 read device serial number . . . . . . . . . . . . . . 929 40.9.8 compare 929 40.9.9 re-invoke isp. . . . . . . . . . . . . . . . . . . . . . . . 930 40.9.10 iap status codes . . . . . . . . . . . . . . . . . . . . . 930 40.10 jtag flash programming interface . . . . . . . 930 40.11 flash signature generation . . . . . . . . . . . . . 931 40.11.1 register description for signature generation 931 40.11.1.1 signature generation address and control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 932 40.11.1.2 signature generation result registers . . . . . . 932 40.11.1.3 flash module status register (fmstat - 0x0x4008 4fe0). . . . . . . . . . . . . . . . . . . . . . 933 40.11.1.4 flash module status clear register (fmstatclr - 0x0x4008 4fe8) . . . . . . . . . . . . . . . . . . . . 933 40.11.2 algorithm and procedure for signature generation 934 signature generation . . . . . . . . . . . . . . . . . . . 934 content verification . . . . . . . . . . . . . . . . . . . . 934 chapter 41: lpc18xx jtag, serial wire debug (swd), and trace functions 41.1 how to read this chapter . . . . . . . . . . . . . . . . 935 41.2 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 935 41.3 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 935 41.4 description . . . . . . . . . . . . . . . . . . . . . . . . . . . 935 41.5 pin description . . . . . . . . . . . . . . . . . . . . . . . 935 41.6 debug notes . . . . . . . . . . . . . . . . . . . . . . . . . 936 41.7 debug memory re-mapping . . . . . . . . . . . . . 937 41.8 jtag tap identification . . . . . . . . . . . . . . . . 937 chapter 42: appendix 42.1 lpc1850/30/20/10 rev ?-? nvic . . . . . . . . . . 938 42.1.1 how to read this chapter. . . . . . . . . . . . . . . . 938 42.1.2 basic configuration . . . . . . . . . . . . . . . . . . . . 938 42.1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938 42.1.4 general description . . . . . . . . . . . . . . . . . . . 938 42.1.5 pin description . . . . . . . . . . . . . . . . . . . . . . . 938 42.1.6 interrupt sources. . . . . . . . . . . . . . . . . . . . . . 939 42.1.7 vector table remapping. . . . . . . . . . . . . . . . . 940 examples: . . . . . . . . . . . . . . . . . . . . . . . . . . . .940 42.1.8 register description . . . . . . . . . . . . . . . . . . . 941 42.1.8.1 . . . interrupt set-enable register 0 register 942 42.1.8.2 interrupt clear-enable register 0 . . . . . . . . 944 42.1.8.3 . . interrupt set-pending register 0 register 946 42.1.8.4 . interrupt clear-pending register 0 register 949 42.1.8.5 interrupt active bit register 0 . . . . . . . . . . . 951 42.1.8.6 interrupt priority register 0 . . . . . . . . . . . . . 953 42.1.8.7 interrupt priority register 1 . . . . . . . . . . . . . 953 42.1.8.8 interrupt priority register 2. . . . . . . . . . . . . . 954 42.1.8.9 interrupt priority register 3 . . . . . . . . . . . . . 954 42.1.8.10 interrupt priority register 4 . . . . . . . . . . . . . 955 42.1.8.11 interrupt priority register 5 . . . . . . . . . . . . . 955 42.1.8.12 interrupt priority register 6. . . . . . . . . . . . . . 955 42.1.8.13 interrupt priority register 7 . . . . . . . . . . . . . 956 42.1.8.14 software trigger interrupt register (stir - 0xe000 ef00). . . . . . . . . . . . . . . . . . . . . . . . 956 42.2 lpc1850/30/20/10 rev ?-? event router. . . . . 957 42.2.1 how to read this chapter. . . . . . . . . . . . . . . . 957 42.2.2 basic configuration . . . . . . . . . . . . . . . . . . . . 957 42.2.3 general description . . . . . . . . . . . . . . . . . . . 957 42.2.4 event router inputs . . . . . . . . . . . . . . . . . . . . 958 42.2.5 pin description . . . . . . . . . . . . . . . . . . . . . . . 958 42.2.6 register description . . . . . . . . . . . . . . . . . . . 958 42.2.6.1 level configuration register . . . . . . . . . . . . . 959 42.2.6.2 edge configuration register. . . . . . . . . . . . . . 961 42.2.6.3 interrupt clear enable register . . . . . . . . . . . 964 42.2.6.4 event set enable register . . . . . . . . . . . . . . . 965 42.2.6.5 event status register . . . . . . . . . . . . . . . . . . 966 42.2.6.6 event enable register . . . . . . . . . . . . . . . . . . 967 42.2.6.7 clear status register. . . . . . . . . . . . . . . . . . . 968 42.2.6.8 set status register . . . . . . . . . . . . . . . . . . . . 969 42.3 lpc1850/30/20/10 rev ?-? creg . . . . . . . . . 970 42.3.1 how to read this chapter . . . . . . . . . . . . . . . 970 42.3.2 basic configuration. . . . . . . . . . . . . . . . . . . . 970 42.3.3 features. . . . . . . . . . . . . . . . . . . . . . . . . . . . 970 42.3.4 register description . . . . . . . . . . . . . . . . . . . 971 42.3.4.1 irc trim register. . . . . . . . . . . . . . . . . . . . . . 971 42.3.4.2 creg0 control register . . . . . . . . . . . . . . . . 972 42.3.4.3 power mode control register . . . . . . . . . . . . 972 42.3.4.4 arm cortex-m3 memory mapping register . 973 42.3.4.5 creg5 control register . . . . . . . . . . . . . . . . 973 42.3.4.6 dma muxing register . . . . . . . . . . . . . . . . . . 973 42.3.4.7 etb sram configuration register . . . . . . . . 976 42.3.4.8 creg6 control register . . . . . . . . . . . . . . . . 976 42.3.4.9 part id register. . . . . . . . . . . . . . . . . . . . . . . 977 42.4 lpc1850/30/20/10 rev ?-? cgu . . . . . . . . . . 977 42.4.1 how to read this chapter . . . . . . . . . . . . . . . 977 42.4.2 basic configuration. . . . . . . . . . . . . . . . . . . . 978 42.4.3 features. . . . . . . . . . . . . . . . . . . . . . . . . . . . 978 42.4.4 general description . . . . . . . . . . . . . . . . . . . 978 42.4.5 pin description . . . . . . . . . . . . . . . . . . . . . . . 982 42.4.6 register description . . . . . . . . . . . . . . . . . . . 982 42.4.6.1 frequency monitor register . . . . . . . . . . . . . 983 42.4.6.2 crystal oscillator control register . . . . . . . . . 985 42.4.6.3 pll0 (for usb0) registers . . . . . . . . . . . . . . 986 42.4.6.3.1 pll0 status register . . . . . . . . . . . . . . . . . . . 986 42.4.6.3.2 pll0 control register . . . . . . . . . . . . . . . . . . 986 42.4.6.3.3 pll0 m-divider register . . . . . . . . . . . . . . . . 987 42.4.6.3.4 pll0 np-divider register . . . . . . . . . . . . . . . 987 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra all information provided in this document is subject to legal disclaimers. ? nxp b.v. 2011. all rights reserved. user manual rev. 00.13 ? 20 july 2011 1163 of 1164 nxp semiconductors UM10430 chapter 43: supplementary information 42.4.6.4 pll1 registers . . . . . . . . . . . . . . . . . . . . . . . 988 42.4.6.4.1 pll1 status register . . . . . . . . . . . . . . . . . . . 988 42.4.6.4.2 pll1 control register . . . . . . . . . . . . . . . . . . 988 42.4.6.5 integer divider register a . . . . . . . . . . . . . . . 989 42.4.6.6 integer divider register b, c, d . . . . . . . . . . . 990 42.4.6.7 integer divider register e . . . . . . . . . . . . . . . 991 42.4.6.8 output stage 0 control register . . . . . . . . . . . 992 42.4.6.9 output stage 1 control register . . . . . . . . . . . 992 42.4.6.10 output stage 3 to 19 control registers. . . . . . 993 42.4.6.11 output stage 20 register . . . . . . . . . . . . . . . . 994 42.4.7 functional description. . . . . . . . . . . . . . . . . . 995 42.4.7.1 32 khz oscillator . . . . . . . . . . . . . . . . . . . . . . 995 42.4.7.2 irc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 995 42.4.7.3 crystal oscillator . . . . . . . . . . . . . . . . . . . . . . 995 42.4.7.4 pll0 (for usb0) . . . . . . . . . . . . . . . . . . . . . . 997 42.4.7.4.1 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 997 42.4.7.4.2 pll0 description. . . . . . . . . . . . . . . . . . . . . . 997 42.4.7.4.3 use of pll0 operating modes . . . . . . . . . . . 998 42.4.7.4.4 settings for usb0 . . . . . . . . . . . . . . . . . . . 1000 42.4.7.4.5 usage notes . . . . . . . . . . . . . . . . . . . . . . . . 1000 42.4.7.5 pll1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1000 42.4.7.5.1 features . . . . . . . . . . . . . . . . . . . . . . . . . . . 1000 42.4.7.5.2 pll1 description. . . . . . . . . . . . . . . . . . . . . 1001 pre-divider . . . . . . . . . . . . . . . . . . . . . . . . . .1002 post-divider. . . . . . . . . . . . . . . . . . . . . . . . . .1002 feedback divider . . . . . . . . . . . . . . . . . . . . .1002 changing the divider values . . . . . . . . . . . . .1002 integer mode . . . . . . . . . . . . . . . . . . . . . . . .1002 non-integer mode . . . . . . . . . . . . . . . . . . . . .1003 direct mode . . . . . . . . . . . . . . . . . . . . . . . . .1003 power-down mode . . . . . . . . . . . . . . . . . . . .1003 42.4.8 example cgu configurations . . . . . . . . . . . 1003 42.4.8.1 programming the cgu for deep-sleep and power-down modes . . . . . . . . . . . . . . . . . . 1003 42.4.8.2 programming the cgu for using i2s at peripheral clock rate of 30 mhz . . . . . . . . . . . . . . . . . . 1004 42.5 lpc1850/30/20/10 rev ?-? ccu . . . . . . . . . . 1004 42.5.1 how to read this chapter. . . . . . . . . . . . . . . 1004 42.5.2 basic configuration . . . . . . . . . . . . . . . . . . . 1005 42.5.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . 1005 42.5.4 general description . . . . . . . . . . . . . . . . . . 1005 42.5.5 register description . . . . . . . . . . . . . . . . . . 1008 42.5.5.1 power mode register . . . . . . . . . . . . . . . . . 1011 42.5.5.2 base clock status register. . . . . . . . . . . . . . 1012 42.5.5.3 ccu1/2 branch clock configuration registers . . . . 1013 42.5.5.4 ccu1/2 branch clock status registers . . . . 1014 42.6 lpc1850/30/20/10 rev ?-? pin configuration . . . . 1015 42.6.1 pin description . . . . . . . . . . . . . . . . . . . . . . 1015 42.7 lpc1850/30/20/10 rev ?-? scu . . . . . . . . . . 1039 42.7.1 how to read this chapter. . . . . . . . . . . . . . . 1039 42.7.2 basic configuration . . . . . . . . . . . . . . . . . . . 1039 42.7.3 general description . . . . . . . . . . . . . . . . . . 1040 42.7.3.1 digital pin function . . . . . . . . . . . . . . . . . . . 1040 42.7.3.2 digital pin mode . . . . . . . . . . . . . . . . . . . . . 1040 42.7.3.3 i 2 c0-bus pins . . . . . . . . . . . . . . . . . . . . . . . 1040 42.7.3.4 usb1 dp1/dm1 pins . . . . . . . . . . . . . . . . . 1040 42.7.3.5 emc signal delay control . . . . . . . . . . . . . . 1040 42.7.4 register description . . . . . . . . . . . . . . . . . . 1041 42.7.4.1 pin configuration registers for pins p0_n to pf_n and clk0 to clk3 . . . . . . . . . . . . . . . . . . . 1047 42.7.4.2 pin configuration register for usb1 pins dp1/dm1 1047 42.7.4.3 pin configuration register for open-drain i 2 c-bus pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1048 42.7.4.4 emc clock delay register . . . . . . . . . . . . . . 1048 42.7.4.5 emc control delay register. . . . . . . . . . . . . 1049 42.7.4.6 emc chip select delay register . . . . . . . . . 1049 42.7.4.7 emc data out delay register . . . . . . . . . . . 1050 42.7.4.8 emc feedback clock delay register . . . . . . 1051 42.7.4.9 emc address delay register 0 . . . . . . . . . . 1051 42.7.4.10 emc address delay register 1 . . . . . . . . . . 1052 42.7.4.11 emc address delay register 2 . . . . . . . . . . 1052 42.7.4.12 emc data in delay register . . . . . . . . . . . . 1053 42.8 lpc1850/30/20/10 rev ?-? gpio . . . . . . . . . 1054 42.8.1 basic configuration. . . . . . . . . . . . . . . . . . . 1054 42.8.2 features. . . . . . . . . . . . . . . . . . . . . . . . . . . 1054 42.8.3 pin description . . . . . . . . . . . . . . . . . . . . . . 1054 42.8.4 register description . . . . . . . . . . . . . . . . . . 1054 42.8.4.1 gpio port direction register (dir) . . . . . . . 1056 42.8.4.2 gpio port mask register (mask). . . . . . . . 1057 42.8.4.3 gpio port pin value register (pin) . . . . . . . 1058 42.8.4.4 gpio port output set register (set). . . . . . 1059 42.8.4.5 gpio port output clear register (clr) . . . . 1060 42.9 lpc1850/30/20/10 rev ?-? i2s. . . . . . . . . . . 1061 42.9.1 how to read this chapter . . . . . . . . . . . . . . 1061 42.9.2 basic configuration. . . . . . . . . . . . . . . . . . . 1061 42.9.3 features. . . . . . . . . . . . . . . . . . . . . . . . . . . 1062 42.9.4 general description . . . . . . . . . . . . . . . . . . 1062 42.9.5 pin description . . . . . . . . . . . . . . . . . . . . . . 1064 42.9.6 register description . . . . . . . . . . . . . . . . . . 1066 42.9.6.1 i2s digital audio output register . . . . . . . . 1066 42.9.6.2 i2s digital audio input register . . . . . . . . . 1067 42.9.6.3 i2s transmit fifo register . . . . . . . . . . . . 1067 42.9.6.4 receive fifo register . . . . . . . . . . . . . . . . 1068 42.9.6.5 i2s status feedback register. . . . . . . . . . . 1068 42.9.6.6 i2s dma configuration register 1 . . . . . . 1068 42.9.6.7 i2s dma configuration register 2 . . . . . . 1069 42.9.6.8 i2s interrupt request control register . . . . 1069 42.9.6.9 i2s transmit clock rate register . . . . . . . 1070 42.9.6.9.1 notes on fractional rate generators . . . . . . 1070 42.9.6.10 i2s receive clock rate register . . . . . . . . 1071 42.9.6.11 i2s transmit clock bit rate register . . . . . 1071 42.9.6.12 i2s receive clock bit rate register . . . . . 1071 42.9.6.13 i2s transmit mode control register . . . . . 1072 42.9.6.14 i2s receive mode control register . . . . . . 1072 42.9.7 functional description . . . . . . . . . . . . . . . . 1073 42.9.7.1 i 2 s transmit and receive interfaces . . . . . . 1073 42.9.7.2 i 2 s operating modes . . . . . . . . . . . . . . . . . 1074 42.9.7.3 fifo controller . . . . . . . . . . . . . . . . . . . . . . 1078 42.10 lpc1850/30/20/10 rev ?-? c_can . . . . . . . 1080 42.10.1 how to read this chapter . . . . . . . . . . . . . . 1080 42.10.2 basic configuration. . . . . . . . . . . . . . . . . . . 1080 42.10.3 features. . . . . . . . . . . . . . . . . . . . . . . . . . . 1081 42.10.4 general description . . . . . . . . . . . . . . . . . . 1081 www.datasheet.co.kr datasheet pdf - http://www..net/
draft draft draft dr draft draft draft d raf draft draft dra f t d raft dr aft d dra f t draft draft d raft draft d raft dra nxp semiconductors UM10430 chapter 43: supplementary information ? nxp b.v. 2011. all rights reserved. for more information, please visit: http://www.nxp.com for sales office addresses, please se nd an email to: salesaddresses@nxp.com date of release: 20 july 2011 document identifier: please be aware that important notices concerning this document and the product(s) described herein, have been included in section ?legal information?. 1164 42.10.5 pin description . . . . . . . . . . . . . . . . . . . . . . 1082 42.10.6 register description . . . . . . . . . . . . . . . . . . 1083 register values at reset . . . . . . . . . . . . . . . .1083 timing of read/write operations . . . . . . . . . .1083 42.10.6.1 can protocol registers . . . . . . . . . . . . . . . . 1084 42.10.6.1.1 can control register . . . . . . . . . . . . . . . . . 1084 42.10.6.1.2 can status register . . . . . . . . . . . . . . . . . 1086 42.10.6.1.3 can error counter . . . . . . . . . . . . . . . . . . 1087 42.10.6.1.4 can bit timing register . . . . . . . . . . . . . . . 1088 42.10.6.1.5 can interrupt register . . . . . . . . . . . . . . . 1088 42.10.6.1.6 can test register . . . . . . . . . . . . . . . . . . . 1089 42.10.6.1.7 can baud rate prescaler extension register . . . 1089 42.10.6.2 message interface registers . . . . . . . . . . . . 1090 42.10.6.2.1 message objects . . . . . . . . . . . . . . . . . . . 1091 42.10.6.2.2 can message interface command request registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091 42.10.6.2.3 can message interface command mask registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 1092 transfer direction write . . . . . . . . . . . . . . . .1092 transfer direction read . . . . . . . . . . . . . . . .1093 42.10.6.2.4 if1 and if2 message buffer registers. . . . 1094 42.10.6.3 message handler registers . . . . . . . . . . . . . 1099 42.10.6.3.1 can transmission request 1 register . . . . 1099 42.10.6.3.2 can transmission request 2 register . . . . 1100 42.10.6.3.3 can new data 1 register . . . . . . . . . . . . . 1100 42.10.6.3.4 can new data 2 register . . . . . . . . . . . . . 1100 42.10.6.3.5 can interrupt pending 1 register . . . . . . . 1101 42.10.6.3.6 can interrupt pending 2 register . . . . . . . 1101 42.10.6.3.7 can message valid 1 register . . . . . . . . . 1102 42.10.6.3.8 can message valid 2 register . . . . . . . . . 1102 42.10.6.4 can timing register . . . . . . . . . . . . . . . . . . . 1102 42.10.6.4.1 can clock divider register . . . . . . . . . . . . 1102 42.10.7 functional description . . . . . . . . . . . . . . . . . 1103 42.10.7.1 c_can controller state after reset . . . . . . . . 1103 42.10.7.2 c_can operating modes . . . . . . . . . . . . . . . 1103 42.10.7.2.1 software initialization . . . . . . . . . . . . . . . . . 1103 42.10.7.2.2 can message transfer . . . . . . . . . . . . . . . 1104 42.10.7.2.3 disabled automatic retransmission (dar) 1104 42.10.7.2.4 test modes . . . . . . . . . . . . . . . . . . . . . . . . 1105 42.10.7.3 can message handler . . . . . . . . . . . . . . . . 1107 42.10.7.3.1 management of message objects . . . . . . . 1108 42.10.7.3.2 data transfer between ifx registers and the message ram . . . . . . . . . . . . . . . . . . . . . . . 1109 42.10.7.3.3 transmission of messages between the shift registers in the can core and the message buffer 1109 42.10.7.3.4 acceptance filtering of received messages 1109 42.10.7.3.5 receive/transmit priority . . . . . . . . . . . . . . 1110 42.10.7.3.6 configuration of a transmit object . . . . . . . 1110 42.10.7.3.7 updating a transmit object . . . . . . . . . . . . . 1111 42.10.7.3.8 configuration of a receive object . . . . . . . . 1111 42.10.7.3.9 handling of received messages. . . . . . . . . 1112 42.10.7.3.10 configuration of a fifo buffer . . . . . . . . . 1112 42.10.7.4 interrupt handling . . . . . . . . . . . . . . . . . . . . . 1114 42.10.7.5 bit timing . . . . . . . . . . . . . . . . . . . . . . . . . . . 1115 42.10.7.5.1 bit time and bit rate . . . . . . . . . . . . . . . . . . 1116 42.11 lpc1850/30/20/10 rev ?-? sct interconnections 1117 42.11.1 input muxing for state configurable timer and general purpose timers . . . . . . . . . . . . . . . . 1117 chapter 43: supplementary information 43.1 abbreviations . . . . . . . . . . . . . . . . . . . . . . . . 1119 43.2 legal information. . . . . . . . . . . . . . . . . . . . . 1121 43.2.1 definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 1121 43.2.2 disclaimers . . . . . . . . . . . . . . . . . . . . . . . . . 1121 43.2.3 trademarks. . . . . . . . . . . . . . . . . . . . . . . . . 1121 43.3 tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1122 43.4 figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1143 43.5 contents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1146 www.datasheet.co.kr datasheet pdf - http://www..net/


▲Up To Search▲   

 
Price & Availability of UM10430

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X